43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
import json
|
|
import logging
|
|
|
|
from fastapi import APIRouter, HTTPException
|
|
|
|
from app.schemas.mannequin_edit import MannequinModel
|
|
from app.schemas.response_template import ResponseModel
|
|
from app.service.mannequins_edit.service import MannequinEditService
|
|
|
|
router = APIRouter()
|
|
logger = logging.getLogger()
|
|
|
|
|
|
@router.post("/mannequins_edit")
|
|
def mannequins_edit(request_data: MannequinModel):
|
|
"""
|
|
模特腿长调整
|
|
创建一个具有以下参数的请求体:
|
|
- **mannequins**: mannequins url等信息
|
|
- **scale**: 大腿小腿比例
|
|
- **bucket_name**: bucket name
|
|
- **mannequin_name**: 模特名称
|
|
|
|
示例参数:
|
|
- **{
|
|
"mannequins": "aida-sys-image/models/male/dc36ce58-46c3-4b6f-8787-5ca7d6fc26e6.png",
|
|
"scale": 0.75,
|
|
"bucket_name": "test",
|
|
"mannequin_name": "mannequin_name",
|
|
"top" : 270,
|
|
"bottom" : 432
|
|
}**
|
|
"""
|
|
try:
|
|
logger.info(f"mannequins_edit request item is : @@@@@@:{json.dumps(request_data.dict())}")
|
|
service = MannequinEditService(request_data)
|
|
data = service()
|
|
logger.info(f"mannequins_edit response @@@@@@:{json.dumps(data)}")
|
|
except Exception as e:
|
|
logger.warning(f"mannequins_edit Run Exception @@@@@@:{e}")
|
|
raise HTTPException(status_code=404, detail=str(e))
|
|
return ResponseModel(data=data)
|