|
@@ -1,95 +1,95 @@
|
|
|
-package com.qmth.teachcloud.common.api.api;
|
|
|
-
|
|
|
-import com.qmth.boot.api.constant.ApiConstant;
|
|
|
-import com.qmth.teachcloud.common.bean.dto.PrivilegeDto;
|
|
|
-import com.qmth.teachcloud.common.entity.SysPrivilege;
|
|
|
-import com.qmth.teachcloud.common.service.SysPrivilegeService;
|
|
|
-import com.qmth.teachcloud.common.util.Result;
|
|
|
-import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * <p>
|
|
|
- * 菜单权限表 前端控制器
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @author xf
|
|
|
- * @since 2021-03-23
|
|
|
- */
|
|
|
-@Api(tags = "菜单权限Controller")
|
|
|
-@RestController
|
|
|
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.sys}/privilege")
|
|
|
-public class SysPrivilegeController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SysPrivilegeService sysPrivilegeService;
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "查询")
|
|
|
- @RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
|
- public Result list() {
|
|
|
- List<PrivilegeDto> privilegeDtoList = sysPrivilegeService.listPrivilegeTree();
|
|
|
- return ResultUtil.ok(privilegeDtoList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询需要授权的菜单
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "查询需要授权的菜单")
|
|
|
- @RequestMapping(value = "/list_auth", method = RequestMethod.POST)
|
|
|
- public Result listAuth() {
|
|
|
- List<PrivilegeDto> privilegeDtoList = sysPrivilegeService.listPrivilegeTreeAuth();
|
|
|
- return ResultUtil.ok(privilegeDtoList);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增/修改
|
|
|
- *
|
|
|
- * @param privilege
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "新增/修改")
|
|
|
- @RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
- public Result save( @RequestBody SysPrivilege privilege) {
|
|
|
- String id = sysPrivilegeService.savePrivilege(privilege);
|
|
|
- return ResultUtil.ok(id,"");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除
|
|
|
- *
|
|
|
- * @param privilege
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "删除")
|
|
|
- @RequestMapping(value = "/remove", method = RequestMethod.POST)
|
|
|
- public Result remove(@RequestBody SysPrivilege privilege) {
|
|
|
- boolean isSuccess = sysPrivilegeService.remove(privilege.getId());
|
|
|
- return ResultUtil.ok(isSuccess);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 角色已绑定权限列表
|
|
|
- *
|
|
|
- * @param roleId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "角色已绑定权限列表")
|
|
|
- @RequestMapping(value = "/get_role_privileges", method = RequestMethod.POST)
|
|
|
- public Result getRolePrivileges(@RequestParam(value = "roleId", required = true) Long roleId) {
|
|
|
- List<String> list = sysPrivilegeService.getRolePrivileges(roleId);
|
|
|
- return ResultUtil.ok(list);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+//package com.qmth.teachcloud.common.api.api;
|
|
|
+//
|
|
|
+//import com.qmth.boot.api.constant.ApiConstant;
|
|
|
+//import com.qmth.teachcloud.common.bean.dto.PrivilegeDto;
|
|
|
+//import com.qmth.teachcloud.common.entity.SysPrivilege;
|
|
|
+//import com.qmth.teachcloud.common.service.SysPrivilegeService;
|
|
|
+//import com.qmth.teachcloud.common.util.Result;
|
|
|
+//import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
+//import io.swagger.annotations.Api;
|
|
|
+//import io.swagger.annotations.ApiOperation;
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.web.bind.annotation.*;
|
|
|
+//
|
|
|
+//import java.util.List;
|
|
|
+//
|
|
|
+///**
|
|
|
+// * <p>
|
|
|
+// * 菜单权限表 前端控制器
|
|
|
+// * </p>
|
|
|
+// *
|
|
|
+// * @author xf
|
|
|
+// * @since 2021-03-23
|
|
|
+// */
|
|
|
+//@Api(tags = "菜单权限Controller")
|
|
|
+//@RestController
|
|
|
+//@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.sys}/privilege")
|
|
|
+//public class SysPrivilegeController {
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private SysPrivilegeService sysPrivilegeService;
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 查询
|
|
|
+// *
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "查询")
|
|
|
+// @RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
|
+// public Result list() {
|
|
|
+// List<PrivilegeDto> privilegeDtoList = sysPrivilegeService.listPrivilegeTree();
|
|
|
+// return ResultUtil.ok(privilegeDtoList);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 查询需要授权的菜单
|
|
|
+// *
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "查询需要授权的菜单")
|
|
|
+// @RequestMapping(value = "/list_auth", method = RequestMethod.POST)
|
|
|
+// public Result listAuth() {
|
|
|
+// List<PrivilegeDto> privilegeDtoList = sysPrivilegeService.listPrivilegeTreeAuth();
|
|
|
+// return ResultUtil.ok(privilegeDtoList);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 新增/修改
|
|
|
+// *
|
|
|
+// * @param privilege
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "新增/修改")
|
|
|
+// @RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
+// public Result save( @RequestBody SysPrivilege privilege) {
|
|
|
+// String id = sysPrivilegeService.savePrivilege(privilege);
|
|
|
+// return ResultUtil.ok(id,"");
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 删除
|
|
|
+// *
|
|
|
+// * @param privilege
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "删除")
|
|
|
+// @RequestMapping(value = "/remove", method = RequestMethod.POST)
|
|
|
+// public Result remove(@RequestBody SysPrivilege privilege) {
|
|
|
+// boolean isSuccess = sysPrivilegeService.remove(privilege.getId());
|
|
|
+// return ResultUtil.ok(isSuccess);
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 角色已绑定权限列表
|
|
|
+// *
|
|
|
+// * @param roleId
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "角色已绑定权限列表")
|
|
|
+// @RequestMapping(value = "/get_role_privileges", method = RequestMethod.POST)
|
|
|
+// public Result getRolePrivileges(@RequestParam(value = "roleId", required = true) Long roleId) {
|
|
|
+// List<String> list = sysPrivilegeService.getRolePrivileges(roleId);
|
|
|
+// return ResultUtil.ok(list);
|
|
|
+// }
|
|
|
+//}
|
|
|
+//
|