#!/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