mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-10-26 06:57:08 +08:00
refactor: 公告类型适配字典数据
1.新增 <dict-tag> 自定义组件,用于回显字典标签 2.重构 useDict 方法,支持查询字典数据 3.优化部分字典相关数据类型
This commit is contained in:
@@ -48,9 +48,7 @@ import top.charles7c.cnadmin.system.model.query.DeptQuery;
|
||||
import top.charles7c.cnadmin.system.model.query.MenuQuery;
|
||||
import top.charles7c.cnadmin.system.model.query.RoleQuery;
|
||||
import top.charles7c.cnadmin.system.model.vo.RoleVO;
|
||||
import top.charles7c.cnadmin.system.service.DeptService;
|
||||
import top.charles7c.cnadmin.system.service.MenuService;
|
||||
import top.charles7c.cnadmin.system.service.RoleService;
|
||||
import top.charles7c.cnadmin.system.service.*;
|
||||
|
||||
/**
|
||||
* 公共 API
|
||||
@@ -69,6 +67,7 @@ public class CommonController {
|
||||
private final DeptService deptService;
|
||||
private final MenuService menuService;
|
||||
private final RoleService roleService;
|
||||
private final DictItemService dictItemService;
|
||||
private final ProjectProperties projectProperties;
|
||||
|
||||
@Operation(summary = "查询部门树", description = "查询树结构的部门列表")
|
||||
@@ -113,4 +112,11 @@ public class CommonController {
|
||||
}).collect(Collectors.toList());
|
||||
return R.ok(labelValueVOList);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询字典", description = "查询字典列表")
|
||||
@Parameter(name = "code", description = "字典编码", example = "announcement_type", in = ParameterIn.PATH)
|
||||
@GetMapping("/dict/{code}")
|
||||
public R<List<LabelValueVO>> listDict(@PathVariable String code) {
|
||||
return R.ok(dictItemService.listByDictCode(code));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ CREATE TABLE IF NOT EXISTS `sys_announcement` (
|
||||
`id` bigint(20) UNSIGNED AUTO_INCREMENT COMMENT 'ID',
|
||||
`title` varchar(255) NOT NULL COMMENT '标题',
|
||||
`content` mediumtext NOT NULL COMMENT '内容',
|
||||
`type` tinyint(1) UNSIGNED DEFAULT 1 COMMENT '类型(1:活动,2:消息,3:通知)',
|
||||
`type` varchar(30) NOT NULL COMMENT '类型',
|
||||
`effective_time` datetime DEFAULT NULL COMMENT '生效时间',
|
||||
`terminate_time` datetime DEFAULT NULL COMMENT '终止时间',
|
||||
`sort` int(11) UNSIGNED DEFAULT 999 COMMENT '排序',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
CREATE TABLE IF NOT EXISTS `sys_dict` (
|
||||
`id` bigint(20) UNSIGNED AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(50) NOT NULL COMMENT '字典名称',
|
||||
`code` varchar(50) NOT NULL COMMENT '字典编码',
|
||||
`code` varchar(30) NOT NULL COMMENT '字典编码',
|
||||
`description` varchar(512) DEFAULT NULL COMMENT '描述',
|
||||
`create_user` bigint(20) UNSIGNED NOT NULL COMMENT '创建人',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `sys_dict` (
|
||||
CREATE TABLE IF NOT EXISTS `sys_dict_item` (
|
||||
`id` bigint(20) UNSIGNED AUTO_INCREMENT COMMENT 'ID',
|
||||
`label` varchar(50) NOT NULL COMMENT '字典标签',
|
||||
`value` varchar(50) NOT NULL COMMENT '字典值',
|
||||
`value` varchar(30) NOT NULL COMMENT '字典值',
|
||||
`color` varchar(30) DEFAULT NULL COMMENT '背景颜色',
|
||||
`sort` int(11) UNSIGNED DEFAULT 999 COMMENT '字典项排序',
|
||||
`description` varchar(512) DEFAULT NULL COMMENT '描述',
|
||||
|
||||
Reference in New Issue
Block a user