From 6531c14f567ef4f85967029986bd352550cc198b Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 16 十一月 2023 11:01:19 +0800
Subject: [PATCH] 1、行政区保存功能,级别改为非必填项,也不验证
---
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
index 2e31985..6eb252b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/user/UserCtrl.java
@@ -23,10 +23,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@@ -58,9 +55,11 @@
schema = @Schema(implementation = BaUser.class))}
)
})
- @PostMapping(path = "some")
+ @PostMapping(path = "some", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@SsoAop("-1")
- public BaseResponse<QueryResultVo<List<BaUser>>> some(QueryVo vo){
+ //濡傛灉鍓嶇璇锋眰鏁版嵁鏄痡son锛屽垯瑕佸姞涓婃敞瑙RequestBody
+ //public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody @Parameter(description = "鏌ヨform琛ㄥ崟鏁版嵁", required = true) @Valid QueryVo vo){
+ public BaseResponse<QueryResultVo<List<BaUser>>> some(@Parameter(description = "鏌ヨform琛ㄥ崟鏁版嵁", required = true) @Valid QueryVo vo){
try {
QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo) ;
return BaseResponseUtils.buildSuccess(res);
@@ -85,8 +84,8 @@
})
@GetMapping(path = "one")
@SsoAop("-1")
- public BaseResponse<BaUser> one(@Parameter(description = "瀹炰綋id", required = true) Long id){
- return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
+ public BaseResponse<BaUser> one(@Parameter(description = "瀹炰綋id", required = true) String id){
+ return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id)));
}
/**
@@ -190,7 +189,7 @@
})
@GetMapping(path = "changePassword", consumes = MediaType.TEXT_PLAIN_VALUE)
@SsoAop("-1")//@SsoAop(power = "-1")
- public BaseResponse<Boolean> changePassword(@Parameter(description = "瀹炰綋id", required = true) Long id,
+ public BaseResponse<Boolean> changePassword(@Parameter(description = "瀹炰綋id", required = true) String id,
@Parameter(description = "鏃у瘑鐮�", required = true) String oldPassword,
@Parameter(description = "鏂板瘑鐮�", required = true) String newPassword) throws Exception{
if(id == null){
@@ -210,16 +209,17 @@
oldPassword = MD5.encrypt(oldPassword) ;//杩涜鍔犲瘑鐮�
newPassword = MD5.encrypt(newPassword) ;//杩涜鍔犲瘑鐮�
+ Long idLg = Long.parseLong(id) ;
int count ;
try {
- BaUser po = this.sv.selectById(id);
+ BaUser po = this.sv.selectById(idLg);
if(Objects.isNull(po)){
return BaseResponseUtils.buildFail("鏈緱鍒扮敤鎴凤紝璇锋眰澶辫触") ;
}else{
if(!po.password.equalsIgnoreCase(oldPassword)){
return BaseResponseUtils.buildFail("鏃у瘑鐮佷笉姝g‘锛岃姹傚け璐�") ;
}else{
- count = this.sv.changePassword(id, newPassword) ;
+ count = this.sv.changePassword(idLg, newPassword) ;
}
}
} catch (Exception e) {
@@ -251,7 +251,7 @@
@GetMapping(path = "setRoles", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@SsoAop("-1")//@SsoAop(power = "-1")
public BaseResponse<Boolean> setRoles(@Parameter(description = "瀹炰綋id", required = true) String id,
- @Parameter(description = "瑙掕壊id鏁扮粍闆嗗悎") String[] roleIds){
+ @Parameter(description = "瑙掕壊id鏁扮粍") String[] roleIds){
Long[] roleId_lg = null ;
if(roleIds != null && roleIds.length > 0){
roleId_lg = new Long[roleIds.length] ;
@@ -286,13 +286,13 @@
})
@GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
@SsoAop("-1")//@SsoAop(power = "-1")
- public BaseResponse<Boolean> delete(@Parameter(description = "瀹炰綋id", required = true) Long id){
+ public BaseResponse<Boolean> delete(@Parameter(description = "瀹炰綋id", required = true) String id){
if(id == null){
return BaseResponseUtils.buildFail("id涓嶈兘涓虹┖") ;
}
int count;
try {
- count = this.sv.delete(id);
+ count = this.sv.delete(Long.parseLong(id));
} catch (Exception e) {
log.error("淇濆瓨鐢ㄦ埛寮傚父", e);
return BaseResponseUtils.buildException(e.getMessage()) ;
--
Gitblit v1.8.0