mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 13:12:24 +00:00
Update the dict pagination query parameters (#689)
* Update the dict pagination query parameters * Update the dict pagination query parameters * Update version
This commit is contained in:
@@ -14,7 +14,6 @@ from backend.plugin.dict.schema.dict_data import (
|
|||||||
CreateDictDataParam,
|
CreateDictDataParam,
|
||||||
DeleteDictDataParam,
|
DeleteDictDataParam,
|
||||||
GetDictDataDetail,
|
GetDictDataDetail,
|
||||||
GetDictDataWithRelation,
|
|
||||||
UpdateDictDataParam,
|
UpdateDictDataParam,
|
||||||
)
|
)
|
||||||
from backend.plugin.dict.service.dict_data_service import dict_data_service
|
from backend.plugin.dict.service.dict_data_service import dict_data_service
|
||||||
@@ -31,7 +30,7 @@ async def get_all_dict_datas() -> ResponseSchemaModel[list[GetDictDataDetail]]:
|
|||||||
@router.get('/{pk}', summary='获取字典数据详情', dependencies=[DependsJwtAuth])
|
@router.get('/{pk}', summary='获取字典数据详情', dependencies=[DependsJwtAuth])
|
||||||
async def get_dict_data(
|
async def get_dict_data(
|
||||||
pk: Annotated[int, Path(description='字典数据 ID')],
|
pk: Annotated[int, Path(description='字典数据 ID')],
|
||||||
) -> ResponseSchemaModel[GetDictDataWithRelation]:
|
) -> ResponseSchemaModel[GetDictDataDetail]:
|
||||||
data = await dict_data_service.get(pk=pk)
|
data = await dict_data_service.get(pk=pk)
|
||||||
return response_base.success(data=data)
|
return response_base.success(data=data)
|
||||||
|
|
||||||
@@ -46,11 +45,15 @@ async def get_dict_data(
|
|||||||
)
|
)
|
||||||
async def get_dict_datas_paged(
|
async def get_dict_datas_paged(
|
||||||
db: CurrentSession,
|
db: CurrentSession,
|
||||||
|
type_code: Annotated[str | None, Query(description='字典类型编码')] = None,
|
||||||
label: Annotated[str | None, Query(description='字典数据标签')] = None,
|
label: Annotated[str | None, Query(description='字典数据标签')] = None,
|
||||||
value: Annotated[str | None, Query(description='字典数据键值')] = None,
|
value: Annotated[str | None, Query(description='字典数据键值')] = None,
|
||||||
status: Annotated[int | None, Query(description='状态')] = None,
|
status: Annotated[int | None, Query(description='状态')] = None,
|
||||||
|
type_id: Annotated[int | None, Query(description='字典类型 ID')] = None,
|
||||||
) -> ResponseSchemaModel[PageData[GetDictDataDetail]]:
|
) -> ResponseSchemaModel[PageData[GetDictDataDetail]]:
|
||||||
dict_data_select = await dict_data_service.get_select(label=label, value=value, status=status)
|
dict_data_select = await dict_data_service.get_select(
|
||||||
|
type_code=type_code, label=label, value=value, status=status, type_id=type_id
|
||||||
|
)
|
||||||
page_data = await paging_data(db, dict_data_select)
|
page_data = await paging_data(db, dict_data_select)
|
||||||
return response_base.success(data=page_data)
|
return response_base.success(data=page_data)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class CRUDDictData(CRUDPlus[DictData]):
|
|||||||
:param pk: 字典数据 ID
|
:param pk: 字典数据 ID
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
return await self.select_model(db, pk)
|
return await self.select_model(db, pk, load_strategies={'type': 'noload'})
|
||||||
|
|
||||||
async def get_all(self, db: AsyncSession) -> Sequence[DictData]:
|
async def get_all(self, db: AsyncSession) -> Sequence[DictData]:
|
||||||
"""
|
"""
|
||||||
@@ -32,23 +32,31 @@ class CRUDDictData(CRUDPlus[DictData]):
|
|||||||
"""
|
"""
|
||||||
return await self.select_models(db, load_strategies={'type': 'noload'})
|
return await self.select_models(db, load_strategies={'type': 'noload'})
|
||||||
|
|
||||||
async def get_list(self, label: str | None, value: str | None, status: int | None) -> Select:
|
async def get_list(
|
||||||
|
self, type_code: str | None, label: str | None, value: str | None, status: int | None, type_id: int | None
|
||||||
|
) -> Select:
|
||||||
"""
|
"""
|
||||||
获取字典数据列表
|
获取字典数据列表
|
||||||
|
|
||||||
|
:param type_code: 字典类型编码
|
||||||
:param label: 字典数据标签
|
:param label: 字典数据标签
|
||||||
:param value: 字典数据键值
|
:param value: 字典数据键值
|
||||||
:param status: 字典状态
|
:param status: 字典状态
|
||||||
|
:param type_id: 字典类型 ID
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
filters = {}
|
filters = {}
|
||||||
|
|
||||||
|
if type_code is not None:
|
||||||
|
filters['type_code'] = type_code
|
||||||
if label is not None:
|
if label is not None:
|
||||||
filters['label__like'] = f'%{label}%'
|
filters['label__like'] = f'%{label}%'
|
||||||
if value is not None:
|
if value is not None:
|
||||||
filters['value__like'] = f'%{value}%'
|
filters['value__like'] = f'%{value}%'
|
||||||
if status is not None:
|
if status is not None:
|
||||||
filters['status'] = status
|
filters['status'] = status
|
||||||
|
if type_id is not None:
|
||||||
|
filters['type_id'] = type_id
|
||||||
|
|
||||||
return await self.select_order('id', 'desc', load_strategies={'type': 'noload'}, **filters)
|
return await self.select_order('id', 'desc', load_strategies={'type': 'noload'}, **filters)
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class DictData(Base):
|
|||||||
__tablename__ = 'sys_dict_data'
|
__tablename__ = 'sys_dict_data'
|
||||||
|
|
||||||
id: Mapped[id_key] = mapped_column(init=False)
|
id: Mapped[id_key] = mapped_column(init=False)
|
||||||
|
type_code: Mapped[str] = mapped_column(String(32), comment='对应的字典类型编码')
|
||||||
label: Mapped[str] = mapped_column(String(32), comment='字典标签')
|
label: Mapped[str] = mapped_column(String(32), comment='字典标签')
|
||||||
value: Mapped[str] = mapped_column(String(32), comment='字典值')
|
value: Mapped[str] = mapped_column(String(32), comment='字典值')
|
||||||
sort: Mapped[int] = mapped_column(default=0, comment='排序')
|
sort: Mapped[int] = mapped_column(default=0, comment='排序')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[plugin]
|
[plugin]
|
||||||
summary = '数据字典'
|
summary = '数据字典'
|
||||||
version = '0.0.3'
|
version = '0.0.4'
|
||||||
description = '通常用于约束前端工程数据展示'
|
description = '通常用于约束前端工程数据展示'
|
||||||
author = 'wu-clan'
|
author = 'wu-clan'
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ from pydantic import ConfigDict, Field
|
|||||||
|
|
||||||
from backend.common.enums import StatusType
|
from backend.common.enums import StatusType
|
||||||
from backend.common.schema import SchemaBase
|
from backend.common.schema import SchemaBase
|
||||||
from backend.plugin.dict.schema.dict_type import GetDictTypeDetail
|
|
||||||
|
|
||||||
|
|
||||||
class DictDataSchemaBase(SchemaBase):
|
class DictDataSchemaBase(SchemaBase):
|
||||||
"""字典数据基础模型"""
|
"""字典数据基础模型"""
|
||||||
|
|
||||||
type_id: int = Field(description='字典类型 ID')
|
type_id: int = Field(description='字典类型 ID')
|
||||||
|
type_code: str = Field(description='字典类型编码')
|
||||||
label: str = Field(description='字典标签')
|
label: str = Field(description='字典标签')
|
||||||
value: str = Field(description='字典值')
|
value: str = Field(description='字典值')
|
||||||
sort: int = Field(description='排序')
|
sort: int = Field(description='排序')
|
||||||
@@ -42,9 +42,3 @@ class GetDictDataDetail(DictDataSchemaBase):
|
|||||||
id: int = Field(description='字典数据 ID')
|
id: int = Field(description='字典数据 ID')
|
||||||
created_time: datetime = Field(description='创建时间')
|
created_time: datetime = Field(description='创建时间')
|
||||||
updated_time: datetime | None = Field(None, description='更新时间')
|
updated_time: datetime | None = Field(None, description='更新时间')
|
||||||
|
|
||||||
|
|
||||||
class GetDictDataWithRelation(DictDataSchemaBase):
|
|
||||||
"""字典数据关联详情"""
|
|
||||||
|
|
||||||
type: GetDictTypeDetail | None = Field(None, description='字典类型信息')
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class DictDataService:
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
async with async_db_session() as db:
|
async with async_db_session() as db:
|
||||||
dict_data = await dict_data_dao.get_with_relation(db, pk)
|
dict_data = await dict_data_dao.get(db, pk)
|
||||||
if not dict_data:
|
if not dict_data:
|
||||||
raise errors.NotFoundError(msg='字典数据不存在')
|
raise errors.NotFoundError(msg='字典数据不存在')
|
||||||
return dict_data
|
return dict_data
|
||||||
@@ -36,16 +36,22 @@ class DictDataService:
|
|||||||
return dict_datas
|
return dict_datas
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def get_select(*, label: str | None, value: str | None, status: int | None) -> Select:
|
async def get_select(
|
||||||
|
*, type_code: str | None, label: str | None, value: str | None, status: int | None, type_id: int | None
|
||||||
|
) -> Select:
|
||||||
"""
|
"""
|
||||||
获取字典数据列表查询条件
|
获取字典数据列表查询条件
|
||||||
|
|
||||||
|
:param type_code: 字典类型编码
|
||||||
:param label: 字典数据标签
|
:param label: 字典数据标签
|
||||||
:param value: 字典数据键值
|
:param value: 字典数据键值
|
||||||
:param status: 状态
|
:param status: 状态
|
||||||
|
:param type_id: 字典类型 ID
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
return await dict_data_dao.get_list(label=label, value=value, status=status)
|
return await dict_data_dao.get_list(
|
||||||
|
type_code=type_code, label=label, value=value, status=status, type_id=type_id
|
||||||
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def create(*, obj: CreateDictDataParam) -> None:
|
async def create(*, obj: CreateDictDataParam) -> None:
|
||||||
|
|||||||
@@ -10,32 +10,32 @@ values
|
|||||||
(2048602512755392512, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
(2048602512755392512, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
||||||
(2048602512818307072, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
(2048602512818307072, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
||||||
|
|
||||||
insert into sys_dict_data (id, label, value, sort, status, remark, type_id, created_time, updated_time)
|
insert into sys_dict_data (id, type_code, label, value, sort, status, remark, type_id, created_time, updated_time)
|
||||||
values
|
values
|
||||||
(2048602512881221632, '停用', 0, 1, 1, '系统停用状态', 2048602512340156416, now(), null),
|
(2048602512881221632, 'sys_status', '停用', '0', 1, 1, '系统停用状态', 2048602512340156416, now(), null),
|
||||||
(2048602512948330496, '正常', 1, 2, 1, '系统正常状态', 2048602512340156416, now(), null),
|
(2048602512948330496, 'sys_status', '正常', '1', 2, 1, '系统正常状态', 2048602512340156416, now(), null),
|
||||||
(2048602513015439360, '目录', 0, 1, 1, '菜单目录类型', 2048602512369516544, now(), null),
|
(2048602513015439360, 'sys_menu_type', '目录', '0', 1, 1, '菜单目录类型', 2048602512369516544, now(), null),
|
||||||
(2048602513078353920, '菜单', 1, 2, 1, '普通菜单类型', 2048602512369516544, now(), null),
|
(2048602513078353920, 'sys_menu_type', '菜单', '1', 2, 1, '普通菜单类型', 2048602512369516544, now(), null),
|
||||||
(2048602513128685568, '按钮', 2, 3, 1, '按钮权限类型', 2048602512369516544, now(), null),
|
(2048602513128685568, 'sys_menu_type', '按钮', '2', 3, 1, '按钮权限类型', 2048602512369516544, now(), null),
|
||||||
(2048602513174822912, '内嵌', 3, 4, 1, '内嵌页面类型', 2048602512369516544, now(), null),
|
(2048602513174822912, 'sys_menu_type', '内嵌', '3', 4, 1, '内嵌页面类型', 2048602512369516544, now(), null),
|
||||||
(2048602513241931776, '外链', 4, 5, 1, '外部链接类型', 2048602512369516544, now(), null),
|
(2048602513241931776, 'sys_menu_type', '外链', '4', 5, 1, '外部链接类型', 2048602512369516544, now(), null),
|
||||||
(2048602513292263424, '失败', 0, 1, 1, '登录失败状态', 2048602512432431104, now(), null),
|
(2048602513292263424, 'sys_login_status', '失败', '0', 1, 1, '登录失败状态', 2048602512432431104, now(), null),
|
||||||
(2048602513359372288, '成功', 1, 2, 1, '登录成功状态', 2048602512432431104, now(), null),
|
(2048602513359372288, 'sys_login_status', '成功', '1', 2, 1, '登录成功状态', 2048602512432431104, now(), null),
|
||||||
(2048602513422286848, 'AND', 0, 1, 1, '逻辑与运算符', 2048602512495345664, now(), null),
|
(2048602513422286848, 'sys_data_rule_operator', 'AND', '0', 1, 1, '逻辑与运算符', 2048602512495345664, now(), null),
|
||||||
(2048602513476812800, 'OR', 1, 2, 1, '逻辑或运算符', 2048602512495345664, now(), null),
|
(2048602513476812800, 'sys_data_rule_operator', 'OR', '1', 2, 1, '逻辑或运算符', 2048602512495345664, now(), null),
|
||||||
(2048602513543921664, '等于(==)', 0, 1, 1, '等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513543921664, 'sys_data_rule_expression', '等于(==)', '0', 1, 1, '等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513590059008, '不等于(!=)', 1, 2, 1, '不等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513590059008, 'sys_data_rule_expression', '不等于(!=)', '1', 2, 1, '不等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513657167872, '大于(>)', 2, 3, 1, '大于比较表达式', 2048602512549871616, now(), null),
|
(2048602513657167872, 'sys_data_rule_expression', '大于(>)', '2', 3, 1, '大于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513720082432, '大于等于(>=)', 3, 4, 1, '大于等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513720082432, 'sys_data_rule_expression', '大于等于(>=)', '3', 4, 1, '大于等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513782996992, '小于(<)', 4, 5, 1, '小于比较表达式', 2048602512549871616, now(), null),
|
(2048602513782996992, 'sys_data_rule_expression', '小于(<)', '4', 5, 1, '小于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513850105856, '小于等于(<=)', 5, 6, 1, '小于等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513850105856, 'sys_data_rule_expression', '小于等于(<=)', '5', 6, 1, '小于等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513917214720, '包含(in)', 6, 7, 1, '包含表达式', 2048602512549871616, now(), null),
|
(2048602513917214720, 'sys_data_rule_expression', '包含(in)', '6', 7, 1, '包含表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513984323584, '不包含(not in)', 7, 8, 1, '不包含表达式', 2048602512549871616, now(), null),
|
(2048602513984323584, 'sys_data_rule_expression', '不包含(not in)', '7', 8, 1, '不包含表达式', 2048602512549871616, now(), null),
|
||||||
(2048602514051432448, '否', 0, 1, 1, '不是前端参数配置', 2048602512616980480, now(), null),
|
(2048602514051432448, 'sys_frontend_config', '否', '0', 1, 1, '不是前端参数配置', 2048602512616980480, now(), null),
|
||||||
(2048602514118541312, '是', 1, 2, 1, '是前端参数配置', 2048602512616980480, now(), null),
|
(2048602514118541312, 'sys_frontend_config', '是', '1', 2, 1, '是前端参数配置', 2048602512616980480, now(), null),
|
||||||
(2048602514168872960, '否', 0, 1, 1, '不进行数据权限过滤', 2048602512692477952, now(), null),
|
(2048602514168872960, 'sys_data_permission', '否', '0', 1, 1, '不进行数据权限过滤', 2048602512692477952, now(), null),
|
||||||
(2048602514231787520, '是', 1, 2, 1, '进行数据权限过滤', 2048602512692477952, now(), null),
|
(2048602514231787520, 'sys_data_permission', '是', '1', 2, 1, '进行数据权限过滤', 2048602512692477952, now(), null),
|
||||||
(2048602514303090688, '隐藏', 0, 1, 1, '菜单隐藏', 2048602512755392512, now(), null),
|
(2048602514303090688, 'sys_menu_display', '隐藏', '0', 1, 1, '菜单隐藏', 2048602512755392512, now(), null),
|
||||||
(2048602514366005248, '显示', 1, 2, 1, '菜单显示', 2048602512755392512, now(), null),
|
(2048602514366005248, 'sys_menu_display', '显示', '1', 2, 1, '菜单显示', 2048602512755392512, now(), null),
|
||||||
(2048602514433114112, '不缓存', 0, 1, 1, '菜单不缓存', 2048602512818307072, now(), null),
|
(2048602514433114112, 'sys_menu_cache', '不缓存', '0', 1, 1, '菜单不缓存', 2048602512818307072, now(), null),
|
||||||
(2048602514500222976, '缓存', 1, 2, 1, '菜单缓存', 2048602512818307072, now(), null);
|
(2048602514500222976, 'sys_menu_cache', '缓存', '1', 2, 1, '菜单缓存', 2048602512818307072, now(), null);
|
||||||
|
|||||||
@@ -10,32 +10,32 @@ values
|
|||||||
(8, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
(8, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
||||||
(9, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
(9, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
||||||
|
|
||||||
insert into sys_dict_data (id, label, value, sort, status, remark, type_id, created_time, updated_time)
|
insert into sys_dict_data (id, type_code, label, value, sort, status, remark, type_id, created_time, updated_time)
|
||||||
values
|
values
|
||||||
(1, '停用', 0, 1, 1, '系统停用状态', 1, now(), null),
|
(1, 'sys_status', '停用', '0', 1, 1, '系统停用状态', 1, now(), null),
|
||||||
(2, '正常', 1, 2, 1, '系统正常状态', 1, now(), null),
|
(2, 'sys_status', '正常', '1', 2, 1, '系统正常状态', 1, now(), null),
|
||||||
(3, '目录', 0, 1, 1, '菜单目录类型', 2, now(), null),
|
(3, 'sys_menu_type', '目录', '0', 1, 1, '菜单目录类型', 2, now(), null),
|
||||||
(4, '菜单', 1, 2, 1, '普通菜单类型', 2, now(), null),
|
(4, 'sys_menu_type', '菜单', '1', 2, 1, '普通菜单类型', 2, now(), null),
|
||||||
(5, '按钮', 2, 3, 1, '按钮权限类型', 2, now(), null),
|
(5, 'sys_menu_type', '按钮', '2', 3, 1, '按钮权限类型', 2, now(), null),
|
||||||
(6, '内嵌', 3, 4, 1, '内嵌页面类型', 2, now(), null),
|
(6, 'sys_menu_type', '内嵌', '3', 4, 1, '内嵌页面类型', 2, now(), null),
|
||||||
(7, '外链', 4, 5, 1, '外部链接类型', 2, now(), null),
|
(7, 'sys_menu_type', '外链', '4', 5, 1, '外部链接类型', 2, now(), null),
|
||||||
(8, '失败', 0, 1, 1, '登录失败状态', 3, now(), null),
|
(8, 'sys_login_status', '失败', '0', 1, 1, '登录失败状态', 3, now(), null),
|
||||||
(9, '成功', 1, 2, 1, '登录成功状态', 3, now(), null),
|
(9, 'sys_login_status', '成功', '1', 2, 1, '登录成功状态', 3, now(), null),
|
||||||
(10, 'AND', 0, 1, 1, '逻辑与运算符', 4, now(), null),
|
(10, 'sys_data_rule_operator', 'AND', '0', 1, 1, '逻辑与运算符', 4, now(), null),
|
||||||
(11, 'OR', 1, 2, 1, '逻辑或运算符', 4, now(), null),
|
(11, 'sys_data_rule_operator', 'OR', '1', 2, 1, '逻辑或运算符', 4, now(), null),
|
||||||
(12, '等于(==)', 0, 1, 1, '等于比较表达式', 5, now(), null),
|
(12, 'sys_data_rule_expression', '等于(==)', '0', 1, 1, '等于比较表达式', 5, now(), null),
|
||||||
(13, '不等于(!=)', 1, 2, 1, '不等于比较表达式', 5, now(), null),
|
(13, 'sys_data_rule_expression', '不等于(!=)', '1', 2, 1, '不等于比较表达式', 5, now(), null),
|
||||||
(14, '大于(>)', 2, 3, 1, '大于比较表达式', 5, now(), null),
|
(14, 'sys_data_rule_expression', '大于(>)', '2', 3, 1, '大于比较表达式', 5, now(), null),
|
||||||
(15, '大于等于(>=)', 3, 4, 1, '大于等于比较表达式', 5, now(), null),
|
(15, 'sys_data_rule_expression', '大于等于(>=)', '3', 4, 1, '大于等于比较表达式', 5, now(), null),
|
||||||
(16, '小于(<)', 4, 5, 1, '小于比较表达式', 5, now(), null),
|
(16, 'sys_data_rule_expression', '小于(<)', '4', 5, 1, '小于比较表达式', 5, now(), null),
|
||||||
(17, '小于等于(<=)', 5, 6, 1, '小于等于比较表达式', 5, now(), null),
|
(17, 'sys_data_rule_expression', '小于等于(<=)', '5', 6, 1, '小于等于比较表达式', 5, now(), null),
|
||||||
(18, '包含(in)', 6, 7, 1, '包含表达式', 5, now(), null),
|
(18, 'sys_data_rule_expression', '包含(in)', '6', 7, 1, '包含表达式', 5, now(), null),
|
||||||
(19, '不包含(not in)', 7, 8, 1, '不包含表达式', 5, now(), null),
|
(19, 'sys_data_rule_expression', '不包含(not in)', '7', 8, 1, '不包含表达式', 5, now(), null),
|
||||||
(20, '否', 0, 1, 1, '不是前端参数配置', 6, now(), null),
|
(20, 'sys_frontend_config', '否', '0', 1, 1, '不是前端参数配置', 6, now(), null),
|
||||||
(21, '是', 1, 2, 1, '是前端参数配置', 6, now(), null),
|
(21, 'sys_frontend_config', '是', '1', 2, 1, '是前端参数配置', 6, now(), null),
|
||||||
(22, '否', 0, 1, 1, '不进行数据权限过滤', 7, now(), null),
|
(22, 'sys_data_permission', '否', '0', 1, 1, '不进行数据权限过滤', 7, now(), null),
|
||||||
(23, '是', 1, 2, 1, '进行数据权限过滤', 7, now(), null),
|
(23, 'sys_data_permission', '是', '1', 2, 1, '进行数据权限过滤', 7, now(), null),
|
||||||
(24, '隐藏', 0, 1, 1, '菜单隐藏', 8, now(), null),
|
(24, 'sys_menu_display', '隐藏', '0', 1, 1, '菜单隐藏', 8, now(), null),
|
||||||
(25, '显示', 1, 2, 1, '菜单显示', 8, now(), null),
|
(25, 'sys_menu_display', '显示', '1', 2, 1, '菜单显示', 8, now(), null),
|
||||||
(26, '不缓存', 0, 1, 1, '菜单不缓存', 9, now(), null),
|
(26, 'sys_menu_cache', '不缓存', '0', 1, 1, '菜单不缓存', 9, now(), null),
|
||||||
(27, '缓存', 1, 2, 1, '菜单缓存', 9, now(), null);
|
(27, 'sys_menu_cache', '缓存', '1', 2, 1, '菜单缓存', 9, now(), null);
|
||||||
|
|||||||
@@ -10,32 +10,32 @@ values
|
|||||||
(2048602512755392512, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
(2048602512755392512, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
||||||
(2048602512818307072, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
(2048602512818307072, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
||||||
|
|
||||||
insert into sys_dict_data (id, label, value, sort, status, remark, type_id, created_time, updated_time)
|
insert into sys_dict_data (id, type_code, label, value, sort, status, remark, type_id, created_time, updated_time)
|
||||||
values
|
values
|
||||||
(2048602512881221632, '停用', 0, 1, 1, '系统停用状态', 2048602512340156416, now(), null),
|
(2048602512881221632, 'sys_status', '停用', '0', 1, 1, '系统停用状态', 2048602512340156416, now(), null),
|
||||||
(2048602512948330496, '正常', 1, 2, 1, '系统正常状态', 2048602512340156416, now(), null),
|
(2048602512948330496, 'sys_status', '正常', '1', 2, 1, '系统正常状态', 2048602512340156416, now(), null),
|
||||||
(2048602513015439360, '目录', 0, 1, 1, '菜单目录类型', 2048602512369516544, now(), null),
|
(2048602513015439360, 'sys_menu_type', '目录', '0', 1, 1, '菜单目录类型', 2048602512369516544, now(), null),
|
||||||
(2048602513078353920, '菜单', 1, 2, 1, '普通菜单类型', 2048602512369516544, now(), null),
|
(2048602513078353920, 'sys_menu_type', '菜单', '1', 2, 1, '普通菜单类型', 2048602512369516544, now(), null),
|
||||||
(2048602513128685568, '按钮', 2, 3, 1, '按钮权限类型', 2048602512369516544, now(), null),
|
(2048602513128685568, 'sys_menu_type', '按钮', '2', 3, 1, '按钮权限类型', 2048602512369516544, now(), null),
|
||||||
(2048602513174822912, '内嵌', 3, 4, 1, '内嵌页面类型', 2048602512369516544, now(), null),
|
(2048602513174822912, 'sys_menu_type', '内嵌', '3', 4, 1, '内嵌页面类型', 2048602512369516544, now(), null),
|
||||||
(2048602513241931776, '外链', 4, 5, 1, '外部链接类型', 2048602512369516544, now(), null),
|
(2048602513241931776, 'sys_menu_type', '外链', '4', 5, 1, '外部链接类型', 2048602512369516544, now(), null),
|
||||||
(2048602513292263424, '失败', 0, 1, 1, '登录失败状态', 2048602512432431104, now(), null),
|
(2048602513292263424, 'sys_login_status', '失败', '0', 1, 1, '登录失败状态', 2048602512432431104, now(), null),
|
||||||
(2048602513359372288, '成功', 1, 2, 1, '登录成功状态', 2048602512432431104, now(), null),
|
(2048602513359372288, 'sys_login_status', '成功', '1', 2, 1, '登录成功状态', 2048602512432431104, now(), null),
|
||||||
(2048602513422286848, 'AND', 0, 1, 1, '逻辑与运算符', 2048602512495345664, now(), null),
|
(2048602513422286848, 'sys_data_rule_operator', 'AND', '0', 1, 1, '逻辑与运算符', 2048602512495345664, now(), null),
|
||||||
(2048602513476812800, 'OR', 1, 2, 1, '逻辑或运算符', 2048602512495345664, now(), null),
|
(2048602513476812800, 'sys_data_rule_operator', 'OR', '1', 2, 1, '逻辑或运算符', 2048602512495345664, now(), null),
|
||||||
(2048602513543921664, '等于(==)', 0, 1, 1, '等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513543921664, 'sys_data_rule_expression', '等于(==)', '0', 1, 1, '等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513590059008, '不等于(!=)', 1, 2, 1, '不等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513590059008, 'sys_data_rule_expression', '不等于(!=)', '1', 2, 1, '不等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513657167872, '大于(>)', 2, 3, 1, '大于比较表达式', 2048602512549871616, now(), null),
|
(2048602513657167872, 'sys_data_rule_expression', '大于(>)', '2', 3, 1, '大于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513720082432, '大于等于(>=)', 3, 4, 1, '大于等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513720082432, 'sys_data_rule_expression', '大于等于(>=)', '3', 4, 1, '大于等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513782996992, '小于(<)', 4, 5, 1, '小于比较表达式', 2048602512549871616, now(), null),
|
(2048602513782996992, 'sys_data_rule_expression', '小于(<)', '4', 5, 1, '小于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513850105856, '小于等于(<=)', 5, 6, 1, '小于等于比较表达式', 2048602512549871616, now(), null),
|
(2048602513850105856, 'sys_data_rule_expression', '小于等于(<=)', '5', 6, 1, '小于等于比较表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513917214720, '包含(in)', 6, 7, 1, '包含表达式', 2048602512549871616, now(), null),
|
(2048602513917214720, 'sys_data_rule_expression', '包含(in)', '6', 7, 1, '包含表达式', 2048602512549871616, now(), null),
|
||||||
(2048602513984323584, '不包含(not in)', 7, 8, 1, '不包含表达式', 2048602512549871616, now(), null),
|
(2048602513984323584, 'sys_data_rule_expression', '不包含(not in)', '7', 8, 1, '不包含表达式', 2048602512549871616, now(), null),
|
||||||
(2048602514051432448, '否', 0, 1, 1, '不是前端参数配置', 2048602512616980480, now(), null),
|
(2048602514051432448, 'sys_frontend_config', '否', '0', 1, 1, '不是前端参数配置', 2048602512616980480, now(), null),
|
||||||
(2048602514118541312, '是', 1, 2, 1, '是前端参数配置', 2048602512616980480, now(), null),
|
(2048602514118541312, 'sys_frontend_config', '是', '1', 2, 1, '是前端参数配置', 2048602512616980480, now(), null),
|
||||||
(2048602514168872960, '否', 0, 1, 1, '不进行数据权限过滤', 2048602512692477952, now(), null),
|
(2048602514168872960, 'sys_data_permission', '否', '0', 1, 1, '不进行数据权限过滤', 2048602512692477952, now(), null),
|
||||||
(2048602514231787520, '是', 1, 2, 1, '进行数据权限过滤', 2048602512692477952, now(), null),
|
(2048602514231787520, 'sys_data_permission', '是', '1', 2, 1, '进行数据权限过滤', 2048602512692477952, now(), null),
|
||||||
(2048602514303090688, '隐藏', 0, 1, 1, '菜单隐藏', 2048602512755392512, now(), null),
|
(2048602514303090688, 'sys_menu_display', '隐藏', '0', 1, 1, '菜单隐藏', 2048602512755392512, now(), null),
|
||||||
(2048602514366005248, '显示', 1, 2, 1, '菜单显示', 2048602512755392512, now(), null),
|
(2048602514366005248, 'sys_menu_display', '显示', '1', 2, 1, '菜单显示', 2048602512755392512, now(), null),
|
||||||
(2048602514433114112, '不缓存', 0, 1, 1, '菜单不缓存', 2048602512818307072, now(), null),
|
(2048602514433114112, 'sys_menu_cache', '不缓存', '0', 1, 1, '菜单不缓存', 2048602512818307072, now(), null),
|
||||||
(2048602514500222976, '缓存', 1, 2, 1, '菜单缓存', 2048602512818307072, now(), null);
|
(2048602514500222976, 'sys_menu_cache', '缓存', '1', 2, 1, '菜单缓存', 2048602512818307072, now(), null);
|
||||||
|
|||||||
@@ -10,35 +10,35 @@ values
|
|||||||
(8, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
(8, '菜单显示', 'sys_menu_display', 1, '菜单是否显示', now(), null),
|
||||||
(9, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
(9, '菜单缓存', 'sys_menu_cache', 1, '菜单是否缓存', now(), null);
|
||||||
|
|
||||||
insert into sys_dict_data (id, label, value, sort, status, remark, type_id, created_time, updated_time)
|
insert into sys_dict_data (id, type_code, label, value, sort, status, remark, type_id, created_time, updated_time)
|
||||||
values
|
values
|
||||||
(1, '停用', 0, 1, 1, '系统停用状态', 1, now(), null),
|
(1, 'sys_status', '停用', '0', 1, 1, '系统停用状态', 1, now(), null),
|
||||||
(2, '正常', 1, 2, 1, '系统正常状态', 1, now(), null),
|
(2, 'sys_status', '正常', '1', 2, 1, '系统正常状态', 1, now(), null),
|
||||||
(3, '目录', 0, 1, 1, '菜单目录类型', 2, now(), null),
|
(3, 'sys_menu_type', '目录', '0', 1, 1, '菜单目录类型', 2, now(), null),
|
||||||
(4, '菜单', 1, 2, 1, '普通菜单类型', 2, now(), null),
|
(4, 'sys_menu_type', '菜单', '1', 2, 1, '普通菜单类型', 2, now(), null),
|
||||||
(5, '按钮', 2, 3, 1, '按钮权限类型', 2, now(), null),
|
(5, 'sys_menu_type', '按钮', '2', 3, 1, '按钮权限类型', 2, now(), null),
|
||||||
(6, '内嵌', 3, 4, 1, '内嵌页面类型', 2, now(), null),
|
(6, 'sys_menu_type', '内嵌', '3', 4, 1, '内嵌页面类型', 2, now(), null),
|
||||||
(7, '外链', 4, 5, 1, '外部链接类型', 2, now(), null),
|
(7, 'sys_menu_type', '外链', '4', 5, 1, '外部链接类型', 2, now(), null),
|
||||||
(8, '失败', 0, 1, 1, '登录失败状态', 3, now(), null),
|
(8, 'sys_login_status', '失败', '0', 1, 1, '登录失败状态', 3, now(), null),
|
||||||
(9, '成功', 1, 2, 1, '登录成功状态', 3, now(), null),
|
(9, 'sys_login_status', '成功', '1', 2, 1, '登录成功状态', 3, now(), null),
|
||||||
(10, 'AND', 0, 1, 1, '逻辑与运算符', 4, now(), null),
|
(10, 'sys_data_rule_operator', 'AND', '0', 1, 1, '逻辑与运算符', 4, now(), null),
|
||||||
(11, 'OR', 1, 2, 1, '逻辑或运算符', 4, now(), null),
|
(11, 'sys_data_rule_operator', 'OR', '1', 2, 1, '逻辑或运算符', 4, now(), null),
|
||||||
(12, '等于(==)', 0, 1, 1, '等于比较表达式', 5, now(), null),
|
(12, 'sys_data_rule_expression', '等于(==)', '0', 1, 1, '等于比较表达式', 5, now(), null),
|
||||||
(13, '不等于(!=)', 1, 2, 1, '不等于比较表达式', 5, now(), null),
|
(13, 'sys_data_rule_expression', '不等于(!=)', '1', 2, 1, '不等于比较表达式', 5, now(), null),
|
||||||
(14, '大于(>)', 2, 3, 1, '大于比较表达式', 5, now(), null),
|
(14, 'sys_data_rule_expression', '大于(>)', '2', 3, 1, '大于比较表达式', 5, now(), null),
|
||||||
(15, '大于等于(>=)', 3, 4, 1, '大于等于比较表达式', 5, now(), null),
|
(15, 'sys_data_rule_expression', '大于等于(>=)', '3', 4, 1, '大于等于比较表达式', 5, now(), null),
|
||||||
(16, '小于(<)', 4, 5, 1, '小于比较表达式', 5, now(), null),
|
(16, 'sys_data_rule_expression', '小于(<)', '4', 5, 1, '小于比较表达式', 5, now(), null),
|
||||||
(17, '小于等于(<=)', 5, 6, 1, '小于等于比较表达式', 5, now(), null),
|
(17, 'sys_data_rule_expression', '小于等于(<=)', '5', 6, 1, '小于等于比较表达式', 5, now(), null),
|
||||||
(18, '包含(in)', 6, 7, 1, '包含表达式', 5, now(), null),
|
(18, 'sys_data_rule_expression', '包含(in)', '6', 7, 1, '包含表达式', 5, now(), null),
|
||||||
(19, '不包含(not in)', 7, 8, 1, '不包含表达式', 5, now(), null),
|
(19, 'sys_data_rule_expression', '不包含(not in)', '7', 8, 1, '不包含表达式', 5, now(), null),
|
||||||
(20, '否', 0, 1, 1, '不是前端参数配置', 6, now(), null),
|
(20, 'sys_frontend_config', '否', '0', 1, 1, '不是前端参数配置', 6, now(), null),
|
||||||
(21, '是', 1, 2, 1, '是前端参数配置', 6, now(), null),
|
(21, 'sys_frontend_config', '是', '1', 2, 1, '是前端参数配置', 6, now(), null),
|
||||||
(22, '否', 0, 1, 1, '不进行数据权限过滤', 7, now(), null),
|
(22, 'sys_data_permission', '否', '0', 1, 1, '不进行数据权限过滤', 7, now(), null),
|
||||||
(23, '是', 1, 2, 1, '进行数据权限过滤', 7, now(), null),
|
(23, 'sys_data_permission', '是', '1', 2, 1, '进行数据权限过滤', 7, now(), null),
|
||||||
(24, '隐藏', 0, 1, 1, '菜单隐藏', 8, now(), null),
|
(24, 'sys_menu_display', '隐藏', '0', 1, 1, '菜单隐藏', 8, now(), null),
|
||||||
(25, '显示', 1, 2, 1, '菜单显示', 8, now(), null),
|
(25, 'sys_menu_display', '显示', '1', 2, 1, '菜单显示', 8, now(), null),
|
||||||
(26, '不缓存', 0, 1, 1, '菜单不缓存', 9, now(), null),
|
(26, 'sys_menu_cache', '不缓存', '0', 1, 1, '菜单不缓存', 9, now(), null),
|
||||||
(27, '缓存', 1, 2, 1, '菜单缓存', 9, now(), null);
|
(27, 'sys_menu_cache', '缓存', '1', 2, 1, '菜单缓存', 9, now(), null);
|
||||||
|
|
||||||
-- reset auto-increment values for each table based on max id
|
-- reset auto-increment values for each table based on max id
|
||||||
select setval(pg_get_serial_sequence('sys_dict_type', 'id'),coalesce(max(id), 0) + 1, true) from sys_dict_type;
|
select setval(pg_get_serial_sequence('sys_dict_type', 'id'),coalesce(max(id), 0) + 1, true) from sys_dict_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user