package org.springblade.modules.app.web.admin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.common.auth.permission.DisableLoginVerify;
import com.wn.common.controller.BaseController;
import com.wn.common.datamodel.ResultDTO;
import org.springblade.modules.app.common.dto.UserDTO;
import org.springblade.modules.app.common.query.AdminUserQuery;
import org.springblade.modules.app.common.vo.ApprovalVO;
import org.springblade.modules.app.manager.UserManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: AdminUserController
 * @Description:
 * @author: fxs
 * @createTime: 2021-11-22-16:11
 */
@RestController
@RequestMapping("app/admin/register")
@Api(value = "注册用户管理-管理端", tags = "注册用户管理-管理端")
public class AdminRegisterController extends BaseController {

    @Autowired
    private UserManager userManager;

    //@ApiOperation(value = "分页查询用户注册信息列表")
    @GetMapping("/page")
    public ResponseEntity<ResultDTO<Page<UserDTO>>> pageRegisterUser(AdminUserQuery userQuery) {
        return success(userManager.pageRegisterUser(userQuery));
    }

    //@ApiOperation(value = "审批用户")
    @PutMapping("/approval")
    @DisableLoginVerify
    public ResponseEntity<ResultDTO<Boolean>> approvalRegisterUser(@RequestBody ApprovalVO approvalVO) {
        return success(userManager.approvalRegisterUser(approvalVO));
    }
}
