usermod/Schemas/AuthRuleSchemas.py

92 lines
1.6 KiB
Python

from enum import Enum
from pydantic import BaseModel
from typing import Union, List
class AuthRuleNodeTypeEnum(Enum):
rule = 'rule'
category = 'category'
class AuthRuleAddInfo(BaseModel):
name: str
category1: Union[None, str]
category2: Union[None, str]
class AuthRuleInfo(BaseModel):
id: int
name: str
category1: Union[None, str]
category2: Union[None, str]
class AuthRuleId(BaseModel):
id: int
class AuthRuleIdList(BaseModel):
id_list: int
class AuthRuleChangeInfo(BaseModel):
id: int
name: str
category1: Union[None, str]
category2: Union[None, str]
class AuthRuleQueryParams(BaseModel):
id: Union[int, None]
name: Union[str, None]
category1: Union[str, None]
category2: Union[str, None]
page_size: Union[int, None]
page: Union[int, None]
class AuthRuleConfigQueryParams(BaseModel):
id: Union[int, None]
name: Union[str, None]
page_size: Union[int, None]
page: Union[int, None]
class AuthRuleConfigAddInfo(BaseModel):
id: int
name: str
auth_data: str
class AuthRuleConfigInfo(BaseModel):
id: int
name: str
auth_data: str
class AuthRuleConfigInfoList(BaseModel):
data: List[AuthRuleConfigInfo]
class AuthRuleInfoList(BaseModel):
auth_rule_list: List[AuthRuleInfo]
count:int
class AuthCategoryAddInfo(BaseModel):
name: str
category_level: int
belong: Union[int, None]
class AuthCategoryChangeInfo(BaseModel):
id: int
name: str
category_level: int
belong: Union[int, None]
class AuthCategoryId(BaseModel):
id: str