From 5e89d14d364f2403ae2d64ab1a70d004ae36eb6c Mon Sep 17 00:00:00 2001
From: liuxm <liuxm@fescotech.com>
Date: 星期一, 29 四月 2024 16:35:17 +0800
Subject: [PATCH] 角色管理方法修改
---
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java | 38 +++++++++++++++++++++++++++-----------
1 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java
index 0b31b90..db987f5 100644
--- a/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java
+++ b/pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/role/RoleCtrl.java
@@ -5,7 +5,7 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
-import com.dy.pmsGlobal.aop.OperationDescription;
+import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoBa.BaRole;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
@@ -37,7 +37,7 @@
*/
@PostMapping(path="save")
@SsoPowerAop(power = "10100011")
- @OperationDescription("淇濆瓨瑙掕壊淇℃伅")
+ @Log("淇濆瓨瑙掕壊淇℃伅")
public BaseResponse<BaRole> save(@RequestBody @Valid BaRole role,BindingResult bindingResult){
try {
role.setDeleted(false);
@@ -58,7 +58,7 @@
*/
@PostMapping(path="update")
@SsoPowerAop(power = "10100011")
- @OperationDescription("鏇存柊瑙掕壊淇℃伅")
+ @Log("鏇存柊瑙掕壊淇℃伅")
public BaseResponse<BaRole> update(@RequestBody @Valid BaRole role,BindingResult bindingResult){
try {
return BaseResponseUtils.buildSuccess(roleSv.update(role));
@@ -71,17 +71,33 @@
/**
* 鍒犻櫎瑙掕壊淇℃伅
* @param id
- * @param bindingResult
* @return
*/
- @PostMapping(path="delete")
+ @GetMapping(path="delete")
@SsoPowerAop(power = "10100011")
- @OperationDescription("鍒犻櫎瑙掕壊淇℃伅")
- public BaseResponse<BaRole> delete(String id,BindingResult bindingResult){
+ @Log("鍒犻櫎瑙掕壊淇℃伅")
+ public BaseResponse<BaRole> delete(String id){
try {
return BaseResponseUtils.buildSuccess(roleSv.delete(Long.parseLong(id)));
}catch (Exception e){
log.error("鍒犻櫎瑙掕壊寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage());
+ }
+ }
+
+ /**
+ * 绂佺敤瑙掕壊淇℃伅
+ * @param role
+ * @return
+ */
+ @PostMapping(path="disabled")
+ @SsoPowerAop(power = "10100011")
+ @Log("绂佺敤鎴栧惎鐢ㄨ鑹蹭俊鎭�")
+ public BaseResponse<BaRole> disabled(@RequestBody BaRole role){
+ try {
+ return BaseResponseUtils.buildSuccess(roleSv.disabled(role.id,role.disabled));
+ }catch (Exception e){
+ log.error("绂佺敤瑙掕壊寮傚父", e);
return BaseResponseUtils.buildException(e.getMessage());
}
}
@@ -93,7 +109,7 @@
*/
@GetMapping(path="one")
@SsoPowerAop(power = "10100010") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇�
- @OperationDescription("鏍规嵁ID鏌ヨ瑙掕壊淇℃伅")
+ @Log("鏍规嵁ID鏌ヨ瑙掕壊淇℃伅")
public BaseResponse<BaRole> one(String id){
try{
BaRole role=roleSv.selectById(id);
@@ -105,19 +121,19 @@
}
/**
- * 鍒嗛〉鏌ヨ瑙掕壊淇℃伅
+ * 鏌ヨ瑙掕壊淇℃伅
* @param vo
* @return
*/
@PostMapping(path="some")
@SsoPowerAop(power = "10100010")
- @OperationDescription("鍒嗛〉鏌ヨ瑙掕壊淇℃伅")
+ @Log("鏌ヨ瑙掕壊淇℃伅")
public BaseResponse<QueryResultVo<List<BaRole>>> some(@RequestBody QueryVo vo){
try {
QueryResultVo<List<BaRole>> list = roleSv.selectSome(vo) ;
return BaseResponseUtils.buildSuccess(list);
}catch (Exception e){
- log.error("鍒嗛〉鏌ヨ瑙掕壊寮傚父", e);
+ log.error("鏌ヨ瑙掕壊寮傚父", e);
return BaseResponseUtils.buildException(e.getMessage());
}
}
--
Gitblit v1.8.0