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

import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.app.dto.cmd.user.approve.AccountApproveCmd;
import com.red.circle.other.app.dto.cmd.user.user.AccountQryCmd;
import com.red.circle.other.app.service.user.approve.UserProfileApproveService;
import com.red.circle.other.inner.model.dto.user.approve.UserProfileApproveDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户资料审核管理.
 *
 * @author lixiaofei on 2024/8/20
 * @eo.api-type http
 * @eo.groupName 用户服务.用户资料
 * @eo.path /user/approve
 */
@RestController
@RequestMapping(value = "/user/approve", produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class UserProfileApproveController extends BaseController {

  private final UserProfileApproveService userProfileApproveService;

  /**
   * 用户资料审核查询管理.
   *
   * @eo.name 用户资料审核查询管理.
   * @eo.url /search
   * @eo.method get
   * @eo.request-type formdata
   */
  @GetMapping("/search")
  public UserProfileApproveDTO search(AccountQryCmd cmd) {
    return userProfileApproveService.search(cmd);
  }

  /**
   * 用户资料审批管理.
   *
   * @eo.name 用户资料审批管理.
   * @eo.url /approve
   * @eo.method get
   * @eo.request-type formdata
   */
  @PostMapping("/approve")
  public void approve(AccountApproveCmd cmd) {
      userProfileApproveService.approve(cmd);
  }

}
