Files
AiDA_Python/app/api/api_test.py
2024-12-09 13:37:21 +08:00

29 lines
848 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, JAVA_STREAM_API_URL
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,
"JAVA_STREAM_API_URL": JAVA_STREAM_API_URL,
"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)