1
This commit is contained in:
0
app/api/__init__.py
Normal file
0
app/api/__init__.py
Normal file
9
app/api/api_route.py
Normal file
9
app/api/api_route.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.api import api_test
|
||||
from app.api import api_super_resolution
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
router.include_router(api_test.router, tags=["test"], prefix="/test")
|
||||
router.include_router(api_super_resolution.router, tags=["api_super_resolution"], prefix="/api")
|
||||
14
app/api/api_super_resolution.py
Normal file
14
app/api/api_super_resolution.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.schemas.super_resolution import SuperResolutionModel
|
||||
from app.service.super_resolution.service import SuperResolution
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.post("super_resolution")
|
||||
def super_resolution(request_item: SuperResolutionModel):
|
||||
service = SuperResolution()
|
||||
sr_result_url = service.sr_result(request_item.sr_image_url, request_item.sr_xn)
|
||||
response = {"sr_result_url": sr_result_url}
|
||||
return {"code": 200, "message": "ok", "data": response}
|
||||
14
app/api/api_test.py
Normal file
14
app/api/api_test.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import logging
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
logger = logging.getLogger()
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
|
||||
|
||||
@router.get("")
|
||||
def test():
|
||||
logger.info("test")
|
||||
return {"message": "ok"}
|
||||
Reference in New Issue
Block a user