2024-03-28 10:30:18 +08:00
|
|
|
import logging
|
|
|
|
|
from pprint import pprint
|
|
|
|
|
|
|
|
|
|
from fastapi import APIRouter
|
|
|
|
|
|
|
|
|
|
from app.schemas.attribute import AttributeModel
|
|
|
|
|
from app.service.attribute_recognition import const, const_debug
|
|
|
|
|
from app.service.attribute_recognition.service import AttributeRecognition
|
|
|
|
|
|
|
|
|
|
logger = logging.getLogger()
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.post("")
|
|
|
|
|
def attribute(request_data: AttributeModel):
|
|
|
|
|
service = AttributeRecognition()
|
2024-03-28 10:38:43 +08:00
|
|
|
response = service.attribute(const_debug, request_data)
|
2024-03-28 10:30:18 +08:00
|
|
|
logger.info("test")
|
|
|
|
|
return {"code": 200, "message": "ok", "data": response}
|