Files
AiDA_Python/app/api/api_test.py

38 lines
1.5 KiB
Python
Raw Normal View History

import json
2024-03-20 11:44:15 +08:00
import logging
2024-03-20 11:44:15 +08:00
from fastapi import APIRouter
from fastapi import HTTPException
2024-06-13 14:31:14 +08:00
from app.core.config import settings, SR_RABBITMQ_QUEUES, GMV_RABBITMQ_QUEUES, PS_RABBITMQ_QUEUES, SLOGAN_RABBITMQ_QUEUES, GI_RABBITMQ_QUEUES, GPI_RABBITMQ_QUEUES, GRI_RABBITMQ_QUEUES, BATCH_GPI_RABBITMQ_QUEUES, BATCH_GRI_RABBITMQ_QUEUES, BATCH_PS_RABBITMQ_QUEUES
2024-06-13 14:31:14 +08:00
from app.schemas.response_template import ResponseModel
2024-03-26 11:34:54 +08:00
2024-03-20 11:44:15 +08:00
logger = logging.getLogger()
router = APIRouter()
2024-06-13 14:31:14 +08:00
@router.get("{id}")
def test(id: int):
2024-06-17 11:07:23 +08:00
data = {
"RABBITMQ_ENV": settings.SERVE_ENV,
# "超分 SR_RABBITMQ_QUEUES": SR_RABBITMQ_QUEUES,
# "多视角 GMV_RABBITMQ_QUEUES": GMV_RABBITMQ_QUEUES,
"pose transform PS_RABBITMQ_QUEUES": PS_RABBITMQ_QUEUES,
"logan SLOGAN_RABBITMQ_QUEUES": SLOGAN_RABBITMQ_QUEUES,
"image and single logo GI_RABBITMQ_QUEUES": GI_RABBITMQ_QUEUES,
"to product image GPI_RABBITMQ_QUEUES": GPI_RABBITMQ_QUEUES,
"relight GRI_RABBITMQ_QUEUES": GRI_RABBITMQ_QUEUES,
# batch
"batch product BATCH_GPI_RABBITMQ_QUEUES": BATCH_GPI_RABBITMQ_QUEUES,
"batch relight BATCH_GRI_RABBITMQ_QUEUES": BATCH_GRI_RABBITMQ_QUEUES,
"batch pose transform BATCH_PS_RABBITMQ_QUEUES": BATCH_PS_RABBITMQ_QUEUES,
"JAVA_STREAM_API_URL": settings.JAVA_STREAM_API_URL,
2024-06-17 11:07:23 +08:00
}
logger.info(json.dumps(data, ensure_ascii=False, indent=4))
2024-06-13 14:31:14 +08:00
if id == 1:
raise HTTPException(status_code=404, detail="Item not found")
return ResponseModel(data=data)