update
This commit is contained in:
parent
358241d115
commit
0a3aea565d
@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
|
|||||||
logger.setLevel(logging.DEBUG)
|
logger.setLevel(logging.DEBUG)
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.post("/tryon", tags=["tryon"])
|
@router.post("", tags=["tryon"])
|
||||||
async def tryon(
|
async def tryon(
|
||||||
tryon_request: TryonRequest,
|
tryon_request: TryonRequest,
|
||||||
db: AsyncSession = Depends(deps.get_db),
|
db: AsyncSession = Depends(deps.get_db),
|
||||||
@ -78,7 +78,7 @@ async def tryon(
|
|||||||
else:
|
else:
|
||||||
return StandardResponse(code=500, message="试穿任务提交失败")
|
return StandardResponse(code=500, message="试穿任务提交失败")
|
||||||
|
|
||||||
@router.get("/tryon/histories", tags=["tryon"])
|
@router.get("/histories", tags=["tryon"])
|
||||||
async def get_tryon_histories(
|
async def get_tryon_histories(
|
||||||
db: AsyncSession = Depends(deps.get_db),
|
db: AsyncSession = Depends(deps.get_db),
|
||||||
current_user: User = Depends(get_current_user)
|
current_user: User = Depends(get_current_user)
|
||||||
@ -91,7 +91,7 @@ async def get_tryon_histories(
|
|||||||
|
|
||||||
return StandardResponse(code=200, message="试穿历史获取成功", data=[TryonHistoryModel.model_validate(history) for history in tryon_histories])
|
return StandardResponse(code=200, message="试穿历史获取成功", data=[TryonHistoryModel.model_validate(history) for history in tryon_histories])
|
||||||
|
|
||||||
@router.get("/tryon/history/{history_id}", tags=["tryon"])
|
@router.get("/history/{history_id}", tags=["tryon"])
|
||||||
async def get_tryon_history(
|
async def get_tryon_history(
|
||||||
history_id: int,
|
history_id: int,
|
||||||
db: AsyncSession = Depends(deps.get_db),
|
db: AsyncSession = Depends(deps.get_db),
|
||||||
@ -107,7 +107,7 @@ async def get_tryon_history(
|
|||||||
|
|
||||||
return StandardResponse(code=200, message="试穿历史详情获取成功", data=TryonHistoryModel.model_validate(tryon_history))
|
return StandardResponse(code=200, message="试穿历史详情获取成功", data=TryonHistoryModel.model_validate(tryon_history))
|
||||||
|
|
||||||
@router.get("/tryon/history/{history_id}/check", tags=["tryon"])
|
@router.get("/history/{history_id}/check", tags=["tryon"])
|
||||||
async def check_tryon_status(
|
async def check_tryon_status(
|
||||||
history_id: int,
|
history_id: int,
|
||||||
db: AsyncSession = Depends(deps.get_db),
|
db: AsyncSession = Depends(deps.get_db),
|
||||||
|
|||||||
@ -13,14 +13,13 @@ class TryonRequest(BaseModel):
|
|||||||
|
|
||||||
class TryonHistoryModel(BaseModel):
|
class TryonHistoryModel(BaseModel):
|
||||||
id: int
|
id: int
|
||||||
person_image_id: int
|
person_image_id: Optional[int] = None
|
||||||
top_clothing_id: int
|
top_clothing_id: Optional[int] = None
|
||||||
bottom_clothing_id: int
|
bottom_clothing_id: Optional[int] = None
|
||||||
top_clothing_url: str
|
top_clothing_url: Optional[str] = None
|
||||||
bottom_clothing_url: str
|
bottom_clothing_url: Optional[str] = None
|
||||||
status: TryonStatus
|
status: TryonStatus
|
||||||
create_time: datetime
|
task_id: Optional[str] = None
|
||||||
update_time: datetime
|
completion_url: Optional[str] = None
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
from_attributes = True
|
from_attributes = True
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user