mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
refactor: 重构项目模块结构与代码细节优化
1. 调整后端模块路由与插件文件结构,迁移部分模块代码至api/v1目录 2. 优化代码注释格式与文档字符串,简化冗余代码 3. 添加监控仪表盘、工单评论等新模块功能 4. 修复前端部分组件交互逻辑与类型定义 5. 清理冗余的初始化数据与废弃配置文件 6. 新增租户注册表单字段与国际化支持 7. 优化HTTP请求拦截器与快捷键功能
This commit is contained in:
@@ -7,8 +7,7 @@ from app.core.base_schema import BaseQueryParam, BaseSchema, TenantByQueryParam,
|
||||
|
||||
|
||||
class ParamsCreateSchema(BaseModel):
|
||||
"""
|
||||
参数创建模型
|
||||
"""参数创建模型
|
||||
"""
|
||||
|
||||
config_name: str = Field(..., min_length=1, max_length=64, description="参数名称")
|
||||
@@ -37,42 +36,33 @@ class ParamsCreateSchema(BaseModel):
|
||||
|
||||
|
||||
class ParamsUpdateSchema(ParamsCreateSchema):
|
||||
"""
|
||||
参数更新模型
|
||||
"""参数更新模型
|
||||
"""
|
||||
|
||||
|
||||
class ParamsOutSchema(ParamsCreateSchema, BaseSchema, UserBySchema, TenantBySchema):
|
||||
"""
|
||||
参数响应模型
|
||||
"""参数响应模型
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class ParamsQueryParam(BaseQueryParam, UserByQueryParam, TenantByQueryParam):
|
||||
"""
|
||||
参数管理查询参数
|
||||
|
||||
支持:
|
||||
- 时间范围(BaseQueryParam)
|
||||
- 创建人/更新人筛选(UserByQueryParam)
|
||||
- 租户筛选(TenantByQueryParam)
|
||||
- 业务字段:参数名称、参数键名、是否系统内置
|
||||
"""参数管理查询参数
|
||||
"""
|
||||
|
||||
config_name: str | None = Field(None, description="参数名称")
|
||||
config_key: str | None = Field(None, description="参数键名")
|
||||
config_type: bool | None = Field(None, description="是否系统内置(True:是 False:否)")
|
||||
status: int | None = Field(None, ge=0, le=1, description="状态(0:启动 1:停用)")
|
||||
config_name: str | tuple[str, str] | None = Field(None, description="参数名称")
|
||||
config_key: str | tuple[str, str] | None = Field(None, description="参数键名")
|
||||
config_type: bool | tuple[str, bool] | None = Field(None, description="是否系统内置(True:是 False:否)")
|
||||
status: int | tuple[str, int] | None = Field(None, ge=0, le=1, description="状态(0:启动 1:停用)")
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_query_params(self) -> "ParamsQueryParam":
|
||||
if self.config_name:
|
||||
if isinstance(self.config_name, str):
|
||||
self.config_name = (QueueEnum.like.value, self.config_name)
|
||||
if self.config_key:
|
||||
if isinstance(self.config_key, str):
|
||||
self.config_key = (QueueEnum.like.value, self.config_key)
|
||||
if self.config_type is not None:
|
||||
if isinstance(self.config_type, bool):
|
||||
self.config_type = (QueueEnum.eq.value, self.config_type)
|
||||
if isinstance(self.status, int):
|
||||
self.status = (QueueEnum.eq.value, self.status)
|
||||
|
||||
Reference in New Issue
Block a user