Files
AiDA_Python/app/api/api_test.py

28 lines
775 B
Python

import json
import logging
from fastapi import APIRouter
from fastapi import HTTPException
from app.core.config import SR_RABBITMQ_QUEUES, GI_RABBITMQ_QUEUES, GPI_RABBITMQ_QUEUES, GRI_RABBITMQ_QUEUES, OSS
from app.schemas.response_template import ResponseModel
logger = logging.getLogger()
router = APIRouter()
@router.get("{id}")
def test(id: int):
data = {
"SR_RABBITMQ_QUEUES message": SR_RABBITMQ_QUEUES,
"GI_RABBITMQ_QUEUES": GI_RABBITMQ_QUEUES,
"GPI_RABBITMQ_QUEUES": GPI_RABBITMQ_QUEUES,
"GRI_RABBITMQ_QUEUES": GRI_RABBITMQ_QUEUES,
"local_oss_server": OSS
}
logger.info(json.dumps(data))
if id == 1:
raise HTTPException(status_code=404, detail="Item not found")
return ResponseModel(data=data)