feat: вфыв
This commit is contained in:
14
services/role.py
Normal file
14
services/role.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from sqlalchemy import select
|
||||
|
||||
from models import Role
|
||||
from schemas.role import *
|
||||
from services.base import BaseService
|
||||
|
||||
|
||||
class RoleService(BaseService):
|
||||
async def get_all(self) -> GetAllRolesResponse:
|
||||
stmt = (select(Role).order_by(Role.key))
|
||||
roles = (await self.session.scalars(stmt)).all()
|
||||
return GetAllRolesResponse(
|
||||
roles=RoleSchema.from_orm_list(roles)
|
||||
)
|
||||
Reference in New Issue
Block a user