Add dictionary type and datas queries (#679)

This commit is contained in:
Wu Clan
2025-06-23 10:58:55 +08:00
committed by GitHub
parent 408c866dda
commit f9bfe8f510
7 changed files with 51 additions and 3 deletions
@@ -1,5 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import Sequence
from sqlalchemy import Select
from backend.common.exception import errors
@@ -27,6 +29,12 @@ class DictDataService:
raise errors.NotFoundError(msg='字典数据不存在')
return dict_data
@staticmethod
async def get_all() -> Sequence[DictData]:
async with async_db_session() as db:
dict_datas = await dict_data_dao.get_all(db)
return dict_datas
@staticmethod
async def get_select(*, label: str | None, value: str | None, status: int | None) -> Select:
"""