aswi2022bug-thugs-gitlab/server/sql_app/schemas.py @ aba60b70
1 |
from typing import List, Optional |
---|---|
2 |
|
3 |
from pydantic import BaseModel |
4 |
|
5 |
|
6 |
|
7 |
class USBLogBase(BaseModel): |
8 |
timestamp: str |
9 |
status: str |
10 |
|
11 |
|
12 |
class USBLogCreate(USBLogBase): |
13 |
pass
|
14 |
|
15 |
|
16 |
class USBLog(USBLogBase): |
17 |
id: int |
18 |
device_id: int |
19 |
|
20 |
class Config: |
21 |
orm_mode = True |
22 |
|
23 |
|
24 |
class DeviceBase(BaseModel): |
25 |
vendor_id: int |
26 |
product_id: int |
27 |
serial_number: str |
28 |
|
29 |
|
30 |
class DeviceCreate(DeviceBase): |
31 |
pass
|
32 |
|
33 |
|
34 |
class Device(DeviceBase): |
35 |
id: int |
36 |
logs: List[USBLog] = [] |
37 |
|
38 |
class Config: |
39 |
orm_mode = True |
40 |
|
41 |
|
42 |
class USBTempBase(BaseModel): |
43 |
username: str |
44 |
hostname: str |
45 |
timestamp: str |
46 |
device: DeviceBase |
47 |
status: str |
48 |
|
49 |
|
50 |
class USBTempCreate(USBTempBase): |
51 |
pass
|
52 |
|
53 |
|
54 |
class USBTemp(USBTempBase): |
55 |
id: int |
56 |
device_id: int |
57 |
|
58 |
class Config: |
59 |
orm_mode = True |
- « Předchozí
- 1
- …
- 4
- 5
- 6
- Další »