diff --git a/appmanage_new/src/schemas/appAvailable.py b/appmanage_new/src/schemas/appAvailable.py new file mode 100644 index 00000000..a1775a95 --- /dev/null +++ b/appmanage_new/src/schemas/appAvailable.py @@ -0,0 +1,18 @@ +from typing import Any, Dict, List,Optional +from pydantic import BaseModel, Field + +class AppAvailableResponse(BaseModel): + sys: Dict[str, str] = Field(..., description="System info",example={"id": "2KY3eyxKkWDp2ZDTS66aP4"}) + key: Optional[str] = Field(..., description="Key",example="wordpress") + hot: Optional[int] = Field(0, description="Hot",example=1000) + trademark: Optional[str] = Field(None, description="Trademark",example="WordPress") + summary: Optional[str] = Field(None, description="Summary",example="WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database.") + overview: Optional[str] = Field(None, description="Overview",example="WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database.") + websiteurl: Optional[str] = Field(None, description="Website URL",example="https://wordpress.org/") + screenshots: List[Dict[str, Any]] = Field(None, description="Screenshots",example=[{"id": "8248371f-a25f-4ae6-82be-7c6d8f7b9bb0","key": "gui start","value": "https://libs.websoft9.com/Websoft9/DocsPicture/zh/gogs/gogs-guistart-websoft9.png"}]) + distribution: List[Dict[str, Any]] = Field(None, description="Distribution",example=[{"id": "ff8ceafb-dd7f-4dfc-b523-f13edefa88a7","key": "Community", "value": "0.13"}]) + vcpu: Optional[int] = Field(None, description="VCPU",example=1) + memory: Optional[int] = Field(None, description="Memory(GB)",example=1) + storage: Optional[int] = Field(None, description="Storage(GB)",example=1) + logo: Dict[str, str] = Field(None, description="Logo",example={"imageurl": "https://libs.websoft9.com/Websoft9/logo/product/gogs-websoft9.png"}) + catalogCollection: Dict[str, Any] = Field(None, description="Catalog Collection", example={"items": [{"key": "repository", "title": "Code Repository","catalogCollection": {"items": [{"key": "itdeveloper", "title": "IT Developer"}]}}]}) \ No newline at end of file diff --git a/appmanage_new/src/schemas/appCatalog.py b/appmanage_new/src/schemas/appCatalog.py new file mode 100644 index 00000000..7c5c654c --- /dev/null +++ b/appmanage_new/src/schemas/appCatalog.py @@ -0,0 +1,8 @@ +from typing import Any, Dict, List,Optional +from pydantic import BaseModel, Field + +class AppCatalogResponse(BaseModel): + key: str=Field(..., description="Key",example="analytics") + position: Optional[int]=Field(0, description="Position",example=0) + title: Optional[str]=Field(None, description="Title",example="Data Analytics") + linkedFrom: Dict[str, Dict[str, Any]] = Field(..., description="Linked From",example={"items": [{"key": "itdeveloper","title": "IT Developer"}]}) diff --git a/appmanage_new/src/schemas/appResponse.py b/appmanage_new/src/schemas/appResponse.py new file mode 100644 index 00000000..cd40a4d3 --- /dev/null +++ b/appmanage_new/src/schemas/appResponse.py @@ -0,0 +1,20 @@ +from pydantic import BaseModel +from typing import List, Any +from pydantic import BaseModel, Field + +class AppResponse(BaseModel): + app_id: str=Field("", description="App ID",example="wordpress") + endpointId: int=Field(-1, description="Endpoint ID(-1:Not install on app store)",example=1) + app_name: str=Field("", description="App name",example="wordpress") + app_port: int=Field(0, description="App port",example=80) + app_dist: str=Field("", description="App dist",example="community") + app_version: str=Field("", description="App version",example="1.0.0") + app_official: bool=Field(True, description="App official",example=True) + proxy_enabled: bool=Field(False, description="Proxy enabled",example=False) + status: int=Field(0, description="App status(0:unknown,1:active,2:inactive)",example=0) + creationDate: int=Field(0, description="Creation date",example=0) + domain_names: List[dict]=Field([], description="Domain names") + env: List[str] = Field([], description="Environment variables") + gitConfig: dict[str, Any] = Field({}, description="Git configuration") + containers: List[dict] = Field([], description="Containers") + volumes: List[dict] = Field([], description="Volumes")