package com.red.circle.console.adapter.app.user;


import com.red.circle.console.app.dto.clienobject.user.UserBeautifulNumberApplyCO;
import com.red.circle.console.app.service.app.user.UserBeautifulNumberApplyService;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.inner.model.cmd.user.UserBeautifulNumberApplyQryCmd;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户申请靓号记录 前端控制器.
 * </p>
 *
 * @author pengshigang
 * @since 2021-07-20
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/beautiful/number/apply")
public class UserBeautifulNumberApplyRestController extends BaseController {

  private final UserBeautifulNumberApplyService userBeautifulNumberApplyService;

  /**
   * 分页.
   */
  @GetMapping("/page")
  public PageResult<UserBeautifulNumberApplyCO> pageData(
      UserBeautifulNumberApplyQryCmd query) {
    return userBeautifulNumberApplyService.pageData(query);
  }

  /**
   * 处理申请.
   */
  @GetMapping("/handle/{id}/{state}")
  public void handleApply(
      @PathVariable("id") Long id,
      @PathVariable("state") Integer state) {
    userBeautifulNumberApplyService.handleApply(id, state);
  }


}
