feat(新功能): 模特腿部编辑功能
fix(修复bug): docs(文档变更): refactor(重构): test(增加测试):
This commit is contained in:
40
app/api/api_mannequins_edit.py
Normal file
40
app/api/api_mannequins_edit.py
Normal file
@@ -0,0 +1,40 @@
|
||||
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, 0.75],
|
||||
"bucket_name": "test",
|
||||
"mannequin_name": "mannequin_name"
|
||||
}**
|
||||
"""
|
||||
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)
|
||||
Reference in New Issue
Block a user