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

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 = "系统配置表"