You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.1 KiB
53 lines
1.1 KiB
|
2 months ago
|
"""
|
||
|
|
配置相关Schema
|
||
|
|
"""
|
||
|
|
from datetime import datetime
|
||
|
|
from typing import Optional
|
||
|
|
from pydantic import BaseModel, Field
|
||
|
|
|
||
|
|
|
||
|
|
class SDKConfigBase(BaseModel):
|
||
|
|
"""SDK配置基础"""
|
||
|
|
name: str
|
||
|
|
username: str
|
||
|
|
host: str
|
||
|
|
port: int = 8080
|
||
|
|
local_path: str = "./amazing_data_cache/"
|
||
|
|
is_active: bool = True
|
||
|
|
is_default: bool = False
|
||
|
|
description: Optional[str] = None
|
||
|
|
|
||
|
|
|
||
|
|
class SDKConfigCreate(SDKConfigBase):
|
||
|
|
"""创建SDK配置"""
|
||
|
|
password: str
|
||
|
|
|
||
|
|
|
||
|
|
class SDKConfigUpdate(BaseModel):
|
||
|
|
"""更新SDK配置"""
|
||
|
|
name: Optional[str] = None
|
||
|
|
username: Optional[str] = None
|
||
|
|
password: Optional[str] = None
|
||
|
|
host: Optional[str] = None
|
||
|
|
port: Optional[int] = None
|
||
|
|
local_path: Optional[str] = None
|
||
|
|
is_active: Optional[bool] = None
|
||
|
|
is_default: Optional[bool] = None
|
||
|
|
description: Optional[str] = None
|
||
|
|
|
||
|
|
|
||
|
|
class SDKConfigResponse(SDKConfigBase):
|
||
|
|
"""SDK配置响应"""
|
||
|
|
id: int
|
||
|
|
created_at: datetime
|
||
|
|
updated_at: datetime
|
||
|
|
|
||
|
|
class Config:
|
||
|
|
from_attributes = True
|
||
|
|
|
||
|
|
|
||
|
|
class SDKConfigTestResponse(BaseModel):
|
||
|
|
"""SDK配置测试响应"""
|
||
|
|
success: bool
|
||
|
|
message: str
|