旗开得胜
This commit is contained in:
@ -1,115 +0,0 @@
|
||||
package com.greenorange.promotion.controller.user;
|
||||
|
||||
import com.greenorange.promotion.annotation.AuthCheck;
|
||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
||||
import com.greenorange.promotion.common.BaseResponse;
|
||||
import com.greenorange.promotion.common.ResultUtils;
|
||||
import com.greenorange.promotion.constant.UserConstant;
|
||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||
import com.greenorange.promotion.model.dto.user.UserAddRequest;
|
||||
import com.greenorange.promotion.model.dto.user.UserQueryRequest;
|
||||
import com.greenorange.promotion.model.dto.user.UserUpdateRequest;
|
||||
import com.greenorange.promotion.model.vo.user.UserVO;
|
||||
import com.greenorange.promotion.service.user.UserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 用户表 控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("user")
|
||||
@Slf4j
|
||||
@Tag(name = "用户表管理")
|
||||
public class UserController {
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* web端管理员添加用户
|
||||
* @param userAddRequest 用户添加请求体
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
@PostMapping("add")
|
||||
@Operation(summary = "web端管理员添加用户", description = "参数:用户表添加请求体,权限:管理员(boss, admin),方法名:addUser")
|
||||
@RequiresPermission(roles = UserConstant.ADMIN_ROLE)
|
||||
public BaseResponse<Long> addUser(@RequestBody UserAddRequest userAddRequest) {
|
||||
return ResultUtils.success(userService.addUser(userAddRequest));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* web端管理员更新用户表
|
||||
* @param userUpdateRequest 用户更新请求体
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@PostMapping("update")
|
||||
@Operation(summary = "web端管理员更新用户", description = "参数:用户更新请求体,权限:管理员(boss, admin),方法名:updateUser")
|
||||
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
||||
public BaseResponse<Boolean> updateUser(@RequestBody UserUpdateRequest userUpdateRequest) {
|
||||
return ResultUtils.success(userService.updateUser(userUpdateRequest));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* web端管理员删除用户
|
||||
* @param commonRequest 用户删除请求体
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delete")
|
||||
@Operation(summary = "web端管理员删除用户", description = "参数:用户删除请求体,权限:管理员(boss, admin),方法名:deleteUser")
|
||||
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
||||
public BaseResponse<Boolean> deleteUser(@RequestBody CommonRequest commonRequest) {
|
||||
return ResultUtils.success(userService.deleteUser(commonRequest));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Web端管理员分页查看用户表
|
||||
* @param userQueryRequest 用户表查询请求体
|
||||
* @return 用户表列表
|
||||
*/
|
||||
@PostMapping("page")
|
||||
@Operation(summary = "Web端管理员分页查看用户表", description = "参数:用户表查询请求体,权限:管理员(boss, admin),方法名:listUserByPage")
|
||||
@RequiresPermission(roles = UserConstant.ADMIN_ROLE)
|
||||
public BaseResponse<Boolean> listUserByPage(@RequestBody UserQueryRequest userQueryRequest) {
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* web端管理员根据id查询用户表
|
||||
* @param commonRequest 用户表查询请求体
|
||||
* @return 用户表信息
|
||||
*/
|
||||
@PostMapping("queryById")
|
||||
@Operation(summary = "web端管理员根据id查询用户表", description = "参数:用户表查询请求体,权限:管理员(boss, admin),方法名:queryUserById")
|
||||
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
||||
public BaseResponse<UserVO> queryUserById(@RequestBody CommonRequest commonRequest) {
|
||||
return ResultUtils.success(userService.queryUserById(commonRequest));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* web端管理员批量删除用户
|
||||
* @param commonBatchRequest id列表
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delBatch")
|
||||
@Operation(summary = "web端管理员批量删除用户", description = "参数:id列表,权限:管理员(boss, admin),方法名:delBatchUser")
|
||||
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
||||
public BaseResponse<Boolean> delBatchUser(@RequestBody CommonBatchRequest commonBatchRequest) {
|
||||
return ResultUtils.success(userService.delBatchUser(commonBatchRequest));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user