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, GMV_RABBITMQ_QUEUES, SLOGAN_RABBITMQ_QUEUES, GEN_SINGLE_LOGO_RABBITMQ_QUEUES, PS_RABBITMQ_QUEUES, BATCH_GPI_RABBITMQ_QUEUES, BATCH_GRI_RABBITMQ_QUEUES, \
    BATCH_PS_RABBITMQ_QUEUES, RABBITMQ_ENV
from app.schemas.response_template import ResponseModel

logger = logging.getLogger()
router = APIRouter()


@router.get("{id}")
def test(id: int):
    data = {
        "RABBITMQ_ENV":RABBITMQ_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": 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)
