Files
fastapi-best-architecture/backend/app/admin/schema/role.py
T
Wu Clan eb8dfda8fa Update CRUDBase to sqlalchemy-crud-plus (#317)
* Update CRUDBase to dependent package

* Update sqla crud plus to 0.0.2
2024-04-27 23:07:40 +08:00

40 lines
972 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import datetime
from pydantic import ConfigDict, Field
from backend.app.admin.schema.menu import GetMenuListDetails
from backend.common.enums import RoleDataScopeType, StatusType
from backend.common.schema import SchemaBase
class RoleSchemaBase(SchemaBase):
name: str
data_scope: RoleDataScopeType = Field(
default=RoleDataScopeType.custom, description='权限范围(1:全部数据权限 2:自定义数据权限)'
)
status: StatusType = Field(default=StatusType.enable)
remark: str | None = None
class CreateRoleParam(RoleSchemaBase):
pass
class UpdateRoleParam(RoleSchemaBase):
pass
class UpdateRoleMenuParam(SchemaBase):
menus: list[int]
class GetRoleListDetails(RoleSchemaBase):
model_config = ConfigDict(from_attributes=True)
id: int
created_time: datetime
updated_time: datetime | None = None
menus: list[GetMenuListDetails]