mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
refactor: 重构查询参数实现,替换旧的__init__初始化方式为dataclass+post_init
feat: 新增岗位编码字段与校验 fix: 修复批量删除提示、请求缓存、任务状态等逻辑 perf: 优化表格列展示,移除冗余ID列 build: 降级fastapi版本至0.115.2,更新依赖锁文件 docs: 补充部分代码注释与说明
This commit is contained in:
@@ -88,18 +88,14 @@ class DictTypeOutSchema(DictTypeCreateSchema, BaseSchema, UserBySchema, TenantBy
|
||||
class DictTypeQueryParam(BaseQueryParam, UserByQueryParam, TenantByQueryParam):
|
||||
"""字典类型查询参数"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
dict_name: str | None = Query(default=None, description="字典名称", max_length=100),
|
||||
dict_type: str | None = Query(default=None, description="字典类型", max_length=100),
|
||||
*args,
|
||||
**kwargs,
|
||||
) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
if dict_name:
|
||||
self.dict_name = (QueueEnum.like.value, dict_name)
|
||||
if dict_type:
|
||||
self.dict_type = (QueueEnum.eq.value, dict_type)
|
||||
dict_name: str | None = Query(default=None, description="字典名称", max_length=100)
|
||||
dict_type: str | None = Query(default=None, description="字典类型", max_length=100)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
if self.dict_name:
|
||||
self.dict_name = (QueueEnum.like.value, self.dict_name)
|
||||
if self.dict_type:
|
||||
self.dict_type = (QueueEnum.eq.value, self.dict_type)
|
||||
|
||||
|
||||
class DictDataCreateSchema(BaseModel):
|
||||
@@ -167,18 +163,14 @@ class DictDataOutSchema(DictDataCreateSchema, BaseSchema, UserBySchema, TenantBy
|
||||
class DictDataQueryParam(BaseQueryParam, UserByQueryParam, TenantByQueryParam):
|
||||
"""字典数据查询参数"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
dict_label: str | None = Query(default=None, description="字典标签", max_length=100),
|
||||
dict_type: str | None = Query(default=None, description="字典类型", max_length=100),
|
||||
dict_type_id: int | None = Query(default=None, description="字典类型ID"),
|
||||
*args,
|
||||
**kwargs,
|
||||
) -> None:
|
||||
super().__init__(*args, **kwargs)
|
||||
if dict_label:
|
||||
self.dict_label = (QueueEnum.like.value, dict_label)
|
||||
if dict_type:
|
||||
self.dict_type = (QueueEnum.eq.value, dict_type)
|
||||
if dict_type_id is not None:
|
||||
self.dict_type_id = (QueueEnum.eq.value, dict_type_id)
|
||||
dict_label: str | None = Query(default=None, description="字典标签", max_length=100)
|
||||
dict_type: str | None = Query(default=None, description="字典类型", max_length=100)
|
||||
dict_type_id: int | None = Query(default=None, description="字典类型ID")
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
if self.dict_label:
|
||||
self.dict_label = (QueueEnum.like.value, self.dict_label)
|
||||
if self.dict_type:
|
||||
self.dict_type = (QueueEnum.eq.value, self.dict_type)
|
||||
if self.dict_type_id is not None:
|
||||
self.dict_type_id = (QueueEnum.eq.value, self.dict_type_id)
|
||||
|
||||
Reference in New Issue
Block a user