This commit is contained in:
2025-10-01 21:37:43 +08:00
parent 818e614e37
commit 979403df06
22 changed files with 63 additions and 39 deletions

View File

@@ -104,7 +104,7 @@ public class AuthServiceImpl implements AuthService {
}
// 构建路由树
TreeField treeField = MenuResp.class.getDeclaredAnnotation(TreeField.class);
TreeNodeConfig treeNodeConfig = crudProperties.getTree().genTreeNodeConfig(treeField);
TreeNodeConfig treeNodeConfig = crudProperties.getTreeDictModel().genTreeNodeConfig(treeField);
List<Tree<Long>> treeList = TreeUtil.build(menuList, treeField.rootId(), treeNodeConfig, (m, tree) -> {
tree.setId(m.getId());
tree.setParentId(m.getParentId());

View File

@@ -35,6 +35,6 @@ import top.continew.starter.extension.crud.enums.Api;
@Tag(name = "部门管理 API")
@RestController
@CrudRequestMapping(value = "/system/dept", api = {Api.TREE, Api.GET, Api.CREATE, Api.UPDATE, Api.BATCH_DELETE,
Api.EXPORT, Api.DICT_TREE})
Api.EXPORT, Api.TREE_DICT})
public class DeptController extends BaseController<DeptService, DeptResp, DeptResp, DeptQuery, DeptReq> {
}

View File

@@ -50,7 +50,7 @@ import java.lang.reflect.Method;
@RestController
@RequiredArgsConstructor
@CrudRequestMapping(value = "/system/menu", api = {Api.TREE, Api.GET, Api.CREATE, Api.UPDATE, Api.BATCH_DELETE,
Api.DICT_TREE})
Api.TREE_DICT})
public class MenuController extends BaseController<MenuService, MenuResp, MenuResp, MenuQuery, MenuReq> {
@Operation(summary = "清除缓存", description = "清除缓存")

View File

@@ -26,7 +26,7 @@ import top.continew.admin.common.base.mapper.DataPermissionMapper;
import top.continew.admin.system.model.entity.user.UserDO;
import top.continew.admin.system.model.resp.user.UserDetailResp;
import top.continew.starter.extension.datapermission.annotation.DataPermission;
import top.continew.starter.security.crypto.annotation.FieldEncrypt;
import top.continew.starter.encrypt.field.annotation.FieldEncrypt;
import java.util.List;

View File

@@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import top.continew.admin.common.enums.DisEnableStatusEnum;
import top.continew.admin.common.base.model.entity.BaseDO;
import top.continew.starter.security.crypto.annotation.FieldEncrypt;
import top.continew.starter.encrypt.field.annotation.FieldEncrypt;
import java.io.Serial;

View File

@@ -26,7 +26,7 @@ import top.continew.admin.common.enums.DisEnableStatusEnum;
import top.continew.admin.common.base.model.entity.BaseDO;
import top.continew.admin.system.enums.StorageTypeEnum;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.security.crypto.annotation.FieldEncrypt;
import top.continew.starter.encrypt.field.annotation.FieldEncrypt;
import java.io.Serial;
import java.net.URL;

View File

@@ -23,9 +23,9 @@ import lombok.Data;
import top.continew.admin.common.base.model.entity.BaseDO;
import top.continew.admin.common.enums.DisEnableStatusEnum;
import top.continew.admin.common.enums.GenderEnum;
import top.continew.starter.encrypt.field.annotation.FieldEncrypt;
import top.continew.starter.encrypt.password.encoder.encryptor.PasswordEncoderEncryptor;
import top.continew.starter.extension.crud.annotation.DictModel;
import top.continew.starter.security.crypto.annotation.FieldEncrypt;
import top.continew.starter.security.crypto.enums.Algorithm;
import java.io.Serial;
import java.time.LocalDateTime;
@@ -57,7 +57,7 @@ public class UserDO extends BaseDO {
/**
* 密码
*/
@FieldEncrypt(Algorithm.PASSWORD_ENCODER)
@FieldEncrypt(encryptor = PasswordEncoderEncryptor.class)
private String password;
/**

View File

@@ -36,7 +36,7 @@ import top.continew.admin.system.model.resp.DeptResp;
import top.continew.admin.system.service.DeptService;
import top.continew.starter.excel.converter.ExcelBaseEnumConverter;
import top.continew.starter.excel.converter.ExcelListConverter;
import top.continew.starter.security.crypto.annotation.FieldEncrypt;
import top.continew.starter.encrypt.field.annotation.FieldEncrypt;
import java.io.Serial;
import java.time.LocalDateTime;

View File

@@ -290,7 +290,8 @@ public class FileServiceImpl extends BaseServiceImpl<FileMapper, FileDO, FileRes
return;
}
// user/avatar/ => user、avatar
String[] parentPathParts = StrUtil.split(parentPath, StringConstants.SLASH, false, true).toArray(String[]::new);
String[] parentPathParts = StrUtil.split(parentPath, StringConstants.SLASH, false, true)
.toArray(String[]::new);
String lastPath = StringConstants.SLASH;
StringBuilder currentPathBuilder = new StringBuilder();
for (int i = 0; i < parentPathParts.length; i++) {

View File

@@ -80,10 +80,10 @@ import top.continew.starter.core.exception.BusinessException;
import top.continew.starter.core.util.CollUtils;
import top.continew.starter.core.util.FileUploadUtils;
import top.continew.starter.core.util.validation.CheckUtils;
import top.continew.starter.encrypt.field.util.EncryptHelper;
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.security.crypto.util.EncryptHelper;
import java.io.IOException;
import java.time.Duration;