1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| # -*- coding: utf-8 -*-
| """
| @File : api_schema.py
| @Time : 2023/12/14 11:16
| @Author : geekbing
| @LastEditTime : -
| @LastEditors : -
| @Description : API数据模板
| """
|
| from typing import Dict, List, Optional
|
| from pydantic import BaseModel, Field
|
|
| class APIBody(BaseModel):
| name: str
| rig_id: int
| times: int
| request: Dict
| desc: Dict
| extract: Optional[List] = []
| check: List = Field([], alias="validate")
|
|
| class APISchema(BaseModel):
| name: str
| body: APIBody
| url: str
| method: str
| project_id: int
| relation: int
| creator_id: int
|
|