Skip to content

Delete the default value of schema enum data #723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/app/admin/schema/data_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class DataRuleSchemaBase(SchemaBase):
name: str = Field(description='规则名称')
model: str = Field(description='模型名称')
column: str = Field(description='字段名称')
operator: RoleDataRuleOperatorType = Field(RoleDataRuleOperatorType.AND, description='操作符(AND/OR)')
expression: RoleDataRuleExpressionType = Field(RoleDataRuleExpressionType.eq, description='表达式类型')
operator: RoleDataRuleOperatorType = Field(description='操作符(AND/OR)')
expression: RoleDataRuleExpressionType = Field(description='表达式类型')
value: str = Field(description='规则值')


Expand Down
2 changes: 1 addition & 1 deletion backend/app/admin/schema/data_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DataScopeBase(SchemaBase):
"""数据范围基础模型"""

name: str = Field(description='名称')
status: StatusType = Field(StatusType.enable, description='状态')
status: StatusType = Field(description='状态')


class CreateDataScopeParam(DataScopeBase):
Expand Down
2 changes: 1 addition & 1 deletion backend/app/admin/schema/dept.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DeptSchemaBase(SchemaBase):
leader: str | None = Field(None, description='负责人')
phone: CustomPhoneNumber | None = Field(None, description='联系电话')
email: CustomEmailStr | None = Field(None, description='邮箱')
status: StatusType = Field(StatusType.enable, description='状态')
status: StatusType = Field(description='状态')


class CreateDeptParam(DeptSchemaBase):
Expand Down
8 changes: 4 additions & 4 deletions backend/app/admin/schema/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class MenuSchemaBase(SchemaBase):
parent_id: int | None = Field(None, description='菜单父级 ID')
sort: int = Field(0, ge=0, description='排序')
icon: str | None = Field(None, description='图标')
type: MenuType = Field(MenuType.directory, description='菜单类型(0目录 1菜单 2按钮 3内嵌 4外链)')
type: MenuType = Field(description='菜单类型(0目录 1菜单 2按钮 3内嵌 4外链)')
component: str | None = Field(None, description='组件路径')
perms: str | None = Field(None, description='权限标识')
status: StatusType = Field(StatusType.enable, description='状态')
display: StatusType = Field(StatusType.enable, description='是否显示')
cache: StatusType = Field(StatusType.enable, description='是否缓存')
status: StatusType = Field(description='状态')
display: StatusType = Field(description='是否显示')
cache: StatusType = Field(description='是否缓存')
link: str | None = Field(None, description='外链地址')
remark: str | None = Field(None, description='备注')

Expand Down
2 changes: 1 addition & 1 deletion backend/app/admin/schema/opera_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OperaLogSchemaBase(SchemaBase):
browser: str | None = Field(None, description='浏览器')
device: str | None = Field(None, description='设备')
args: dict[str, Any] | None = Field(None, description='请求参数')
status: StatusType = Field(StatusType.enable, description='状态')
status: StatusType = Field(description='状态')
code: str = Field(description='状态码')
msg: str | None = Field(None, description='消息')
cost_time: float = Field(description='耗时')
Expand Down
2 changes: 1 addition & 1 deletion backend/app/admin/schema/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RoleSchemaBase(SchemaBase):
"""角色基础模型"""

name: str = Field(description='角色名称')
status: StatusType = Field(StatusType.enable, description='状态')
status: StatusType = Field(description='状态')
is_filter_scopes: bool = Field(True, description='过滤数据权限')
remark: str | None = Field(None, description='备注')

Expand Down
2 changes: 1 addition & 1 deletion backend/app/admin/schema/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class GetUserInfoDetail(UserInfoSchemaBase):
uuid: str = Field(description='用户 UUID')
email: CustomEmailStr | None = Field(None, description='邮箱')
phone: CustomPhoneNumber | None = Field(None, description='手机号')
status: StatusType = Field(StatusType.enable, description='状态')
status: StatusType = Field(description='状态')
is_superuser: bool = Field(description='是否超级管理员')
is_staff: bool = Field(description='是否管理员')
is_multi_login: bool = Field(description='是否允许多端登录')
Expand Down
2 changes: 1 addition & 1 deletion backend/app/task/schema/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TaskSchedulerSchemeBase(SchemaBase):
start_time: datetime | None = Field(default=None, description='任务开始触发的时间')
expire_time: datetime | None = Field(default=None, description='任务不再触发的截止时间')
expire_seconds: int | None = Field(default=None, description='任务不再触发的秒数时间差')
type: TaskSchedulerType = Field(default=TaskSchedulerType.INTERVAL, description='任务调度类型(0间隔 1定时)')
type: TaskSchedulerType = Field(description='任务调度类型(0间隔 1定时)')
interval_every: int | None = Field(default=None, description='任务再次运行前的间隔周期数')
interval_period: PeriodType | None = Field(default=None, description='任务运行之间的周期类型')
crontab: str = Field(default='* * * * *', description='运行的 Crontab 表达式')
Expand Down
2 changes: 1 addition & 1 deletion backend/plugin/dict/schema/dict_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DictDataSchemaBase(SchemaBase):
label: str = Field(description='字典标签')
value: str = Field(description='字典值')
sort: int = Field(description='排序')
status: StatusType = Field(StatusType.enable, description='状态')
status: StatusType = Field(description='状态')
remark: str | None = Field(None, description='备注')


Expand Down
2 changes: 1 addition & 1 deletion backend/plugin/dict/schema/dict_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DictTypeSchemaBase(SchemaBase):

name: str = Field(description='字典名称')
code: str = Field(description='字典编码')
status: StatusType = Field(StatusType.enable, description='状态')
status: StatusType = Field(description='状态')
remark: str | None = Field(None, description='备注')


Expand Down
2 changes: 1 addition & 1 deletion backend/plugin/notice/schema/notice.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NoticeSchemaBase(SchemaBase):
type: int = Field(description='类型(0:通知、1:公告)')
author: str = Field(description='作者')
source: str = Field(description='信息来源')
status: StatusType = Field(StatusType.enable, description='状态(0:隐藏、1:显示)')
status: StatusType = Field(description='状态(0:隐藏、1:显示)')
content: str = Field(description='内容')


Expand Down
4 changes: 2 additions & 2 deletions backend/plugin/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ async def get_plugin_sql(plugin: str, db_type: DataBaseType, pk_type: PrimaryKey
:param pk_type: 主键类型
:return:
"""
if db_type == DataBaseType.mysql.value:
if db_type == DataBaseType.mysql:
mysql_dir = os.path.join(PLUGIN_DIR, plugin, 'sql', 'mysql')
if pk_type == PrimaryKeyType.autoincrement:
sql_file = os.path.join(mysql_dir, 'init.sql')
else:
sql_file = os.path.join(mysql_dir, 'init_snowflake.sql')
else:
postgresql_dir = os.path.join(PLUGIN_DIR, plugin, 'sql', 'postgresql')
if pk_type == PrimaryKeyType.autoincrement.value:
if pk_type == PrimaryKeyType.autoincrement:
sql_file = os.path.join(postgresql_dir, 'init.sql')
else:
sql_file = os.path.join(postgresql_dir, 'init_snowflake.sql')
Expand Down