mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-10 08:57:14 +08:00
chore: continew-starter 2.7.4 => 2.7.5
1.BaseServiceImpl 所在包调整 2.BaseController 改为在 Admin common 模块编写(重构权限校验 checkPermission 处理) 3.CRUD ValidateGroup => CrudValidationGroup 4.Admin ValidateGroup => ValidationGroup 5.修复 Query 查询数组范围报错 Closes #IB8711
This commit is contained in:
@@ -25,7 +25,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
import top.continew.admin.common.constant.RegexConstants;
|
||||
import top.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.continew.admin.system.enums.StorageTypeEnum;
|
||||
import top.continew.admin.system.util.ValidateGroup;
|
||||
import top.continew.admin.system.validation.ValidationGroup;
|
||||
import top.continew.starter.extension.crud.model.req.BaseReq;
|
||||
|
||||
import java.io.Serial;
|
||||
@@ -71,14 +71,14 @@ public class StorageReq extends BaseReq {
|
||||
*/
|
||||
@Schema(description = "访问密钥", example = "")
|
||||
@Length(max = 255, message = "访问密钥长度不能超过 {max} 个字符")
|
||||
@NotBlank(message = "访问密钥不能为空", groups = ValidateGroup.Storage.S3.class)
|
||||
@NotBlank(message = "访问密钥不能为空", groups = ValidationGroup.Storage.S3.class)
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
* 私有密钥
|
||||
*/
|
||||
@Schema(description = "私有密钥", example = "")
|
||||
@NotBlank(message = "私有密钥不能为空", groups = ValidateGroup.Storage.S3.class)
|
||||
@NotBlank(message = "私有密钥不能为空", groups = ValidationGroup.Storage.S3.class)
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
@@ -86,7 +86,7 @@ public class StorageReq extends BaseReq {
|
||||
*/
|
||||
@Schema(description = "终端节点", example = "")
|
||||
@Length(max = 255, message = "终端节点长度不能超过 {max} 个字符")
|
||||
@NotBlank(message = "终端节点不能为空", groups = ValidateGroup.Storage.S3.class)
|
||||
@NotBlank(message = "终端节点不能为空", groups = ValidationGroup.Storage.S3.class)
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
@@ -94,8 +94,8 @@ public class StorageReq extends BaseReq {
|
||||
*/
|
||||
@Schema(description = "桶名称", example = "C:/continew-admin/data/file/")
|
||||
@Length(max = 255, message = "桶名称长度不能超过 {max} 个字符")
|
||||
@NotBlank(message = "桶名称不能为空", groups = ValidateGroup.Storage.S3.class)
|
||||
@NotBlank(message = "存储路径不能为空", groups = ValidateGroup.Storage.Local.class)
|
||||
@NotBlank(message = "桶名称不能为空", groups = ValidationGroup.Storage.S3.class)
|
||||
@NotBlank(message = "存储路径不能为空", groups = ValidationGroup.Storage.Local.class)
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
|
@@ -25,7 +25,7 @@ import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import top.continew.admin.common.constant.RegexConstants;
|
||||
import top.continew.starter.extension.crud.model.req.BaseReq;
|
||||
import top.continew.starter.extension.crud.util.ValidateGroup;
|
||||
import top.continew.starter.extension.crud.validation.CrudValidationGroup;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -59,7 +59,7 @@ public class UserImportRowReq extends BaseReq {
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空", groups = ValidateGroup.Crud.Add.class)
|
||||
@NotBlank(message = "密码不能为空", groups = CrudValidationGroup.Add.class)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
|
@@ -28,7 +28,7 @@ import top.continew.admin.common.constant.RegexConstants;
|
||||
import top.continew.admin.common.enums.DisEnableStatusEnum;
|
||||
import top.continew.admin.common.enums.GenderEnum;
|
||||
import top.continew.starter.extension.crud.model.req.BaseReq;
|
||||
import top.continew.starter.extension.crud.util.ValidateGroup;
|
||||
import top.continew.starter.extension.crud.validation.CrudValidationGroup;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.List;
|
||||
@@ -66,7 +66,7 @@ public class UserReq extends BaseReq {
|
||||
* 密码(加密)
|
||||
*/
|
||||
@Schema(description = "密码(加密)", example = "E7c72TH+LDxKTwavjM99W1MdI9Lljh79aPKiv3XB9MXcplhm7qJ1BJCj28yaflbdVbfc366klMtjLIWQGqb0qw==")
|
||||
@NotBlank(message = "密码不能为空", groups = ValidateGroup.Crud.Add.class)
|
||||
@NotBlank(message = "密码不能为空", groups = CrudValidationGroup.Add.class)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
|
@@ -34,7 +34,7 @@ import top.continew.admin.system.service.UserService;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.data.core.enums.DatabaseType;
|
||||
import top.continew.starter.data.core.util.MetaUtils;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.util.ArrayList;
|
||||
|
@@ -35,7 +35,7 @@ import top.continew.starter.core.constant.StringConstants;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
@@ -27,7 +27,7 @@ import top.continew.admin.system.service.DictItemService;
|
||||
import top.continew.admin.system.service.DictService;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@@ -44,7 +44,7 @@ import top.continew.starter.core.constant.StringConstants;
|
||||
import top.continew.starter.core.util.StrUtils;
|
||||
import top.continew.starter.core.util.URLUtils;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
@@ -34,7 +34,7 @@ import top.continew.admin.system.service.MenuService;
|
||||
import top.continew.starter.cache.redisson.util.RedisUtils;
|
||||
import top.continew.starter.core.constant.StringConstants;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@@ -27,7 +27,7 @@ import top.continew.admin.system.model.resp.dashboard.DashboardNoticeResp;
|
||||
import top.continew.admin.system.model.resp.NoticeDetailResp;
|
||||
import top.continew.admin.system.model.resp.NoticeResp;
|
||||
import top.continew.admin.system.service.NoticeService;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -42,7 +42,7 @@ import top.continew.admin.system.model.resp.RoleDetailResp;
|
||||
import top.continew.admin.system.model.resp.RoleResp;
|
||||
import top.continew.admin.system.service.*;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
@@ -37,13 +37,13 @@ import top.continew.admin.system.model.req.StorageReq;
|
||||
import top.continew.admin.system.model.resp.StorageResp;
|
||||
import top.continew.admin.system.service.FileService;
|
||||
import top.continew.admin.system.service.StorageService;
|
||||
import top.continew.admin.system.util.ValidateGroup;
|
||||
import top.continew.admin.system.validation.ValidationGroup;
|
||||
import top.continew.starter.core.constant.StringConstants;
|
||||
import top.continew.starter.core.util.ExceptionUtils;
|
||||
import top.continew.starter.core.util.URLUtils;
|
||||
import top.continew.starter.core.validation.CheckUtils;
|
||||
import top.continew.starter.core.validation.ValidationUtils;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import top.continew.starter.web.util.SpringWebUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -129,7 +129,7 @@ public class StorageServiceImpl extends BaseServiceImpl<StorageMapper, StorageDO
|
||||
String bucketName = req.getBucketName();
|
||||
StorageTypeEnum type = req.getType();
|
||||
if (StorageTypeEnum.LOCAL.equals(type)) {
|
||||
ValidationUtils.validate(req, ValidateGroup.Storage.Local.class);
|
||||
ValidationUtils.validate(req, ValidationGroup.Storage.Local.class);
|
||||
req.setBucketName(StrUtil.appendIfMissing(bucketName
|
||||
.replace(StringConstants.BACKSLASH, StringConstants.SLASH), StringConstants.SLASH));
|
||||
FileStorageProperties.LocalPlusConfig config = new FileStorageProperties.LocalPlusConfig();
|
||||
@@ -139,7 +139,7 @@ public class StorageServiceImpl extends BaseServiceImpl<StorageMapper, StorageDO
|
||||
.singletonList(config)));
|
||||
SpringWebUtils.registerResourceHandler(MapUtil.of(URLUtil.url(req.getDomain()).getPath(), bucketName));
|
||||
} else if (StorageTypeEnum.S3.equals(type)) {
|
||||
ValidationUtils.validate(req, ValidateGroup.Storage.S3.class);
|
||||
ValidationUtils.validate(req, ValidationGroup.Storage.S3.class);
|
||||
FileStorageProperties.AmazonS3Config config = new FileStorageProperties.AmazonS3Config();
|
||||
config.setPlatform(req.getCode());
|
||||
config.setAccessKey(req.getAccessKey());
|
||||
|
@@ -82,7 +82,7 @@ import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||
import top.continew.starter.extension.crud.model.query.SortQuery;
|
||||
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||
import top.continew.starter.extension.crud.service.CommonUserService;
|
||||
import top.continew.starter.extension.crud.service.impl.BaseServiceImpl;
|
||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import top.continew.starter.web.util.FileUploadUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.continew.admin.system.util;
|
||||
package top.continew.admin.system.validation;
|
||||
|
||||
import jakarta.validation.groups.Default;
|
||||
|
||||
@@ -24,12 +24,12 @@ import jakarta.validation.groups.Default;
|
||||
* @author Charles7c
|
||||
* @since 2024/7/3 22:01
|
||||
*/
|
||||
public interface ValidateGroup extends Default {
|
||||
public interface ValidationGroup extends Default {
|
||||
|
||||
/**
|
||||
* 分组校验-增删改查
|
||||
*/
|
||||
interface Storage extends ValidateGroup {
|
||||
interface Storage extends ValidationGroup {
|
||||
/**
|
||||
* 本地存储
|
||||
*/
|
Reference in New Issue
Block a user