From 5b7a1193022e4e2a55c5feb1021a4e068dc3079d Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Fri, 7 Jul 2023 15:08:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.0=E3=80=91=E3=80=90=E6=9D=83?= =?UTF-8?q?=E9=99=90=E3=80=91=E6=9B=B4=E6=96=B0=E8=81=8C=E4=BD=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/PermissionCodeConstants.java | 28 +++++++++++++++---- .../controller/HrPositionController.java | 13 ++++++--- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/kernel-s-sys/sys-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/constants/PermissionCodeConstants.java b/kernel-s-sys/sys-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/constants/PermissionCodeConstants.java index 36bd20aaa..35d17203c 100644 --- a/kernel-s-sys/sys-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/constants/PermissionCodeConstants.java +++ b/kernel-s-sys/sys-api/src/main/java/cn/stylefeng/roses/kernel/sys/api/constants/PermissionCodeConstants.java @@ -14,33 +14,49 @@ public interface PermissionCodeConstants { String COMPANY_STAT_INFO = "COMPANY_STAT_INFO"; /** - * 人员_新增人员 + * 人员管理界面-新增人员 */ String ADD_USER = "ADD_USER"; /** - * 人员_修改人员 + * 人员管理界面-修改人员 */ String EDIT_USER = "EDIT_USER"; /** - * 人员_删除人员 + * 人员管理界面-删除人员 */ String DELETE_USER = "DELETE_USER"; /** - * 人员_分配角色 + * 人员管理界面-分配角色 */ String ASSIGN_USER_ROLE = "ASSIGN_USER_ROLE"; /** - * 人员_重置密码 + * 人员管理界面-重置密码 */ String RESET_PASSWORD = "RESET_PASSWORD"; /** - * 人员_修改状态 + * 人员管理界面-修改状态 */ String UPDATE_USER_STATUS = "UPDATE_USER_STATUS"; + /** + * 职位管理界面-新增职位 + */ + String ADD_POSITION = "ADD_POSITION"; + + /** + * 职位管理界面-修改职位 + */ + String EDIT_POSITION = "EDIT_POSITION"; + + /** + * 职位管理界面-删除职位 + */ + String DELETE_POSITION = "DELETE_POSITION"; + + } diff --git a/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/position/controller/HrPositionController.java b/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/position/controller/HrPositionController.java index bcd96cf87..a37b4bab3 100644 --- a/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/position/controller/HrPositionController.java +++ b/kernel-s-sys/sys-business-hr/src/main/java/cn/stylefeng/roses/kernel/sys/modular/position/controller/HrPositionController.java @@ -7,6 +7,7 @@ import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData; import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource; import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource; import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource; +import cn.stylefeng.roses.kernel.sys.api.constants.PermissionCodeConstants; import cn.stylefeng.roses.kernel.sys.modular.position.entity.HrPosition; import cn.stylefeng.roses.kernel.sys.modular.position.pojo.request.HrPositionRequest; import cn.stylefeng.roses.kernel.sys.modular.position.service.HrPositionService; @@ -35,7 +36,8 @@ public class HrPositionController { * @author fengshuonan * @date 2023/06/10 21:25 */ - @PostResource(name = "添加职位", path = "/hrPosition/add") + @PostResource(name = "添加职位", path = "/hrPosition/add", requiredPermission = true, + requirePermissionCode = PermissionCodeConstants.ADD_POSITION) public ResponseData add(@RequestBody @Validated(HrPositionRequest.add.class) HrPositionRequest hrPositionRequest) { hrPositionService.add(hrPositionRequest); return new SuccessResponseData<>(); @@ -47,7 +49,8 @@ public class HrPositionController { * @author fengshuonan * @date 2023/06/10 21:25 */ - @PostResource(name = "删除职位", path = "/hrPosition/delete") + @PostResource(name = "删除职位", path = "/hrPosition/delete", requiredPermission = true, + requirePermissionCode = PermissionCodeConstants.DELETE_POSITION) public ResponseData delete(@RequestBody @Validated(HrPositionRequest.delete.class) HrPositionRequest hrPositionRequest) { hrPositionService.del(hrPositionRequest); return new SuccessResponseData<>(); @@ -59,7 +62,8 @@ public class HrPositionController { * @author fengshuonan * @date 2023/06/10 21:25 */ - @PostResource(name = "批量删除职位", path = "/hrPosition/batchDelete") + @PostResource(name = "批量删除职位", path = "/hrPosition/batchDelete", requiredPermission = true, + requirePermissionCode = PermissionCodeConstants.DELETE_POSITION) public ResponseData batchDelete(@RequestBody @Validated(BaseRequest.batchDelete.class) HrPositionRequest hrPositionRequest) { hrPositionService.batchDelete(hrPositionRequest); return new SuccessResponseData<>(); @@ -71,7 +75,8 @@ public class HrPositionController { * @author fengshuonan * @date 2023/06/10 21:25 */ - @PostResource(name = "编辑职位", path = "/hrPosition/edit") + @PostResource(name = "编辑职位", path = "/hrPosition/edit", requiredPermission = true, + requirePermissionCode = PermissionCodeConstants.EDIT_POSITION) public ResponseData edit(@RequestBody @Validated(HrPositionRequest.edit.class) HrPositionRequest hrPositionRequest) { hrPositionService.edit(hrPositionRequest); return new SuccessResponseData<>();