diff --git a/continew-admin-monitor/src/main/java/top/charles7c/cnadmin/monitor/interceptor/LogInterceptor.java b/continew-admin-monitor/src/main/java/top/charles7c/cnadmin/monitor/interceptor/LogInterceptor.java index 66125048b..8a76d962f 100644 --- a/continew-admin-monitor/src/main/java/top/charles7c/cnadmin/monitor/interceptor/LogInterceptor.java +++ b/continew-admin-monitor/src/main/java/top/charles7c/cnadmin/monitor/interceptor/LogInterceptor.java @@ -50,7 +50,7 @@ import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import top.charles7c.cnadmin.auth.model.request.LoginRequest; +import top.charles7c.cnadmin.auth.model.request.AccountLoginRequest; import top.charles7c.cnadmin.common.constant.StringConsts; import top.charles7c.cnadmin.common.constant.SysConsts; import top.charles7c.cnadmin.common.model.dto.LogContext; @@ -225,7 +225,7 @@ private void logRequest(LogDO logDO, HttpServletRequest request) { logDO.setCreateUser(null); } if (null == logDO.getCreateUser() && SysConsts.LOGIN_URI.equals(requestURI)) { - LoginRequest loginRequest = JSONUtil.toBean(requestBody, LoginRequest.class); + AccountLoginRequest loginRequest = JSONUtil.toBean(requestBody, AccountLoginRequest.class); logDO.setCreateUser( ExceptionUtils.exToNull(() -> userService.getByUsername(loginRequest.getUsername()).getId())); } diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/request/LoginRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/request/AccountLoginRequest.java similarity index 93% rename from continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/request/LoginRequest.java rename to continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/request/AccountLoginRequest.java index 291803484..c42581279 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/request/LoginRequest.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/auth/model/request/AccountLoginRequest.java @@ -25,14 +25,14 @@ import io.swagger.v3.oas.annotations.media.Schema; /** - * 登录信息 + * 账号登录信息 * * @author Charles7c * @since 2022/12/21 20:43 */ @Data -@Schema(description = "登录信息") -public class LoginRequest implements Serializable { +@Schema(description = "账号登录信息") +public class AccountLoginRequest implements Serializable { private static final long serialVersionUID = 1L; diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/ResetOptionValueRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/OptionResetValueRequest.java similarity index 90% rename from continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/ResetOptionValueRequest.java rename to continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/OptionResetValueRequest.java index 28e38a81f..29a0a057b 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/ResetOptionValueRequest.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/OptionResetValueRequest.java @@ -26,14 +26,14 @@ import io.swagger.v3.oas.annotations.media.Schema; /** - * 重置参数信息 + * 参数重置信息 * * @author Bull-BCLS * @since 2023/9/21 23:10 */ @Data -@Schema(description = "重置参数信息") -public class ResetOptionValueRequest implements Serializable { +@Schema(description = "参数重置信息") +public class OptionResetValueRequest implements Serializable { private static final long serialVersionUID = 1L; diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateBasicInfoRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserBasicInfoUpdateRequest.java similarity index 91% rename from continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateBasicInfoRequest.java rename to continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserBasicInfoUpdateRequest.java index 65ab8fb60..c39993a77 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateBasicInfoRequest.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserBasicInfoUpdateRequest.java @@ -30,14 +30,14 @@ import top.charles7c.cnadmin.common.enums.GenderEnum; /** - * 修改基础信息 + * 用户基础信息修改信息 * * @author Charles7c * @since 2023/1/7 23:08 */ @Data -@Schema(description = "修改基础信息") -public class UpdateBasicInfoRequest implements Serializable { +@Schema(description = "用户基础信息修改信息") +public class UserBasicInfoUpdateRequest implements Serializable { private static final long serialVersionUID = 1L; diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateEmailRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserEmailUpdateRequest.java similarity index 93% rename from continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateEmailRequest.java rename to continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserEmailUpdateRequest.java index 9335185f2..cf91ca42c 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateEmailRequest.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserEmailUpdateRequest.java @@ -30,14 +30,14 @@ import top.charles7c.cnadmin.common.constant.RegexConsts; /** - * 修改邮箱信息 + * 用户邮箱修改信息 * * @author Charles7c * @since 2023/1/12 20:18 */ @Data -@Schema(description = "修改邮箱信息") -public class UpdateEmailRequest implements Serializable { +@Schema(description = "用户邮箱修改信息") +public class UserEmailUpdateRequest implements Serializable { private static final long serialVersionUID = 1L; diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdatePasswordRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserPasswordUpdateRequest.java similarity index 91% rename from continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdatePasswordRequest.java rename to continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserPasswordUpdateRequest.java index 2729e5bd5..209dbae16 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdatePasswordRequest.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserPasswordUpdateRequest.java @@ -25,14 +25,14 @@ import io.swagger.v3.oas.annotations.media.Schema; /** - * 修改密码信息 + * 用户密码修改信息 * * @author Charles7c * @since 2023/1/9 23:28 */ @Data -@Schema(description = "修改密码信息") -public class UpdatePasswordRequest implements Serializable { +@Schema(description = "用户密码修改信息") +public class UserPasswordUpdateRequest implements Serializable { private static final long serialVersionUID = 1L; diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateUserRoleRequest.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserRoleUpdateRequest.java similarity index 89% rename from continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateUserRoleRequest.java rename to continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserRoleUpdateRequest.java index 9e0b5ebe0..775553684 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UpdateUserRoleRequest.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/model/request/UserRoleUpdateRequest.java @@ -26,14 +26,14 @@ import io.swagger.v3.oas.annotations.media.Schema; /** - * 修改用户角色信息 + * 用户角色修改信息 * * @author Charles7c * @since 2023/2/24 23:05 */ @Data -@Schema(description = "修改用户角色信息") -public class UpdateUserRoleRequest implements Serializable { +@Schema(description = "用户角色修改信息") +public class UserRoleUpdateRequest implements Serializable { private static final long serialVersionUID = 1L; diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/OptionService.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/OptionService.java index d83e00198..7c50cb468 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/OptionService.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/OptionService.java @@ -20,7 +20,7 @@ import top.charles7c.cnadmin.system.model.query.OptionQuery; import top.charles7c.cnadmin.system.model.request.OptionRequest; -import top.charles7c.cnadmin.system.model.request.ResetOptionValueRequest; +import top.charles7c.cnadmin.system.model.request.OptionResetValueRequest; import top.charles7c.cnadmin.system.model.vo.OptionVO; /** @@ -52,7 +52,7 @@ public interface OptionService { * 重置参数 * * @param request - * 重置参数信息 + * 重置信息 */ - void resetValue(ResetOptionValueRequest request); + void resetValue(OptionResetValueRequest request); } \ No newline at end of file diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserService.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserService.java index 14e8c15aa..93fc01fda 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserService.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/UserService.java @@ -23,9 +23,9 @@ import top.charles7c.cnadmin.common.base.BaseService; import top.charles7c.cnadmin.system.model.entity.UserDO; import top.charles7c.cnadmin.system.model.query.UserQuery; -import top.charles7c.cnadmin.system.model.request.UpdateBasicInfoRequest; -import top.charles7c.cnadmin.system.model.request.UpdateUserRoleRequest; +import top.charles7c.cnadmin.system.model.request.UserBasicInfoUpdateRequest; import top.charles7c.cnadmin.system.model.request.UserRequest; +import top.charles7c.cnadmin.system.model.request.UserRoleUpdateRequest; import top.charles7c.cnadmin.system.model.vo.UserDetailVO; import top.charles7c.cnadmin.system.model.vo.UserVO; @@ -60,12 +60,12 @@ public interface UserService extends BaseService request) { @Override @CacheEvict(allEntries = true) - public void resetValue(ResetOptionValueRequest request) { + public void resetValue(OptionResetValueRequest request) { baseMapper.lambdaUpdate().set(OptionDO::getValue, null).in(OptionDO::getCode, request.getCode()).update(); } } \ No newline at end of file diff --git a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java index 9cf0be17e..8181bb782 100644 --- a/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java +++ b/continew-admin-system/src/main/java/top/charles7c/cnadmin/system/service/impl/UserServiceImpl.java @@ -52,9 +52,9 @@ import top.charles7c.cnadmin.system.mapper.UserMapper; import top.charles7c.cnadmin.system.model.entity.UserDO; import top.charles7c.cnadmin.system.model.query.UserQuery; -import top.charles7c.cnadmin.system.model.request.UpdateBasicInfoRequest; -import top.charles7c.cnadmin.system.model.request.UpdateUserRoleRequest; +import top.charles7c.cnadmin.system.model.request.UserBasicInfoUpdateRequest; import top.charles7c.cnadmin.system.model.request.UserRequest; +import top.charles7c.cnadmin.system.model.request.UserRoleUpdateRequest; import top.charles7c.cnadmin.system.model.vo.UserDetailVO; import top.charles7c.cnadmin.system.model.vo.UserVO; import top.charles7c.cnadmin.system.service.DeptService; @@ -189,10 +189,10 @@ public String uploadAvatar(MultipartFile avatarFile, Long id) { @Override @Transactional(rollbackFor = Exception.class) - public void updateBasicInfo(UpdateBasicInfoRequest request, Long id) { + public void updateBasicInfo(UserBasicInfoUpdateRequest updateRequest, Long id) { super.getById(id); - baseMapper.lambdaUpdate().set(UserDO::getNickname, request.getNickname()) - .set(UserDO::getGender, request.getGender()).eq(UserDO::getId, id).update(); + baseMapper.lambdaUpdate().set(UserDO::getNickname, updateRequest.getNickname()) + .set(UserDO::getGender, updateRequest.getGender()).eq(UserDO::getId, id).update(); } @Override @@ -233,10 +233,10 @@ public void resetPassword(Long id) { @Override @Transactional(rollbackFor = Exception.class) - public void updateRole(UpdateUserRoleRequest request, Long id) { + public void updateRole(UserRoleUpdateRequest updateRequest, Long id) { super.getById(id); // 保存用户和角色关联 - userRoleService.save(request.getRoleIds(), id); + userRoleService.save(updateRequest.getRoleIds(), id); } @Override diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/AuthController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/AuthController.java index 2fc3954e9..03c735a10 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/AuthController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/AuthController.java @@ -32,8 +32,8 @@ import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.bean.BeanUtil; +import top.charles7c.cnadmin.auth.model.request.AccountLoginRequest; import top.charles7c.cnadmin.auth.model.request.EmailLoginRequest; -import top.charles7c.cnadmin.auth.model.request.LoginRequest; import top.charles7c.cnadmin.auth.model.vo.LoginVO; import top.charles7c.cnadmin.auth.model.vo.RouteVO; import top.charles7c.cnadmin.auth.model.vo.UserInfoVO; @@ -68,7 +68,7 @@ public class AuthController { @SaIgnore @Operation(summary = "账号登录", description = "根据账号和密码进行登录认证") @PostMapping("/account") - public LoginVO accountLogin(@Validated @RequestBody LoginRequest loginRequest) { + public LoginVO accountLogin(@Validated @RequestBody AccountLoginRequest loginRequest) { String captchaKey = RedisUtils.formatKey(CacheConsts.CAPTCHA_KEY_PREFIX, loginRequest.getUuid()); String captcha = RedisUtils.getCacheObject(captchaKey); ValidationUtils.throwIfBlank(captcha, "验证码已失效"); diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/OptionController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/OptionController.java index b6c95a589..928bba75f 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/OptionController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/OptionController.java @@ -30,7 +30,7 @@ import top.charles7c.cnadmin.system.model.query.OptionQuery; import top.charles7c.cnadmin.system.model.request.OptionRequest; -import top.charles7c.cnadmin.system.model.request.ResetOptionValueRequest; +import top.charles7c.cnadmin.system.model.request.OptionResetValueRequest; import top.charles7c.cnadmin.system.model.vo.OptionVO; import top.charles7c.cnadmin.system.service.OptionService; @@ -65,7 +65,7 @@ public void update(@Validated @RequestBody List request) { @Operation(summary = "重置参数", description = "重置参数") @SaCheckPermission("system:config:reset") @PatchMapping("/value") - public void resetValue(@Validated @RequestBody ResetOptionValueRequest request) { + public void resetValue(@Validated @RequestBody OptionResetValueRequest request) { optionService.resetValue(request); } } \ No newline at end of file diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java index a64d48c31..fafc3c781 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserCenterController.java @@ -46,9 +46,9 @@ import top.charles7c.cnadmin.common.util.helper.LoginHelper; import top.charles7c.cnadmin.common.util.validate.ValidationUtils; import top.charles7c.cnadmin.system.model.entity.UserSocialDO; -import top.charles7c.cnadmin.system.model.request.UpdateBasicInfoRequest; -import top.charles7c.cnadmin.system.model.request.UpdateEmailRequest; -import top.charles7c.cnadmin.system.model.request.UpdatePasswordRequest; +import top.charles7c.cnadmin.system.model.request.UserBasicInfoUpdateRequest; +import top.charles7c.cnadmin.system.model.request.UserEmailUpdateRequest; +import top.charles7c.cnadmin.system.model.request.UserPasswordUpdateRequest; import top.charles7c.cnadmin.system.model.vo.AvatarVO; import top.charles7c.cnadmin.system.model.vo.UserSocialBindVO; import top.charles7c.cnadmin.system.service.UserService; @@ -86,19 +86,19 @@ public R uploadAvatar(@NotNull(message = "头像不能为空") Multipa @Operation(summary = "修改基础信息", description = "修改用户基础信息") @PatchMapping("/basic/info") - public R updateBasicInfo(@Validated @RequestBody UpdateBasicInfoRequest updateBasicInfoRequest) { - userService.updateBasicInfo(updateBasicInfoRequest, LoginHelper.getUserId()); + public R updateBasicInfo(@Validated @RequestBody UserBasicInfoUpdateRequest updateRequest) { + userService.updateBasicInfo(updateRequest, LoginHelper.getUserId()); return R.ok("修改成功"); } @Operation(summary = "修改密码", description = "修改用户登录密码") @PatchMapping("/password") - public R updatePassword(@Validated @RequestBody UpdatePasswordRequest updatePasswordRequest) { + public R updatePassword(@Validated @RequestBody UserPasswordUpdateRequest updateRequest) { String rawOldPassword = - ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(updatePasswordRequest.getOldPassword())); + ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(updateRequest.getOldPassword())); ValidationUtils.throwIfNull(rawOldPassword, "当前密码解密失败"); String rawNewPassword = - ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(updatePasswordRequest.getNewPassword())); + ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(updateRequest.getNewPassword())); ValidationUtils.throwIfNull(rawNewPassword, "新密码解密失败"); ValidationUtils.throwIf(!ReUtil.isMatch(RegexConsts.PASSWORD, rawNewPassword), "密码长度为 6 到 32 位,可以包含字母、数字、下划线,特殊字符,同时包含字母和数字"); @@ -108,16 +108,16 @@ public R updatePassword(@Validated @RequestBody UpdatePasswordRequest updatePass @Operation(summary = "修改邮箱", description = "修改用户邮箱") @PatchMapping("/email") - public R updateEmail(@Validated @RequestBody UpdateEmailRequest updateEmailRequest) { + public R updateEmail(@Validated @RequestBody UserEmailUpdateRequest updateRequest) { String rawCurrentPassword = - ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(updateEmailRequest.getCurrentPassword())); + ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(updateRequest.getCurrentPassword())); ValidationUtils.throwIfBlank(rawCurrentPassword, "当前密码解密失败"); - String captchaKey = RedisUtils.formatKey(CacheConsts.CAPTCHA_KEY_PREFIX, updateEmailRequest.getNewEmail()); + String captchaKey = RedisUtils.formatKey(CacheConsts.CAPTCHA_KEY_PREFIX, updateRequest.getNewEmail()); String captcha = RedisUtils.getCacheObject(captchaKey); ValidationUtils.throwIfBlank(captcha, "验证码已失效"); - ValidationUtils.throwIfNotEqualIgnoreCase(updateEmailRequest.getCaptcha(), captcha, "验证码错误"); + ValidationUtils.throwIfNotEqualIgnoreCase(updateRequest.getCaptcha(), captcha, "验证码错误"); RedisUtils.deleteCacheObject(captchaKey); - userService.updateEmail(updateEmailRequest.getNewEmail(), rawCurrentPassword, LoginHelper.getUserId()); + userService.updateEmail(updateRequest.getNewEmail(), rawCurrentPassword, LoginHelper.getUserId()); return R.ok("修改成功"); } diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserController.java index f57dbcb07..2f02ec747 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/system/UserController.java @@ -35,8 +35,8 @@ import top.charles7c.cnadmin.common.constant.SysConsts; import top.charles7c.cnadmin.common.model.vo.R; import top.charles7c.cnadmin.system.model.query.UserQuery; -import top.charles7c.cnadmin.system.model.request.UpdateUserRoleRequest; import top.charles7c.cnadmin.system.model.request.UserRequest; +import top.charles7c.cnadmin.system.model.request.UserRoleUpdateRequest; import top.charles7c.cnadmin.system.model.vo.UserDetailVO; import top.charles7c.cnadmin.system.model.vo.UserVO; import top.charles7c.cnadmin.system.service.UserService; @@ -73,8 +73,8 @@ public R resetPassword(@PathVariable Long id) { @Parameter(name = "id", description = "ID", example = "1", in = ParameterIn.PATH) @SaCheckPermission("system:user:role:update") @PatchMapping("/{id}/role") - public R updateRole(@Validated @RequestBody UpdateUserRoleRequest request, @PathVariable Long id) { - baseService.updateRole(request, id); + public R updateRole(@Validated @RequestBody UserRoleUpdateRequest updateRequest, @PathVariable Long id) { + baseService.updateRole(updateRequest, id); return R.ok("分配成功"); } }