49 lines
744 B
Python
49 lines
744 B
Python
import time
|
|
from typing import List, Optional
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class ServiceBase(BaseModel):
|
|
name: str
|
|
owner_id: int
|
|
is_private: bool = True
|
|
description: Optional[str] = None
|
|
service_type: int
|
|
url: str
|
|
is_active: bool = True
|
|
|
|
class Service(BaseModel):
|
|
created_unix: float
|
|
updated_unix: float = None
|
|
|
|
class ServiceCreate(ServiceBase):
|
|
pass
|
|
|
|
class Service(ServiceBase):
|
|
pass
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
|
|
class UserBase(BaseModel):
|
|
name: str
|
|
full_name: Optional[str] = None
|
|
is_active: bool = True
|
|
|
|
class User(BaseModel):
|
|
created_unix: float
|
|
updated_unix: float = None
|
|
last_login_unix: float = None
|
|
|
|
class UserCreate(UserBase):
|
|
password: str
|
|
|
|
class User(UserBase):
|
|
pass
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|