refactor: 修改部分实体类
This commit is contained in:
parent
95d92d8c21
commit
f748a66db3
|
@ -12,6 +12,9 @@ import org.springframework.web.bind.annotation.InitBinder;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 去除前端传递的空格
|
||||
*/
|
||||
@ControllerAdvice
|
||||
public class ControllerStringParamTrimConfig {
|
||||
|
||||
|
|
|
@ -10,24 +10,29 @@ import lombok.extern.slf4j.Slf4j;
|
|||
@Getter
|
||||
@ToString
|
||||
@Slf4j
|
||||
public class BunnyException extends RuntimeException {
|
||||
Integer code;// 状态码
|
||||
String message;// 描述信息
|
||||
public class AuthCustomerException extends RuntimeException {
|
||||
// 状态码
|
||||
Integer code;
|
||||
|
||||
// 描述信息
|
||||
String message;
|
||||
|
||||
// 返回结果状态
|
||||
ResultCodeEnum resultCodeEnum;
|
||||
|
||||
|
||||
public BunnyException(Integer code, String message) {
|
||||
public AuthCustomerException(Integer code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BunnyException(String message) {
|
||||
public AuthCustomerException(String message) {
|
||||
super(message);
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public BunnyException(ResultCodeEnum codeEnum) {
|
||||
public AuthCustomerException(ResultCodeEnum codeEnum) {
|
||||
super(codeEnum.getMessage());
|
||||
this.code = codeEnum.getCode();
|
||||
this.message = codeEnum.getMessage();
|
|
@ -17,13 +17,16 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 全局异常拦截器
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
@Slf4j
|
||||
public class GlobalExceptionHandler {
|
||||
// 自定义异常信息
|
||||
@ExceptionHandler(BunnyException.class)
|
||||
@ExceptionHandler(AuthCustomerException.class)
|
||||
@ResponseBody
|
||||
public Result<Object> exceptionHandler(BunnyException exception) {
|
||||
public Result<Object> exceptionHandler(AuthCustomerException exception) {
|
||||
Integer code = exception.getCode() != null ? exception.getCode() : 500;
|
||||
return Result.error(null, code, exception.getMessage());
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.common.service.utils;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import io.jsonwebtoken.*;
|
||||
import io.micrometer.common.lang.Nullable;
|
||||
|
@ -210,14 +210,14 @@ public class JwtHelper {
|
|||
*/
|
||||
public static Map<String, Object> getMapByToken(String token) {
|
||||
try {
|
||||
if (!StringUtils.hasText(token)) throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
if (!StringUtils.hasText(token)) throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
Claims claims = Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token).getBody();
|
||||
|
||||
// 将 body 值转为map
|
||||
return new HashMap<>(claims);
|
||||
|
||||
} catch (Exception exception) {
|
||||
throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,14 +230,14 @@ public class JwtHelper {
|
|||
*/
|
||||
public static Map<String, Object> getMapByToken(String token, String signKey) {
|
||||
try {
|
||||
if (!StringUtils.hasText(token)) throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
if (!StringUtils.hasText(token)) throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
Jws<Claims> claimsJws = Jwts.parser().setSigningKey(signKey).parseClaimsJws(token);
|
||||
Claims body = claimsJws.getBody();
|
||||
// 将 body 值转为map
|
||||
return new HashMap<>(body);
|
||||
|
||||
} catch (Exception exception) {
|
||||
throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,14 +254,14 @@ public class JwtHelper {
|
|||
@Nullable
|
||||
private static String getSubjectByTokenHandler(String token, String tokenSignKey) {
|
||||
try {
|
||||
if (!StringUtils.hasText(token)) throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
if (!StringUtils.hasText(token)) throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
Jws<Claims> claimsJws = Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token);
|
||||
Claims body = claimsJws.getBody();
|
||||
|
||||
return body.getSubject();
|
||||
|
||||
} catch (Exception exception) {
|
||||
throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -283,14 +283,14 @@ public class JwtHelper {
|
|||
*/
|
||||
public static Long getUserId(String token) {
|
||||
try {
|
||||
if (!StringUtils.hasText(token)) throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
if (!StringUtils.hasText(token)) throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
|
||||
Jws<Claims> claimsJws = Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token);
|
||||
Claims claims = claimsJws.getBody();
|
||||
|
||||
return Long.valueOf(String.valueOf(claims.get("userId")));
|
||||
} catch (Exception exception) {
|
||||
throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ public class JwtHelper {
|
|||
Claims claims = claimsJws.getBody();
|
||||
return (String) claims.get("username");
|
||||
} catch (Exception exception) {
|
||||
throw new BunnyException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
throw new AuthCustomerException(ResultCodeEnum.TOKEN_PARSING_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
package cn.bunny.common.service.utils;
|
||||
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
public class ResponseHandlerUtil {
|
||||
public static boolean loginAuthHandler(HttpServletResponse response, ResultCodeEnum loginAuth) {
|
||||
ResponseUtil.out(response, Result.error(loginAuth));
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -13,9 +13,11 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@ApiModel(value = "IpEntity对象", description = "用户IP相关信息")
|
||||
public class IpEntity {
|
||||
|
||||
@ApiModelProperty("原始地址")
|
||||
private String ipAddr;
|
||||
|
||||
@ApiModelProperty("IP归属地")
|
||||
private String ipRegion;
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.regex.Pattern;
|
|||
|
||||
@Slf4j
|
||||
public class IpUtil {
|
||||
|
||||
private static Searcher searcher;
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,9 +14,14 @@ import org.springframework.context.annotation.Configuration;
|
|||
@Data
|
||||
@Slf4j
|
||||
public class MinioProperties {
|
||||
|
||||
// 地址
|
||||
private String endpointUrl;
|
||||
// 访问秘钥
|
||||
private String accessKey;
|
||||
// 私有秘钥
|
||||
private String secretKey;
|
||||
// 桶名称
|
||||
private String bucketName;
|
||||
|
||||
@Bean
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.common.service.utils.minio;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.pojo.common.MinioFilePath;
|
||||
import cn.bunny.dao.pojo.constant.MinioConstant;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
|
@ -78,7 +78,7 @@ public class MinioUtil {
|
|||
public MinioFilePath uploadObjectReturnFilePath(MultipartFile file, String minioPreType) throws IOException {
|
||||
if (file == null) return null;
|
||||
String bucketName = properties.getBucketName();
|
||||
|
||||
|
||||
// 上传对象
|
||||
try {
|
||||
MinioFilePath minioFile = initUploadFileReturnMinioFilePath(bucketName, minioPreType, file);
|
||||
|
@ -87,7 +87,7 @@ public class MinioUtil {
|
|||
|
||||
return minioFile;
|
||||
} catch (Exception exception) {
|
||||
throw new BunnyException(ResultCodeEnum.UPDATE_ERROR);
|
||||
throw new AuthCustomerException(ResultCodeEnum.UPDATE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ public class MinioUtil {
|
|||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
throw new BunnyException(ResultCodeEnum.GET_BUCKET_EXCEPTION);
|
||||
throw new AuthCustomerException(ResultCodeEnum.GET_BUCKET_EXCEPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,7 +135,7 @@ public class MinioUtil {
|
|||
minioClient.putObject(PutObjectArgs.builder().bucket(bucketName).object(filename).stream(inputStream, size, -1).build());
|
||||
} catch (Exception exception) {
|
||||
log.error("上传文件失败:{}", (Object) exception.getStackTrace());
|
||||
throw new BunnyException(ResultCodeEnum.UPDATE_ERROR);
|
||||
throw new AuthCustomerException(ResultCodeEnum.UPDATE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ public class MinioUtil {
|
|||
Iterable<Result<DeleteError>> results = minioClient.removeObjects(RemoveObjectsArgs.builder().bucket(bucketName).objects(objectList).build());
|
||||
for (Result<DeleteError> result : results) {
|
||||
DeleteError error = result.get();
|
||||
throw new BunnyException("Error in deleting object " + error.objectName() + "; " + error.message());
|
||||
throw new AuthCustomerException("Error in deleting object " + error.objectName() + "; " + error.message());
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
|
@ -170,7 +170,7 @@ public class MinioUtil {
|
|||
try {
|
||||
putObject(bucketName, filepath, file.getInputStream(), file.getSize());
|
||||
} catch (IOException e) {
|
||||
throw new BunnyException(e.getMessage());
|
||||
throw new AuthCustomerException(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "UserLoginLogDto对象", title = "用户登录日志分页查询", description = "用户登录日志分页查询")
|
||||
@Schema(name = "UserLoginLogDto对象", title = "更新用户登录日志", description = "更新用户登录日志")
|
||||
public class UserLoginLogUpdateDto {
|
||||
|
||||
@Schema(name = "userId", title = "用户Id")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "SchedulersGroupDto对象", title = "分页查询任务调度分组", description = "分页查询任务调度分组")
|
||||
@Schema(name = "SchedulersGroupDto对象", title = "任务调度分组分页查询", description = "任务调度分组分页查询")
|
||||
public class SchedulersGroupDto {
|
||||
|
||||
@Schema(name = "groupName", title = "分组名称")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "SchedulersAddDto对象", title = "Schedulers添加表单", description = "Schedulers添加表单")
|
||||
@Schema(name = "SchedulersAddDto对象", title = "添加Schedulers", description = "添加Schedulers")
|
||||
public class SchedulersAddDto {
|
||||
|
||||
@Schema(name = "jobName", title = "任务名称")
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "SchedulersDto对象", title = "Schedulers查询表单", description = "Schedulers查询表单")
|
||||
@Schema(name = "SchedulersDto对象", title = "Schedulers分页查询", description = "Schedulers分页查询")
|
||||
public class SchedulersDto {
|
||||
|
||||
@Schema(name = "jobName", title = "任务名称")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "SchedulersUpdateDto对象", title = "Schedulers更新表单", description = "Schedulers更新表单")
|
||||
@Schema(name = "SchedulersUpdateDto对象", title = "更新Schedulers", description = "更新Schedulers")
|
||||
public class SchedulersUpdateDto {
|
||||
|
||||
@Schema(name = "jobName", title = "任务名称")
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "DeptAddDto对象", title = "部门", description = "部门管理")
|
||||
@Schema(name = "DeptAddDto对象", title = "添加部门", description = "添加部门")
|
||||
public class DeptAddDto {
|
||||
|
||||
@Schema(name = "parentId", title = "父级id")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "DeptDto对象", title = "部门", description = "部门管理")
|
||||
@Schema(name = "DeptDto对象", title = "部门分页查询", description = "部门分页查询")
|
||||
public class DeptDto {
|
||||
|
||||
@Schema(name = "deptName", title = "部门名称")
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "DeptUpdateDto对象", title = "部门", description = "部门管理")
|
||||
@Schema(name = "DeptUpdateDto对象", title = "更新部门", description = "更新部门")
|
||||
public class DeptUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "EmailTemplateAddDto对象", title = "邮箱模板请求内容", description = "邮箱模板请求内容")
|
||||
@Schema(name = "EmailTemplateAddDto对象", title = "添加邮箱模板", description = "添加邮箱模板")
|
||||
public class EmailTemplateAddDto {
|
||||
|
||||
@Schema(name = "templateName", title = "模板名称")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "EmailTemplateUpdateDto对象", title = "邮箱模板请求内容", description = "邮箱模板请求内容")
|
||||
@Schema(name = "EmailTemplateUpdateDto对象", title = "更新邮箱模板", description = "更新邮箱模板")
|
||||
public class EmailTemplateUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "EmailUserUpdateStatusDto对象", title = "邮箱用户更新状态", description = "邮箱用户更新状态表单")
|
||||
@Schema(name = "EmailUserUpdateStatusDto对象", title = "更新邮箱用户状态", description = "更新邮箱用户状态")
|
||||
public class EmailUserUpdateStatusDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "EmailUsersAddDto对象", title = "邮箱用户发送配置", description = "邮箱用户发送配置管理")
|
||||
@Schema(name = "EmailUsersAddDto对象", title = "添加邮箱用户发送配置", description = "添加邮箱用户发送配置")
|
||||
public class EmailUsersAddDto {
|
||||
|
||||
@Schema(name = "email", title = "邮箱")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "EmailUsersDto对象", title = "邮箱用户发送配置", description = "邮箱用户发送配置管理")
|
||||
@Schema(name = "EmailUsersDto对象", title = "邮箱用户发送配置分页查询", description = "邮箱用户发送配置分页查询")
|
||||
public class EmailUsersDto {
|
||||
|
||||
@Schema(name = "email", title = "邮箱")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "EmailUsersUpdateDto对象", title = "邮箱用户发送配置", description = "邮箱用户发送配置管理")
|
||||
@Schema(name = "EmailUsersUpdateDto对象", title = "更新邮箱用户发送配置", description = "更新邮箱用户发送配置")
|
||||
public class EmailUsersUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "FilesAddDto对象", title = "文件", description = "文件管理")
|
||||
@Schema(name = "FilesAddDto对象", title = "添加文件", description = "添加文件")
|
||||
public class FilesAddDto {
|
||||
|
||||
@Schema(name = "filepath", title = "文件在服务器上的存储路径")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "FilesDto对象", title = "文件", description = "文件管理")
|
||||
@Schema(name = "FilesDto对象", title = "文件分页查询", description = "文件分页查询")
|
||||
public class FilesDto {
|
||||
|
||||
@Schema(name = "filename", title = "文件的名称")
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "FilesUpdateDto对象", title = "文件", description = "文件管理")
|
||||
@Schema(name = "FilesUpdateDto对象", title = "更新文件", description = "文件管理")
|
||||
public class FilesUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MenuIconAddDto对象", title = "系统菜单图标", description = "系统菜单图标管理")
|
||||
@Schema(name = "MenuIconAddDto对象", title = "添加系统菜单图标", description = "添加系统菜单图标")
|
||||
public class MenuIconAddDto {
|
||||
|
||||
@Schema(name = "iconCode", title = "icon类名")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MenuIconDto对象", title = "系统菜单图标", description = "系统菜单图标管理")
|
||||
@Schema(name = "MenuIconDto对象", title = "系统菜单图标分页查询", description = "系统菜单图标管理")
|
||||
public class MenuIconDto {
|
||||
|
||||
@Schema(name = "iconCode", title = "icon类名")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MenuIconUpdateDto对象", title = "系统菜单图标", description = "系统菜单图标管理")
|
||||
@Schema(name = "MenuIconUpdateDto对象", title = "更新系统菜单图标", description = "系统菜单图标管理")
|
||||
public class MenuIconUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageDto对象", title = "消息查询", description = "消息查询")
|
||||
@Schema(name = "MessageDto对象", title = "消息分页查询", description = "消息分页查询")
|
||||
public class MessageDto {
|
||||
|
||||
@Schema(name = "title", title = "消息标题")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageReceivedDto对象", title = "用户消息查询", description = "用户消息查询")
|
||||
@Schema(name = "MessageReceivedDto对象", title = "用户消息分页查询", description = "用户消息分页查询")
|
||||
public class MessageReceivedDto {
|
||||
|
||||
@Schema(name = "title", title = "消息标题")
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageReceivedDto对象", title = "用户消息查询", description = "用户消息查询")
|
||||
@Schema(name = "MessageReceivedDto对象", title = "更新用户消息", description = "更新用户消息")
|
||||
public class MessageReceivedUpdateDto {
|
||||
|
||||
@Schema(name = "ids", title = "消息接受id")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageTypeAddDto对象", title = "系统消息类型", description = "系统消息类型")
|
||||
@Schema(name = "MessageTypeAddDto对象", title = "添加系统消息类型", description = "添加系统消息类型")
|
||||
public class MessageTypeAddDto {
|
||||
|
||||
@Schema(name = "messageName", title = "消息名称")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageType对象", title = "系统消息类型", description = "系统消息类型")
|
||||
@Schema(name = "MessageType对象", title = "系统消息类型分页查询", description = "系统消息类型分页查询")
|
||||
public class MessageTypeDto {
|
||||
|
||||
@Schema(name = "status", title = "1:启用 0:禁用")
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageTypeUpdateDto对象", title = "系统消息类型", description = "系统消息类型")
|
||||
@Schema(name = "MessageTypeUpdateDto对象", title = "更新系统消息类型", description = "更新系统消息类型")
|
||||
public class MessageTypeUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageUpdateDto对象", title = "系统消息", description = "系统消息")
|
||||
@Schema(name = "MessageUpdateDto对象", title = "更新系统消息", description = "系统消息")
|
||||
public class MessageUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "MessageUserDto对象", title = "用户消息查询内容", description = "用户消息查询内容")
|
||||
@Schema(name = "MessageUserDto对象", title = "用户消息分页查询", description = "用户消息分页查询")
|
||||
public class MessageUserDto {
|
||||
|
||||
@Schema(name = "title", title = "消息标题")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "PowerAddDto对象", title = "权限", description = "权限管理")
|
||||
@Schema(name = "PowerAddDto对象", title = "添加权限", description = "权限管理")
|
||||
public class PowerAddDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "PowerDto对象", title = "权限", description = "权限管理")
|
||||
@Schema(name = "PowerDto对象", title = "权限分页查询", description = "权限管理")
|
||||
public class PowerDto {
|
||||
|
||||
@Schema(name = "parentId", title = "权限编码")
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "PowerUpdateBatchByParentIdDto对象", title = "批量修改权限", description = "批量修改权限表单")
|
||||
@Schema(name = "PowerUpdateBatchByParentIdDto对象", title = "批量修改权限", description = "批量修改权限")
|
||||
public class PowerUpdateBatchByParentIdDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "PowerUpdateDto对象", title = "权限", description = "权限管理")
|
||||
@Schema(name = "PowerUpdateDto对象", title = "更新权限", description = "权限管理")
|
||||
public class PowerUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "RoleAddDto对象", title = "角色", description = "角色管理")
|
||||
@Schema(name = "RoleAddDto对象", title = "添加角色", description = "角色管理")
|
||||
public class RoleAddDto {
|
||||
|
||||
@Schema(name = "roleCode", title = "角色代码")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "RoleDto对象", title = "角色", description = "角色管理")
|
||||
@Schema(name = "RoleDto对象", title = "角色分页查询", description = "角色管理")
|
||||
public class RoleDto {
|
||||
|
||||
@Schema(name = "roleCode", title = "角色代码")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "RoleUpdateDto对象", title = "角色", description = "角色管理")
|
||||
@Schema(name = "RoleUpdateDto对象", title = "更新角色", description = "角色管理")
|
||||
public class RoleUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -14,7 +14,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "RouterManageDto对象", title = "路由添加表单", description = "路由添加表单")
|
||||
@Schema(name = "RouterManageDto对象", title = "添加路由", description = "添加路由")
|
||||
public class RouterAddDto {
|
||||
|
||||
@Schema(name = "menuType", title = "菜单类型")
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "RouterManageDto对象", title = "路由查询表单", description = "路由查询表单")
|
||||
@Schema(name = "RouterManageDto对象", title = "路由分页查询", description = "路由分页查询")
|
||||
public class RouterManageDto {
|
||||
|
||||
@Schema(name = "title", title = "路由标题")
|
||||
|
|
|
@ -14,7 +14,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "RouterManageDto对象", title = "路由更新表单", description = "路由更新表单")
|
||||
@Schema(name = "RouterManageDto对象", title = "更新路由", description = "更新路由")
|
||||
public class RouterUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "唯一标识")
|
||||
|
|
|
@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "AdminUserAddDto对象", title = "用户", description = "用户管理")
|
||||
@Schema(name = "AdminUserAddDto对象", title = "添加用户", description = "用户管理")
|
||||
public class AdminUserAddDto {
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "AdminUserAddDto对象", title = "用户", description = "用户管理")
|
||||
@Schema(name = "AdminUserAddDto对象", title = "用户分页查询", description = "用户管理")
|
||||
public class AdminUserDto {
|
||||
|
||||
@Schema(name = "username", title = "用户名")
|
||||
|
|
|
@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Schema(name = "AdminUserUpdateDto对象", title = "用户", description = "用户管理")
|
||||
@Schema(name = "AdminUserUpdateDto对象", title = "更新用户", description = "用户管理")
|
||||
public class AdminUserUpdateDto {
|
||||
|
||||
@Schema(name = "id", title = "主键")
|
||||
|
|
|
@ -24,7 +24,9 @@ public class LoginDto {
|
|||
@Schema(name = "password", title = "密码")
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@NotNull(message = "密码不能为空")
|
||||
@Pattern(regexp = "^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)]|[()])+$)(?!^.*[\\u4E00-\\u9FA5].*$)([^(0-9a-zA-Z)]|[()]|[a-z]|[A-Z]|[0-9]){8,18}$", message = "密码格式应为8-18位数字、字母、符号的任意两种组合")
|
||||
@Pattern(
|
||||
regexp = "^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)]|[()])+$)(?!^.*[\\u4E00-\\u9FA5].*$)([^(0-9a-zA-Z)]|[()]|[a-z]|[A-Z]|[0-9]){8,18}$",
|
||||
message = "密码格式应为8-18位数字、字母、符号的任意两种组合")
|
||||
private String password;
|
||||
|
||||
@Schema(name = "emailCode", title = "邮箱验证码")
|
||||
|
|
|
@ -14,6 +14,7 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@Schema(name = "RefreshTokenDto对象", title = "登录成功返回内容", description = "登录成功返回内容")
|
||||
public class RefreshTokenDto {
|
||||
|
||||
@Schema(name = "refreshToken", title = "请求刷新token")
|
||||
@NotBlank(message = "请求刷新token不能为空")
|
||||
@NotNull(message = "请求刷新token不能为空")
|
||||
|
|
|
@ -14,107 +14,107 @@ import lombok.NoArgsConstructor;
|
|||
@Schema(name = "WebConfigurationVo对象", title = "前端配置选项", description = "前端配置选项")
|
||||
public class WebConfigurationVo {
|
||||
|
||||
@Schema(name = "Version", description = "应用程序的版本")
|
||||
@Schema(name = "version", description = "应用程序的版本")
|
||||
@JSONField(format = "Version")
|
||||
private String version;
|
||||
|
||||
@Schema(name = "Title", description = "应用程序的标题")
|
||||
@Schema(name = "title", description = "应用程序的标题")
|
||||
@JSONField(format = "Title")
|
||||
private String title;
|
||||
|
||||
@Schema(name = "Copyright", description = "版权信息")
|
||||
@Schema(name = "copyright", description = "版权信息")
|
||||
@JSONField(format = "Copyright")
|
||||
private String copyright;
|
||||
|
||||
@Schema(name = "FixedHeader", description = "头部是否固定")
|
||||
@Schema(name = "fixedHeader", description = "头部是否固定")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private boolean fixedHeader;
|
||||
|
||||
@Schema(name = "HiddenSideBar", description = "侧边栏是否隐藏")
|
||||
@Schema(name = "hiddenSideBar", description = "侧边栏是否隐藏")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private boolean hiddenSideBar;
|
||||
|
||||
@Schema(name = "MultiTagsCache", description = "是否缓存多个标签")
|
||||
@Schema(name = "multiTagsCache", description = "是否缓存多个标签")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private boolean multiTagsCache;
|
||||
|
||||
@Schema(name = "KeepAlive", description = "是否持久化")
|
||||
@Schema(name = "keepAlive", description = "是否持久化")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private boolean keepAlive;
|
||||
|
||||
@Schema(name = "Locale", description = "语言类型")
|
||||
@Schema(name = "locale", description = "语言类型")
|
||||
@JSONField(format = "Locale")
|
||||
private String locale;
|
||||
|
||||
@Schema(name = "Layout", description = "应用程序的布局")
|
||||
@Schema(name = "layout", description = "应用程序的布局")
|
||||
@JSONField(name = "Layout")
|
||||
private String layout;
|
||||
|
||||
@Schema(name = "Theme", description = "应用程序的主题")
|
||||
@Schema(name = "theme", description = "应用程序的主题")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private String theme;
|
||||
|
||||
@Schema(name = "DarkMode", description = "是否启用深色模式")
|
||||
@Schema(name = "darkMode", description = "是否启用深色模式")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private boolean darkMode;
|
||||
|
||||
@Schema(name = "OverallStyle", description = "应用程序的整体样式")
|
||||
@Schema(name = "overallStyle", description = "应用程序的整体样式")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private String overallStyle;
|
||||
|
||||
@Schema(name = "Grey", description = "是否启用灰色模式")
|
||||
@Schema(name = "grey", description = "是否启用灰色模式")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private boolean grey;
|
||||
|
||||
@Schema(name = "Weak", description = "色弱模式")
|
||||
@Schema(name = "weak", description = "色弱模式")
|
||||
@JSONField(format = "FixedHeader")
|
||||
private boolean weak;
|
||||
|
||||
@Schema(name = "HideTabs", description = "是否隐藏选项卡")
|
||||
@Schema(name = "hideTabs", description = "是否隐藏选项卡")
|
||||
@JSONField(format = "HideTabs")
|
||||
private boolean hideTabs;
|
||||
|
||||
@Schema(name = "HideFooter", description = "是否隐藏页脚")
|
||||
@Schema(name = "hideFooter", description = "是否隐藏页脚")
|
||||
@JSONField(format = "HideFooter")
|
||||
private boolean hideFooter;
|
||||
|
||||
@Schema(name = "Stretch", description = "是否拉伸显示")
|
||||
@Schema(name = "stretch", description = "是否拉伸显示")
|
||||
@JSONField(format = "Stretch")
|
||||
private boolean stretch;
|
||||
|
||||
@Schema(name = "SidebarStatus", description = "侧边栏的状态")
|
||||
@Schema(name = "sidebarStatus", description = "侧边栏的状态")
|
||||
@JSONField(format = "SidebarStatus")
|
||||
private boolean sidebarStatus;
|
||||
|
||||
@Schema(name = "EpThemeColor", description = "主题颜色")
|
||||
@Schema(name = "epThemeColor", description = "主题颜色")
|
||||
@JSONField(format = "EpThemeColor")
|
||||
private String epThemeColor;
|
||||
|
||||
@Schema(name = "ShowLogo", description = "是否显示logo")
|
||||
@Schema(name = "showLogo", description = "是否显示logo")
|
||||
@JSONField(format = "ShowLogo")
|
||||
private boolean showLogo;
|
||||
|
||||
@Schema(name = "ShowModel", description = "要显示的模型")
|
||||
@Schema(name = "showModel", description = "要显示的模型")
|
||||
@JSONField(format = "ShowModel")
|
||||
private String showModel;
|
||||
|
||||
@Schema(name = "MenuArrowIconNoTransition", description = "菜单箭头图标是否没有过渡效果")
|
||||
@Schema(name = "menuArrowIconNoTransition", description = "菜单箭头图标是否没有过渡效果")
|
||||
@JSONField(format = "MenuArrowIconNoTransition")
|
||||
private boolean menuArrowIconNoTransition;
|
||||
|
||||
@Schema(name = "CachingAsyncRoutes", description = "是否缓存异步路由")
|
||||
@Schema(name = "cachingAsyncRoutes", description = "是否缓存异步路由")
|
||||
@JSONField(format = "CachingAsyncRoutes")
|
||||
private boolean cachingAsyncRoutes;
|
||||
|
||||
@Schema(name = "TooltipEffect", description = "工具提示的效果")
|
||||
@Schema(name = "tooltipEffect", description = "工具提示的效果")
|
||||
@JSONField(format = "TooltipEffect")
|
||||
private String tooltipEffect;
|
||||
|
||||
@Schema(name = "ResponsiveStorageNameSpace", description = "响应式存储的命名空间")
|
||||
@Schema(name = "responsiveStorageNameSpace", description = "响应式存储的命名空间")
|
||||
@JSONField(format = "ResponsiveStorageNameSpace")
|
||||
private String responsiveStorageNameSpace;
|
||||
|
||||
@Schema(name = "MenuSearchHistory", description = "菜单搜索历史")
|
||||
@Schema(name = "responsiveStorageNameSpace", description = "菜单搜索历史")
|
||||
@JSONField(format = "MenuSearchHistory")
|
||||
private int menuSearchHistory;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.aop;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
|
||||
|
@ -34,7 +34,7 @@ public class AnnotationScanner {
|
|||
Class<?> clazz = Class.forName(bd.getBeanClassName());
|
||||
classes.add(clazz);
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new BunnyException(ResultCodeEnum.CLASS_NOT_FOUND);
|
||||
throw new AuthCustomerException(ResultCodeEnum.CLASS_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.Map;
|
|||
|
||||
@Aspect
|
||||
@Component
|
||||
public class JobExecuteAop {
|
||||
public class JobExecuteAspect {
|
||||
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(LocalDateTimeConstant.YYYY_MM_DD_HH_MM_SS);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.factory;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.common.service.utils.mail.MailSenderUtil;
|
||||
import cn.bunny.dao.entity.system.EmailTemplate;
|
||||
import cn.bunny.dao.entity.system.EmailUsers;
|
||||
|
@ -33,14 +33,14 @@ public class EmailFactory {
|
|||
*/
|
||||
public void sendEmailTemplate(String email, EmailTemplate emailTemplate, HashMap<String, Object> params) {
|
||||
// 判断邮件模板是否为空
|
||||
if (emailTemplate == null) throw new BunnyException(ResultCodeEnum.EMAIL_TEMPLATE_IS_EMPTY);
|
||||
if (emailTemplate == null) throw new AuthCustomerException(ResultCodeEnum.EMAIL_TEMPLATE_IS_EMPTY);
|
||||
|
||||
// 查询配置发送邮箱,如果没有配置发件者邮箱改用用户列表中默认的,如果默认的也为空则报错
|
||||
Long emailUser = emailTemplate.getEmailUser();
|
||||
EmailUsers emailUsers;
|
||||
if (emailUser == null) {
|
||||
emailUsers = emailUsersMapper.selectOne(Wrappers.<EmailUsers>lambdaQuery().eq(EmailUsers::getIsDefault, true));
|
||||
if (emailUsers == null) throw new BunnyException(ResultCodeEnum.EMAIL_USER_IS_EMPTY);
|
||||
if (emailUsers == null) throw new AuthCustomerException(ResultCodeEnum.EMAIL_USER_IS_EMPTY);
|
||||
} else {
|
||||
emailUsers = emailUsersMapper.selectOne(Wrappers.<EmailUsers>lambdaQuery().eq(EmailUsers::getId, emailUser));
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class EmailFactory {
|
|||
emailSend.setText(modifiedTemplate[0]);
|
||||
MailSenderUtil.sendEmail(emailSendInit, emailSend);
|
||||
} catch (MessagingException e) {
|
||||
throw new BunnyException(ResultCodeEnum.SEND_MAIL_CODE_ERROR);
|
||||
throw new AuthCustomerException(ResultCodeEnum.SEND_MAIL_CODE_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.security.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.user.LoginDto;
|
||||
import cn.bunny.dao.entity.system.AdminUser;
|
||||
import cn.bunny.dao.pojo.result.Result;
|
||||
|
@ -78,7 +78,7 @@ public class CustomUserDetailsServiceImpl implements cn.bunny.services.security.
|
|||
|
||||
// 对登录密码进行md5加密判断,是否与数据库中一致
|
||||
String md5Password = DigestUtils.md5DigestAsHex(password.getBytes());
|
||||
if (!user.getPassword().equals(md5Password)) throw new BunnyException(ResultCodeEnum.LOGIN_ERROR);
|
||||
if (!user.getPassword().equals(md5Password)) throw new AuthCustomerException(ResultCodeEnum.LOGIN_ERROR);
|
||||
|
||||
return userFactory.buildLoginUserVo(user, readMeDay);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.configuration.WebConfigurationDto;
|
||||
import cn.bunny.dao.entity.configuration.WebConfiguration;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
|
@ -26,7 +26,7 @@ public class ConfigurationServiceImpl implements ConfigurationService {
|
|||
private String bashPath;
|
||||
|
||||
private static @NotNull String getWebConfigString(InputStream inputStream, Path templatePath) throws IOException {
|
||||
if (inputStream == null) throw new BunnyException(ResultCodeEnum.MISSING_TEMPLATE_FILES);
|
||||
if (inputStream == null) throw new AuthCustomerException(ResultCodeEnum.MISSING_TEMPLATE_FILES);
|
||||
|
||||
// 判断web模板文件是否存在,不存在进行复制
|
||||
boolean exists = Files.exists(templatePath);
|
||||
|
@ -80,7 +80,7 @@ public class ConfigurationServiceImpl implements ConfigurationService {
|
|||
String string = getWebConfigString(inputStream, templatePath);
|
||||
return JSON.parseObject(string, WebConfiguration.class);
|
||||
} catch (IOException exception) {
|
||||
throw new BunnyException(exception.getMessage());
|
||||
throw new AuthCustomerException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class ConfigurationServiceImpl implements ConfigurationService {
|
|||
String string = getWebConfigString(inputStream, templatePath);
|
||||
return JSON.parseObject(string, WebConfigurationVo.class);
|
||||
} catch (IOException exception) {
|
||||
throw new BunnyException(exception.getMessage());
|
||||
throw new AuthCustomerException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.dept.DeptAddDto;
|
||||
import cn.bunny.dao.dto.system.dept.DeptDto;
|
||||
import cn.bunny.dao.dto.system.dept.DeptUpdateDto;
|
||||
|
@ -100,7 +100,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||
@Override
|
||||
@CacheEvict(cacheNames = "dept", key = "'allDept'", beforeInvocation = true)
|
||||
public void updateDept(DeptUpdateDto dto) {
|
||||
if (dto.getId().equals(dto.getParentId())) throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
if (dto.getId().equals(dto.getParentId())) throw new AuthCustomerException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
|
||||
// 将管理员用户逗号分隔
|
||||
String mangerList = dto.getManager().stream().map(String::trim).collect(Collectors.joining(","));
|
||||
|
@ -122,7 +122,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||
@CacheEvict(cacheNames = "dept", key = "'allDept'", beforeInvocation = true)
|
||||
public void deleteDept(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
// 删除当前部门
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateAddDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateDto;
|
||||
import cn.bunny.dao.dto.system.email.template.EmailTemplateUpdateDto;
|
||||
|
@ -76,7 +76,7 @@ public class EmailTemplateServiceImpl extends ServiceImpl<EmailTemplateMapper, E
|
|||
public void updateEmailTemplate(@Valid EmailTemplateUpdateDto dto) {
|
||||
// 查询是否有这个模板
|
||||
List<EmailTemplate> emailTemplateList = list(Wrappers.<EmailTemplate>lambdaQuery().eq(EmailTemplate::getId, dto.getId()));
|
||||
if (emailTemplateList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (emailTemplateList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 更新内容
|
||||
EmailTemplate emailTemplate = new EmailTemplate();
|
||||
|
@ -92,7 +92,7 @@ public class EmailTemplateServiceImpl extends ServiceImpl<EmailTemplateMapper, E
|
|||
@Override
|
||||
public void deleteEmailTemplate(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUserUpdateStatusDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersAddDto;
|
||||
import cn.bunny.dao.dto.system.email.user.EmailUsersDto;
|
||||
|
@ -100,7 +100,7 @@ public class EmailUsersServiceImpl extends ServiceImpl<EmailUsersMapper, EmailUs
|
|||
@Override
|
||||
public void deleteEmailUsers(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.common.service.utils.FileUtil;
|
||||
import cn.bunny.common.service.utils.minio.MinioProperties;
|
||||
import cn.bunny.common.service.utils.minio.MinioUtil;
|
||||
|
@ -102,7 +102,7 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
|||
files.setDownloadCount(dto.getDownloadCount());
|
||||
return files;
|
||||
} catch (IOException e) {
|
||||
throw new BunnyException(e.getMessage());
|
||||
throw new AuthCustomerException(e.getMessage());
|
||||
}
|
||||
}).toList();
|
||||
|
||||
|
@ -165,7 +165,7 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
|||
|
||||
// 盘读研数据是否过大
|
||||
String mb = maxFileSize.replace("MB", "");
|
||||
if (fileSize / 1024 / 1024 > Long.parseLong(mb)) throw new BunnyException(ResultCodeEnum.DATA_TOO_LARGE);
|
||||
if (fileSize / 1024 / 1024 > Long.parseLong(mb)) throw new AuthCustomerException(ResultCodeEnum.DATA_TOO_LARGE);
|
||||
|
||||
// 插入文件信息
|
||||
Files adminFiles = new Files();
|
||||
|
@ -194,7 +194,7 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
|||
*/
|
||||
@Override
|
||||
public void deleteFiles(List<Long> ids) {
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
// 查询文件路径
|
||||
List<String> list = list(Wrappers.<Files>lambdaQuery().in(Files::getId, ids)).stream()
|
||||
|
@ -223,7 +223,7 @@ public class FilesServiceImpl extends ServiceImpl<FilesMapper, Files> implements
|
|||
Files files = getOne(Wrappers.<Files>lambdaQuery().eq(Files::getId, fileId));
|
||||
|
||||
// 判断文件是否存在
|
||||
if (files == null) throw new BunnyException(ResultCodeEnum.FILE_NOT_EXIST);
|
||||
if (files == null) throw new AuthCustomerException(ResultCodeEnum.FILE_NOT_EXIST);
|
||||
|
||||
// 从Minio获取文件
|
||||
String filepath = files.getFilepath();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.i18n.I18nAddDto;
|
||||
import cn.bunny.dao.dto.i18n.I18nDto;
|
||||
import cn.bunny.dao.dto.i18n.I18nUpdateDto;
|
||||
|
@ -99,7 +99,7 @@ public class I18nServiceImpl extends ServiceImpl<I18nMapper, I18n> implements I1
|
|||
|
||||
// 查询数据是否存在
|
||||
List<I18n> i18nList = list(Wrappers.<I18n>lambdaQuery().eq(I18n::getKeyName, keyName).eq(I18n::getTypeName, typeName));
|
||||
if (!i18nList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_EXIST);
|
||||
if (!i18nList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_EXIST);
|
||||
|
||||
// 保存内容
|
||||
I18n i18n = new I18n();
|
||||
|
@ -119,7 +119,7 @@ public class I18nServiceImpl extends ServiceImpl<I18nMapper, I18n> implements I1
|
|||
|
||||
// 查询数据是否存在
|
||||
List<I18n> i18nList = list(Wrappers.<I18n>lambdaQuery().eq(I18n::getId, id));
|
||||
if (i18nList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (i18nList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 保存内容
|
||||
I18n i18n = new I18n();
|
||||
|
@ -136,7 +136,7 @@ public class I18nServiceImpl extends ServiceImpl<I18nMapper, I18n> implements I1
|
|||
@CacheEvict(cacheNames = "i18n", key = "'i18n'", beforeInvocation = true)
|
||||
public void deleteI18n(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.i18n.I18nTypeAddDto;
|
||||
import cn.bunny.dao.dto.i18n.I18nTypeDto;
|
||||
import cn.bunny.dao.dto.i18n.I18nTypeUpdateDto;
|
||||
|
@ -61,7 +61,7 @@ public class I18nTypeServiceImpl extends ServiceImpl<I18nTypeMapper, I18nType> i
|
|||
|
||||
// 查询添加的数据是否之前添加过
|
||||
List<I18nType> i18nTypeList = list(Wrappers.<I18nType>lambdaQuery().eq(I18nType::getTypeName, typeName));
|
||||
if (!i18nTypeList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_EXIST);
|
||||
if (!i18nTypeList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_EXIST);
|
||||
|
||||
// 如果是默认,将其它内容设为false
|
||||
if (isDefault) {
|
||||
|
@ -89,7 +89,7 @@ public class I18nTypeServiceImpl extends ServiceImpl<I18nTypeMapper, I18nType> i
|
|||
|
||||
// 查询更新的内容是否存在
|
||||
List<I18nType> i18nTypeList = list(Wrappers.<I18nType>lambdaQuery().eq(I18nType::getId, id));
|
||||
if (i18nTypeList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (i18nTypeList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 如果是默认,将其它内容设为false
|
||||
if (isDefault) {
|
||||
|
@ -112,7 +112,7 @@ public class I18nTypeServiceImpl extends ServiceImpl<I18nTypeMapper, I18nType> i
|
|||
@CacheEvict(cacheNames = "i18n", key = "'i18nType'", beforeInvocation = true)
|
||||
public void deleteI18nType(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.menuIcon.MenuIconAddDto;
|
||||
import cn.bunny.dao.dto.system.menuIcon.MenuIconDto;
|
||||
import cn.bunny.dao.dto.system.menuIcon.MenuIconUpdateDto;
|
||||
|
@ -105,7 +105,7 @@ public class MenuIconServiceImpl extends ServiceImpl<MenuIconMapper, MenuIcon> i
|
|||
@CacheEvict(cacheNames = "menuIcon", key = "'menuIconList'", beforeInvocation = true)
|
||||
public void deleteMenuIcon(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.message.MessageReceivedDto;
|
||||
import cn.bunny.dao.dto.system.message.MessageReceivedUpdateDto;
|
||||
import cn.bunny.dao.dto.system.message.MessageUserDto;
|
||||
|
@ -133,7 +133,7 @@ public class MessageReceivedServiceImpl extends ServiceImpl<MessageReceivedMappe
|
|||
public void userMarkAsRead(List<Long> ids) {
|
||||
// 判断ids是否为空
|
||||
if (ids.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
}
|
||||
|
||||
// 更新表中消息状态
|
||||
|
@ -156,14 +156,14 @@ public class MessageReceivedServiceImpl extends ServiceImpl<MessageReceivedMappe
|
|||
public void deleteUserMessageByIds(List<Long> ids) {
|
||||
// 判断ids是否为空
|
||||
if (ids.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
}
|
||||
|
||||
// 判断删除的是否是自己的消息
|
||||
List<MessageReceived> messageReceivedList = list(Wrappers.<MessageReceived>lambdaQuery().in(MessageReceived::getReceivedUserId, ids));
|
||||
messageReceivedList.forEach(messageReceived -> {
|
||||
if (!messageReceived.getReceivedUserId().equals(BaseContext.getUserId())) {
|
||||
throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
throw new AuthCustomerException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.common.entity.BaseEntity;
|
||||
import cn.bunny.dao.dto.system.message.MessageAddDto;
|
||||
import cn.bunny.dao.dto.system.message.MessageDto;
|
||||
|
@ -131,7 +131,7 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|||
@Override
|
||||
public List<MessageReceivedWithUserVo> getReceivedUserinfoByMessageId(Long messageId) {
|
||||
if (messageId == null) {
|
||||
throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
}
|
||||
return baseMapper.selectUserinfoListByMessageId(messageId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.power.PowerUpdateBatchByParentIdDto;
|
||||
|
@ -91,7 +91,7 @@ public class PowerServiceImpl extends ServiceImpl<PowerMapper, Power> implements
|
|||
.or()
|
||||
.eq(Power::getRequestUrl, dto.getRequestUrl());
|
||||
List<Power> powerList = list(wrapper);
|
||||
if (!powerList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_EXIST);
|
||||
if (!powerList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_EXIST);
|
||||
|
||||
// 保存数据
|
||||
Power power = new Power();
|
||||
|
@ -109,8 +109,8 @@ public class PowerServiceImpl extends ServiceImpl<PowerMapper, Power> implements
|
|||
public void updatePower(@Valid PowerUpdateDto dto) {
|
||||
Long id = dto.getId();
|
||||
List<Power> powerList = list(Wrappers.<Power>lambdaQuery().eq(Power::getId, id));
|
||||
if (powerList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (dto.getId().equals(dto.getParentId())) throw new BunnyException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
if (powerList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (dto.getId().equals(dto.getParentId())) throw new AuthCustomerException(ResultCodeEnum.ILLEGAL_DATA_REQUEST);
|
||||
|
||||
// 更新内容
|
||||
Power power = new Power();
|
||||
|
@ -127,7 +127,7 @@ public class PowerServiceImpl extends ServiceImpl<PowerMapper, Power> implements
|
|||
@CacheEvict(cacheNames = "power", key = "'allPower'", beforeInvocation = true)
|
||||
public void deletePower(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
// 删除权限
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleAddDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleDto;
|
||||
import cn.bunny.dao.dto.system.rolePower.role.RoleUpdateDto;
|
||||
|
@ -108,7 +108,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
public void updateRole(@Valid RoleUpdateDto dto) {
|
||||
// 查询更新的角色是否存在
|
||||
List<Role> roleList = list(Wrappers.<Role>lambdaQuery().eq(Role::getId, dto.getId()));
|
||||
if (roleList.isEmpty()) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (roleList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 更新内容
|
||||
Role role = new Role();
|
||||
|
@ -131,7 +131,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||
@CacheEvict(cacheNames = "role", key = "'allRole'", beforeInvocation = true)
|
||||
public void deleteRole(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
// 删除角色
|
||||
baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.router.AssignRolesToRoutersDto;
|
||||
import cn.bunny.dao.entity.system.RouterRole;
|
||||
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
||||
|
@ -76,7 +76,7 @@ public class RouterRoleServiceImpl extends ServiceImpl<RouterRoleMapper, RouterR
|
|||
@Override
|
||||
public void clearAllRolesSelect(List<Long> routerIds) {
|
||||
if (routerIds.isEmpty()) {
|
||||
throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
}
|
||||
baseMapper.deleteBatchIdsByRouterIdsWithPhysics(routerIds);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.router.RouterAddDto;
|
||||
import cn.bunny.dao.dto.system.router.RouterManageDto;
|
||||
import cn.bunny.dao.dto.system.router.RouterUpdateByIdWithRankDto;
|
||||
|
@ -222,7 +222,7 @@ public class RouterServiceImpl extends ServiceImpl<RouterMapper, Router> impleme
|
|||
|
||||
// 设置路由等级需要大于或等于父级的路由等级
|
||||
if (routerParent != null && (dto.getRouterRank() < routerParent.getRouterRank())) {
|
||||
throw new BunnyException(ResultCodeEnum.ROUTER_RANK_NEED_LARGER_THAN_THE_PARENT);
|
||||
throw new AuthCustomerException(ResultCodeEnum.ROUTER_RANK_NEED_LARGER_THAN_THE_PARENT);
|
||||
}
|
||||
|
||||
// 如果设置的不是外部页面
|
||||
|
@ -241,7 +241,7 @@ public class RouterServiceImpl extends ServiceImpl<RouterMapper, Router> impleme
|
|||
@Override
|
||||
public void deletedMenuByIds(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
// 查找子级菜单,一起删除
|
||||
List<Long> longList = list(Wrappers.<Router>lambdaQuery().in(Router::getParentId, ids)).stream().map(Router::getId).toList();
|
||||
|
@ -264,14 +264,14 @@ public class RouterServiceImpl extends ServiceImpl<RouterMapper, Router> impleme
|
|||
Router router = getOne(Wrappers.<Router>lambdaQuery().eq(Router::getId, dto.getId()));
|
||||
|
||||
// 判断更新数据是否存在
|
||||
if (router == null) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (router == null) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 查询当前路由和父级路由
|
||||
Router routerParent = getOne(Wrappers.<Router>lambdaQuery().eq(Router::getId, router.getParentId()));
|
||||
|
||||
// 设置路由等级需要大于或等于父级的路由等级
|
||||
if (routerParent != null && (dto.getRouterRank() < routerParent.getRouterRank())) {
|
||||
throw new BunnyException(ResultCodeEnum.ROUTER_RANK_NEED_LARGER_THAN_THE_PARENT);
|
||||
throw new AuthCustomerException(ResultCodeEnum.ROUTER_RANK_NEED_LARGER_THAN_THE_PARENT);
|
||||
}
|
||||
|
||||
// 更新排序
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.quartz.SchedulersOperationDto;
|
||||
import cn.bunny.dao.dto.quartz.schedule.SchedulersAddDto;
|
||||
import cn.bunny.dao.dto.quartz.schedule.SchedulersDto;
|
||||
|
@ -134,7 +134,7 @@ public class SchedulersServiceImpl extends ServiceImpl<SchedulersMapper, Schedul
|
|||
|
||||
scheduler.scheduleJob(jobDetail, trigger);
|
||||
} catch (Exception exception) {
|
||||
throw new BunnyException(exception.getMessage());
|
||||
throw new AuthCustomerException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ public class SchedulersServiceImpl extends ServiceImpl<SchedulersMapper, Schedul
|
|||
JobKey key = new JobKey(dto.getJobName(), dto.getJobGroup());
|
||||
scheduler.pauseJob(key);
|
||||
} catch (SchedulerException exception) {
|
||||
throw new BunnyException(exception.getMessage());
|
||||
throw new AuthCustomerException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public class SchedulersServiceImpl extends ServiceImpl<SchedulersMapper, Schedul
|
|||
JobKey key = new JobKey(dto.getJobName(), dto.getJobGroup());
|
||||
scheduler.resumeJob(key);
|
||||
} catch (SchedulerException exception) {
|
||||
throw new BunnyException(exception.getMessage());
|
||||
throw new AuthCustomerException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ public class SchedulersServiceImpl extends ServiceImpl<SchedulersMapper, Schedul
|
|||
scheduler.unscheduleJob(triggerKey);
|
||||
scheduler.deleteJob(JobKey.jobKey(jobName, jobGroup));
|
||||
} catch (SchedulerException exception) {
|
||||
throw new BunnyException(exception.getMessage());
|
||||
throw new AuthCustomerException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.dao.dto.system.user.AssignRolesToUsersDto;
|
||||
import cn.bunny.dao.entity.system.AdminUser;
|
||||
import cn.bunny.dao.entity.system.UserRole;
|
||||
|
@ -54,7 +54,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
|
|||
*/
|
||||
@Override
|
||||
public List<String> getRoleListByUserId(Long userId) {
|
||||
if (userId == null) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (userId == null) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
List<UserRole> userRoles = userRoleMapper.selectList(Wrappers.<UserRole>lambdaQuery().eq(UserRole::getUserId, userId));
|
||||
return userRoles.stream().map(userRole -> userRole.getRoleId().toString()).toList();
|
||||
|
@ -73,7 +73,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
|
|||
// 查询当前用户
|
||||
AdminUser adminUser = userMapper.selectOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, userId));
|
||||
if (adminUser == null) {
|
||||
throw new BunnyException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
throw new AuthCustomerException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
}
|
||||
|
||||
// 删除这个用户下所有已经分配好的角色内容
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.common.service.context.BaseContext;
|
||||
import cn.bunny.common.service.exception.BunnyException;
|
||||
import cn.bunny.common.service.exception.AuthCustomerException;
|
||||
import cn.bunny.common.service.utils.JwtHelper;
|
||||
import cn.bunny.common.service.utils.ip.IpUtil;
|
||||
import cn.bunny.dao.dto.system.files.FileUploadDto;
|
||||
|
@ -129,8 +129,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
Long userId = JwtHelper.getUserId(dto.getRefreshToken());
|
||||
AdminUser adminUser = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, userId));
|
||||
|
||||
if (adminUser == null) throw new BunnyException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
if (adminUser.getStatus()) throw new BunnyException(ResultCodeEnum.FAIL_NO_ACCESS_DENIED_USER_LOCKED);
|
||||
if (adminUser == null) throw new AuthCustomerException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
if (adminUser.getStatus()) throw new AuthCustomerException(ResultCodeEnum.FAIL_NO_ACCESS_DENIED_USER_LOCKED);
|
||||
|
||||
LoginVo buildUserVo = userFactory.buildLoginUserVo(adminUser, dto.getReadMeDay());
|
||||
RefreshTokenVo refreshTokenVo = new RefreshTokenVo();
|
||||
|
@ -171,11 +171,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
@Override
|
||||
public UserVo getUserinfoById(Long id) {
|
||||
// 判断请求Id是否为空
|
||||
if (id == null) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (id == null) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
AdminUser user = getById(id);
|
||||
|
||||
// 用户是否存在
|
||||
if (user == null) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (user == null) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 用户头像
|
||||
String avatar = user.getAvatar();
|
||||
|
@ -201,11 +201,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
AdminUser adminUser = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, userId));
|
||||
|
||||
// 判断是否存在这个用户
|
||||
if (adminUser == null) throw new BunnyException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
if (adminUser == null) throw new AuthCustomerException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
|
||||
// 判断新密码是否与旧密码相同
|
||||
if (adminUser.getPassword().equals(md5Password))
|
||||
throw new BunnyException(ResultCodeEnum.UPDATE_NEW_PASSWORD_SAME_AS_OLD_PASSWORD);
|
||||
throw new AuthCustomerException(ResultCodeEnum.UPDATE_NEW_PASSWORD_SAME_AS_OLD_PASSWORD);
|
||||
|
||||
// 更新用户密码
|
||||
adminUser = new AdminUser();
|
||||
|
@ -230,7 +230,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
|
||||
// 判断是否存在这个用户
|
||||
AdminUser user = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, userId));
|
||||
if (user == null) throw new BunnyException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
if (user == null) throw new AuthCustomerException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
|
||||
// 上传头像
|
||||
FileUploadDto uploadDto = FileUploadDto.builder().file(avatar).type(MinioConstant.avatar).build();
|
||||
|
@ -254,7 +254,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
*/
|
||||
@Override
|
||||
public void forcedOffline(Long id) {
|
||||
if (id == null) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (id == null) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
// 根据id查询用户登录前缀
|
||||
AdminUser adminUser = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, id));
|
||||
|
@ -340,7 +340,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
|
||||
// 判断是否存在这个用户
|
||||
AdminUser user = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, userId));
|
||||
if (user == null) throw new BunnyException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
if (user == null) throw new AuthCustomerException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
|
||||
// 检查用户头像
|
||||
dto.setAvatar(userFactory.checkPostUserAvatar(dto.getAvatar()));
|
||||
|
@ -368,14 +368,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
AdminUser adminUser = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, userId));
|
||||
|
||||
// 判断用户是否存在
|
||||
if (adminUser == null) throw new BunnyException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
if (adminUser == null) throw new AuthCustomerException(ResultCodeEnum.USER_IS_EMPTY);
|
||||
|
||||
// 数据库中的密码
|
||||
String dbPassword = adminUser.getPassword();
|
||||
password = DigestUtils.md5DigestAsHex(password.getBytes());
|
||||
|
||||
// 判断数据库中密码是否和更新用户密码相同
|
||||
if (dbPassword.equals(password)) throw new BunnyException(ResultCodeEnum.NEW_PASSWORD_SAME_OLD_PASSWORD);
|
||||
if (dbPassword.equals(password)) throw new AuthCustomerException(ResultCodeEnum.NEW_PASSWORD_SAME_OLD_PASSWORD);
|
||||
|
||||
// 更新用户密码
|
||||
adminUser = new AdminUser();
|
||||
|
@ -462,7 +462,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
|
||||
// 判断更新内容是否存在
|
||||
AdminUser adminUser = getOne(Wrappers.<AdminUser>lambdaQuery().eq(AdminUser::getId, userId));
|
||||
if (adminUser == null) throw new BunnyException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
if (adminUser == null) throw new AuthCustomerException(ResultCodeEnum.DATA_NOT_EXIST);
|
||||
|
||||
// 如果更新了用户名,删除之前的用户数据
|
||||
if (!dto.getUsername().equals(adminUser.getUsername())) {
|
||||
|
@ -499,12 +499,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
@Override
|
||||
public void deleteAdminUser(List<Long> ids) {
|
||||
// 判断数据请求是否为空
|
||||
if (ids.isEmpty()) throw new BunnyException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
if (ids.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.REQUEST_IS_EMPTY);
|
||||
|
||||
// 根据用户Id列表查询用户角色
|
||||
List<Role> list = roleMapper.selectListByUserIds(ids);
|
||||
List<Role> roleList = list.stream().filter(role -> role.getRoleCode().equals("admin") || ids.contains(1L)).toList();
|
||||
if (!roleList.isEmpty()) throw new BunnyException(ResultCodeEnum.ADMIN_ROLE_CAN_NOT_DELETED);
|
||||
if (!roleList.isEmpty()) throw new AuthCustomerException(ResultCodeEnum.ADMIN_ROLE_CAN_NOT_DELETED);
|
||||
|
||||
// 逻辑删除
|
||||
removeBatchByIds(ids);
|
||||
|
|
Loading…
Reference in New Issue