1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- from typing import Optional, List
- from pydantic.main import BaseModel
- from schemas.base import ListMixin, DetailMixin
- class SysModuleItem(BaseModel):
- id: int
- name: str
- pid: int
- level: int
- class Config:
- orm_mode = True
- class SysModuleList(ListMixin):
- data: Optional[List[SysModuleItem]] = []
- class CreateSysModule(BaseModel):
- name: str
- pid: int
- level: int
- creator: Optional[int] = None
- class UpdateSysModule(BaseModel):
- name: Optional[str] = None
- pid: Optional[int] = None
- level: Optional[int] = None
- editor: Optional[int] = None
- class SysModuleDetail(DetailMixin):
- data: Optional[SysModuleItem] = None
- class SysApiItem(BaseModel):
- id: int
- name: str
- path: str
- method: str
- is_active: bool
- class Config:
- orm_mode = True
- class SysApiItemList(ListMixin):
- data: Optional[List[SysApiItem]] = []
- class SysApiItemDetail(DetailMixin):
- data: Optional[SysApiItem] = None
- class CreateSysApi(BaseModel):
- name: str
- path: str
- method: str
- module_id: int
- creator: Optional[int] = None
- class UpdateSysApi(BaseModel):
- name: Optional[str] = None
- module_id: Optional[int] = None
- editor: Optional[int] = None
- class DeleteSysApi(BaseModel):
- id: int
- is_active: bool = False
- editor: int
|