mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
refactor(api): 统一API路径常量并优化前端代码结构
feat(backend): 更新路由前缀和查询参数处理 style(backend): 调整导入顺序和清理无用导入 refactor(frontend): 重构工作台页面交互和样式 fix(frontend): 修复代码生成页面查询表单和表格展示
This commit is contained in:
@@ -19,7 +19,7 @@ from .schema import (
|
||||
)
|
||||
|
||||
|
||||
MyAppRouter = APIRouter(route_class=OperationLogRoute, prefix="/application", tags=["应用管理"])
|
||||
MyAppRouter = APIRouter(route_class=OperationLogRoute, prefix="/myapp", tags=["应用管理"])
|
||||
|
||||
@MyAppRouter.get("/detail/{id}", summary="获取应用详情", description="获取应用详情")
|
||||
async def get_obj_detail_controller(
|
||||
|
||||
@@ -13,17 +13,17 @@ class GenTableQueryParam:
|
||||
def __init__(
|
||||
self,
|
||||
table_name: Optional[str] = Query(None, description="表名称"),
|
||||
status: Optional[bool] = Query(None, description="是否启用"),
|
||||
table_comment: Optional[str] = Query(None, description="表注释"),
|
||||
creator: Optional[int] = Query(None, description="创建人"),
|
||||
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2023-01-01 00:00:00"),
|
||||
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2023-12-31 23:59:59"),
|
||||
) -> None:
|
||||
# 存储查询条件,不直接赋值给父类属性
|
||||
self.table_name = ("like", table_name)
|
||||
self.table_comment = ("like", table_comment)
|
||||
|
||||
# 精确查询字段
|
||||
self.creator_id = creator
|
||||
self.status = status
|
||||
|
||||
# 时间范围查询
|
||||
if start_time and end_time:
|
||||
@@ -38,7 +38,6 @@ class GenTableColumnQueryParam:
|
||||
def __init__(
|
||||
self,
|
||||
column_name: Optional[str] = Query(None, description="列名称"),
|
||||
status: Optional[bool] = Query(None, description="是否启用"),
|
||||
creator: Optional[int] = Query(None, description="创建人"),
|
||||
start_time: Optional[DateTimeStr] = Query(None, description="开始时间", example="2023-01-01 00:00:00"),
|
||||
end_time: Optional[DateTimeStr] = Query(None, description="结束时间", example="2023-12-31 23:59:59"),
|
||||
@@ -48,7 +47,6 @@ class GenTableColumnQueryParam:
|
||||
|
||||
# 精确查询字段
|
||||
self.creator_id = creator
|
||||
self.status = status
|
||||
|
||||
# 时间范围查询
|
||||
if start_time and end_time:
|
||||
|
||||
@@ -14,7 +14,6 @@ class GenTableCreateSchema(BaseModel):
|
||||
"""
|
||||
代码生成业务表对应pydantic模型
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
table_name: str = Field(default=..., description='表名称')
|
||||
@@ -80,7 +79,6 @@ class GenTableUpdateSchema(GenTableCreateSchema):
|
||||
"""
|
||||
代码生成业务表模型
|
||||
"""
|
||||
|
||||
pk_column: Optional['GenTableColumnUpdateSchema'] = Field(default=None, description='主键信息')
|
||||
sub_table: Optional['GenTableUpdateSchema'] = Field(default=None, description='子表信息')
|
||||
columns: List['GenTableColumnUpdateSchema'] = Field(default=..., description='表列信息')
|
||||
@@ -110,7 +108,6 @@ class GenTableDeleteSchema(BaseModel):
|
||||
"""
|
||||
删除代码生成业务表模型
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
table_ids: str = Field(description='需要删除的代码生成业务表ID')
|
||||
@@ -120,7 +117,6 @@ class GenTableColumnCreateSchema(BaseModel):
|
||||
"""
|
||||
代码生成业务表字段对应pydantic模型
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True)
|
||||
|
||||
table_id: Optional[int] = Field(default=None, description='归属表编号')
|
||||
@@ -199,7 +195,6 @@ class GenTableColumnDeleteSchema(BaseModel):
|
||||
"""
|
||||
删除代码生成业务表字段模型
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
column_ids: str = Field(description='需要删除的代码生成业务表字段ID')
|
||||
|
||||
Reference in New Issue
Block a user