liurunyu
2024-04-24 e430bfca38cdae9dd230f951e108a75caebccb61
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserCtrl.java
@@ -6,6 +6,7 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.util.Constant;
import com.mysql.cj.util.StringUtils;
@@ -44,6 +45,7 @@
     * @return 默认密码
     */
    @GetMapping(path = "defaultPassword")
    @Log("客户端请求得到默认密码")
    public BaseResponse<String> defaultPassword(){
        if(defaultTrueRandomFalsePassword){
            return BaseResponseUtils.buildSuccess(defaultPassword) ;
@@ -60,6 +62,7 @@
    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
    //@SsoAop() //只有登录验证,没有权限验证
    @SsoPowerAop(power = "10100010") //登录与权限同时验证
    @Log("分页查询用户")
    public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody QueryVo vo) {
        try {
            QueryResultVo<List<BaUser>> res = this.sv.selectSome(vo);
@@ -78,6 +81,7 @@
    @GetMapping(path = "one")
    //@SsoAop() //只有登录验证,没有权限验证
    @SsoPowerAop(power = "10100010") //登录与权限同时验证
    @Log("查询单个用户")
    public BaseResponse<BaUser> one(String id) {
        try {
            return BaseResponseUtils.buildSuccess(this.sv.selectById(Long.parseLong(id)));
@@ -96,6 +100,7 @@
    @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE)
    //@SsoAop() //只有登录验证,没有权限验证
    @SsoPowerAop(power = "10100011") //登录与权限同时验证
    @Log("保存用户信息")
    public BaseResponse<Boolean> save(@RequestBody @Valid BaUser po, BindingResult bindingResult) {
        if (bindingResult != null && bindingResult.hasErrors()) {
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
@@ -136,6 +141,7 @@
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    //@SsoAop() //只有登录验证,没有权限验证
    @SsoPowerAop(power = "10100011") //登录与权限同时验证
    @Log("更新用户信息")
    public BaseResponse<Boolean> update(@RequestBody @Validated BaUser po, BindingResult bindingResult) {
        int count;
        try {
@@ -168,6 +174,7 @@
    //@GetMapping(path = "changePassword", consumes = MediaType.TEXT_PLAIN_VALUE)
    @GetMapping(path = "changePassword")
    @SsoAop()
    @Log("修改密码")
    public BaseResponse<Boolean> changePassword(String id, String oldPassword, String newPassword) {
        int count;
        try {
@@ -220,6 +227,7 @@
    @PostMapping(path = "resetPassword", consumes = MediaType.APPLICATION_JSON_VALUE)
    //@SsoAop() //只有登录验证,没有权限验证
    @SsoPowerAop(power = "10100011") //登录与权限同时验证
    @Log("重置密码")
    public BaseResponse<Boolean> resetPassword(@RequestBody @Validated ResetPasswordVo vo, BindingResult bindingResult) {
        int count;
        try {