|
@@ -0,0 +1,87 @@
|
|
|
+package com.zanxiang.game.module.manage.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.zanxiang.erp.security.annotation.PreAuthorize;
|
|
|
+import com.zanxiang.game.module.manage.pojo.params.GameAuthGroupAddUpdateParam;
|
|
|
+import com.zanxiang.game.module.manage.pojo.params.GameAuthGroupListParam;
|
|
|
+import com.zanxiang.game.module.manage.pojo.params.GameAuthRoleGroupAddParam;
|
|
|
+import com.zanxiang.game.module.manage.pojo.params.GameAuthRoleGroupListParam;
|
|
|
+import com.zanxiang.game.module.manage.pojo.vo.GameAuthGroupVO;
|
|
|
+import com.zanxiang.game.module.manage.pojo.vo.GameAuthRoleGroupVO;
|
|
|
+import com.zanxiang.game.module.manage.service.IGameAuthGroupService;
|
|
|
+import com.zanxiang.game.module.manage.service.IGameAuthRoleGroupService;
|
|
|
+import com.zanxiang.module.util.pojo.ResultVO;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiResponse;
|
|
|
+import io.swagger.annotations.ApiResponses;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author : lingfeng
|
|
|
+ * @time : 2024-05-21
|
|
|
+ * @description : 角色授权分组
|
|
|
+ */
|
|
|
+@Api(tags = {"角色授权分组接口"})
|
|
|
+@RestController
|
|
|
+@RequestMapping("/game/auth/group")
|
|
|
+@Slf4j
|
|
|
+public class GameAuthGroupController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IGameAuthGroupService gameAuthGroupService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IGameAuthRoleGroupService gameAuthRoleGroupService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "授权分组列表查询")
|
|
|
+ @PostMapping(value = "/listOfPage")
|
|
|
+ @PreAuthorize(permissionKey = "manage:gameAuthGroup:listOfPage")
|
|
|
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameAuthGroupVO.class)})
|
|
|
+ public ResultVO<IPage<GameAuthGroupVO>> listOfPage(@Validated @RequestBody GameAuthGroupListParam param) {
|
|
|
+ return ResultVO.ok(gameAuthGroupService.listOfPage(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "授权分组新增或者修改")
|
|
|
+ @PostMapping(value = "/add/or/update")
|
|
|
+ @PreAuthorize(permissionKey = "manage:gameAuthGroup:addOrUpdate")
|
|
|
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
|
|
|
+ public ResultVO<Boolean> addOrUpdate(@Validated @RequestBody GameAuthGroupAddUpdateParam param) {
|
|
|
+ return ResultVO.ok(gameAuthGroupService.addOrUpdate(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "授权分组删除")
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ @PreAuthorize(permissionKey = "manage:gameAuthGroup:deleteById")
|
|
|
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
|
|
|
+ public ResultVO<Boolean> deleteById(@RequestParam Long id) {
|
|
|
+ return ResultVO.ok(gameAuthGroupService.deleteById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "授权角色分组列表查询")
|
|
|
+ @PostMapping(value = "/role/listOfPage")
|
|
|
+ @PreAuthorize(permissionKey = "manage:gameAuthGroupRole:listOfPage")
|
|
|
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameAuthRoleGroupVO.class)})
|
|
|
+ public ResultVO<IPage<GameAuthRoleGroupVO>> list(@Validated @RequestBody GameAuthRoleGroupListParam param) {
|
|
|
+ return ResultVO.ok(gameAuthRoleGroupService.listOfPage(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "授权分组添加")
|
|
|
+ @PostMapping(value = "/role/add")
|
|
|
+ @PreAuthorize(permissionKey = "manage:gameAuthGroupRole:add")
|
|
|
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
|
|
|
+ public ResultVO<Boolean> add(@Validated @RequestBody GameAuthRoleGroupAddParam param) {
|
|
|
+ return ResultVO.ok(gameAuthRoleGroupService.groupAddUser(param));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "授权分组删除")
|
|
|
+ @DeleteMapping(value = "/role/delete")
|
|
|
+ @PreAuthorize(permissionKey = "manage:gameAuthGroupRole:deleteById")
|
|
|
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = Boolean.class)})
|
|
|
+ public ResultVO<Boolean> delete(@RequestParam Long id) {
|
|
|
+ return ResultVO.ok(gameAuthRoleGroupService.deleteById(id));
|
|
|
+ }
|
|
|
+}
|