mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-22 23:50:31 +00:00
Update apps.py
This commit is contained in:
parent
5f0d363894
commit
3879c2845a
1 changed files with 10 additions and 12 deletions
|
@ -3,22 +3,20 @@ from typing import Optional, List
|
|||
from fastapi import APIRouter, status, Depends
|
||||
from pydantic import BaseModel
|
||||
from starlette.responses import JSONResponse
|
||||
import os, io, sys, platform, shutil, time, subprocess, json, datetime
|
||||
|
||||
from api.model.generic import GenericMessage, GenericExceptionMessage
|
||||
from api.model.app import App
|
||||
from api.service import manage
|
||||
from api.utils import shell_execute
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("", responses={status.HTTP_200_OK: {"model": List[App]}})
|
||||
def list_my_apps(app_name: Optional[str] = None, status_code: Optional[int] = None,
|
||||
status: Optional[str] = None):
|
||||
fields = {}
|
||||
if app_name:
|
||||
fields['name'] = app_name
|
||||
if status_code:
|
||||
fields['status_code'] = status_code
|
||||
if status:
|
||||
fields['status'] = status
|
||||
@router.get("")
|
||||
def list_my_apps():
|
||||
list = manage.get_my_app()
|
||||
return JSONResponse(content=list)
|
||||
|
||||
return manage.get_my_app()
|
||||
@router.get("/start")
|
||||
def start_app(app_name: Optional[str] = None):
|
||||
|
||||
return {}
|
||||
|
|
Loading…
Reference in a new issue