Fix return schema of the config api (#551)

This commit is contained in:
Wu Clan
2025-03-20 16:27:44 +08:00
committed by GitHub
parent 2be12b4ea4
commit 7f6c4ad6da
3 changed files with 10 additions and 9 deletions
+2 -5
View File
@@ -43,7 +43,7 @@ class CRUDConfig(CRUDPlus[Config]):
"""
return await self.select_model_by_column(db, key=key, type=type)
async def get_by_key(self, db: AsyncSession, key: str, built_in: bool = False) -> Config | None:
async def get_by_key(self, db: AsyncSession, key: str) -> Config | None:
"""
通过 key 获取系统配置参数
@@ -52,10 +52,7 @@ class CRUDConfig(CRUDPlus[Config]):
:param built_in:
:return:
"""
filters = {'key': key}
if not built_in:
filters.update({'type__not_in': admin_settings.CONFIG_BUILT_IN_TYPES})
return await self.select_model_by_column(db, **filters)
return await self.select_model_by_column(db, key=key)
async def get_list(self, name: str = None, type: str = None) -> Select:
"""