2023-02-21 14:21:53 +08:00
|
|
|
from typing import Optional, List
|
|
|
|
|
|
|
|
from fastapi import APIRouter, status, Depends
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from starlette.responses import JSONResponse
|
2023-02-22 17:19:27 +08:00
|
|
|
import os, io, sys, platform, shutil, time, subprocess, json, datetime
|
2023-02-21 14:21:53 +08:00
|
|
|
|
|
|
|
from api.model.app import App
|
|
|
|
from api.service import manage
|
2023-02-22 17:19:27 +08:00
|
|
|
from api.utils import shell_execute
|
2023-02-21 14:21:53 +08:00
|
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
2023-02-22 17:19:27 +08:00
|
|
|
@router.get("")
|
|
|
|
def list_my_apps():
|
|
|
|
list = manage.get_my_app()
|
|
|
|
return JSONResponse(content=list)
|
2023-02-21 14:21:53 +08:00
|
|
|
|
2023-02-22 17:19:27 +08:00
|
|
|
@router.get("/start")
|
|
|
|
def start_app(app_name: Optional[str] = None):
|
|
|
|
|
|
|
|
return {}
|