19 lines
513 B
Python
19 lines
513 B
Python
|
|
import logging
|
||
|
|
|
||
|
|
from fastapi import APIRouter
|
||
|
|
|
||
|
|
from app.schemas.attribute import AttributeModel
|
||
|
|
from app.service.attribute_recognition import const
|
||
|
|
from app.service.attribute_recognition.service import AttributeRecognition
|
||
|
|
|
||
|
|
logger = logging.getLogger()
|
||
|
|
router = APIRouter()
|
||
|
|
|
||
|
|
|
||
|
|
@router.post("")
|
||
|
|
def attribute(request_data: AttributeModel):
|
||
|
|
service = AttributeRecognition()
|
||
|
|
response = service.attribute(const, request_data)
|
||
|
|
logger.info("test")
|
||
|
|
return {"code": 200, "message": "ok", "data": response}
|