39 lines
654 B
Python
39 lines
654 B
Python
from datetime import datetime
|
|
from enum import Enum
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class AuthorityBase(BaseModel):
|
|
project_id: int = None
|
|
dashboard_id: int = None
|
|
authority: str = None
|
|
space_id: str = None
|
|
folder_id: str = None
|
|
|
|
|
|
class AuthorityCreate(AuthorityBase):
|
|
project_id: int
|
|
authority: str
|
|
|
|
|
|
|
|
class AuthorityUpdate(AuthorityBase):
|
|
pass
|
|
|
|
|
|
class AuthorityEnum(str, Enum):
|
|
write = 'rw'
|
|
read = 'r'
|
|
|
|
|
|
class Authority(AuthorityBase):
|
|
id = int
|
|
user_id = int
|
|
project_id = int
|
|
dashboard_id = int
|
|
authority = AuthorityEnum
|
|
create_date = datetime
|
|
|
|
class Config:
|
|
orm_mode = True
|