feat: 新增查询用户字典接口

This commit is contained in:
2024-11-07 22:23:22 +08:00
parent e1941eca45
commit d4b02ba918
2 changed files with 10 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ import lombok.Data;
import top.continew.admin.common.config.mybatis.BCryptEncryptor; import top.continew.admin.common.config.mybatis.BCryptEncryptor;
import top.continew.admin.common.enums.DisEnableStatusEnum; import top.continew.admin.common.enums.DisEnableStatusEnum;
import top.continew.admin.common.enums.GenderEnum; import top.continew.admin.common.enums.GenderEnum;
import top.continew.starter.extension.crud.annotation.DictField;
import top.continew.starter.extension.crud.model.entity.BaseDO; import top.continew.starter.extension.crud.model.entity.BaseDO;
import top.continew.starter.security.crypto.annotation.FieldEncrypt; import top.continew.starter.security.crypto.annotation.FieldEncrypt;
@@ -36,6 +37,7 @@ import java.time.LocalDateTime;
* @since 2022/12/21 20:42 * @since 2022/12/21 20:42
*/ */
@Data @Data
@DictField(labelKey = "nickname")
@TableName("sys_user") @TableName("sys_user")
public class UserDO extends BaseDO { public class UserDO extends BaseDO {

View File

@@ -32,10 +32,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import top.continew.admin.common.constant.CacheConstants; import top.continew.admin.common.constant.CacheConstants;
import top.continew.admin.system.model.query.DeptQuery; import top.continew.admin.system.model.query.*;
import top.continew.admin.system.model.query.MenuQuery;
import top.continew.admin.system.model.query.OptionQuery;
import top.continew.admin.system.model.query.RoleQuery;
import top.continew.admin.system.model.resp.FileUploadResp; import top.continew.admin.system.model.resp.FileUploadResp;
import top.continew.admin.system.service.*; import top.continew.admin.system.service.*;
import top.continew.starter.core.util.validate.ValidationUtils; import top.continew.starter.core.util.validate.ValidationUtils;
@@ -62,6 +59,7 @@ public class CommonController {
private final FileService fileService; private final FileService fileService;
private final DeptService deptService; private final DeptService deptService;
private final MenuService menuService; private final MenuService menuService;
private final UserService userService;
private final RoleService roleService; private final RoleService roleService;
private final DictItemService dictItemService; private final DictItemService dictItemService;
private final OptionService optionService; private final OptionService optionService;
@@ -92,6 +90,12 @@ public class CommonController {
return menuService.tree(query, sortQuery, true); return menuService.tree(query, sortQuery, true);
} }
@Operation(summary = "查询用户字典", description = "查询用户字典列表")
@GetMapping("/dict/user")
public List<LabelValueResp> listUserDict(UserQuery query, SortQuery sortQuery) {
return userService.listDict(query, sortQuery);
}
@Operation(summary = "查询角色字典", description = "查询角色字典列表") @Operation(summary = "查询角色字典", description = "查询角色字典列表")
@GetMapping("/dict/role") @GetMapping("/dict/role")
public List<LabelValueResp> listRoleDict(RoleQuery query, SortQuery sortQuery) { public List<LabelValueResp> listRoleDict(RoleQuery query, SortQuery sortQuery) {