feat: 添加系统配置,更新验证码接口

This commit is contained in:
2025-02-12 23:25:19 +08:00
parent 46e9e79670
commit 2f28d6d5e0
15 changed files with 362 additions and 35 deletions

View File

@@ -6,13 +6,14 @@
# @Software : PyCharm
# @Comment : 本程序
from models.config import Config
from models.department import Department, DepartmentRole
from models.file import File
from models.i18n import I18n, Locale
from models.log import LoginLog, OperationLog
from models.permission import Permission
from models.role import Role, RolePermission
from models.user import User, UserRole
from models.i18n import I18n,Locale
__all__ = [
'Department',
@@ -26,5 +27,6 @@ __all__ = [
'User',
'UserRole',
'I18n',
'Locale'
'Locale',
'Config'
]

70
models/config.py Normal file
View File

@@ -0,0 +1,70 @@
# _*_ coding : UTF-8 _*_
# @Time : 2025/02/12 16:43
# @UpdateTime : 2025/02/12 16:43
# @Author : sonder
# @File : config.py
# @Software : PyCharm
# @Comment : 本程序
from tortoise import fields
from models.common import BaseModel
class Config(BaseModel):
"""
系统配置模型
"""
name = fields.CharField(
max_length=100,
description="配置名称",
source_field="name"
)
"""
配置名称。
- 最大长度为 100 个字符
- 映射到数据库字段 name
"""
key = fields.CharField(
max_length=100,
description="配置键名",
source_field="key"
)
"""
配置键名。
- 最大长度为 100 个字符
- 映射到数据库字段 key
"""
value = fields.CharField(
max_length=100,
description="配置值",
source_field="value"
)
"""
配置值。
- 最大长度为 100 个字符
- 映射到数据库字段 value
"""
type = fields.BooleanField(
default=False,
description="系统内置",
source_field="type"
)
"""
是否为系统内置
- 默认为不是
"""
remark = fields.TextField(
null=True,
description="备注",
source_field="remark"
)
"""
备注信息。
- 最大长度为 255 个字符
- 可为空
"""
class Meta:
table = "sys_config"
table_description = "系统配置表"

View File

@@ -54,7 +54,7 @@ class Role(BaseModel):
- 映射到数据库字段 role_description。
"""
status=fields.SmallIntField(
status = fields.SmallIntField(
default=1,
description="角色状态",
source_field="status"