|
|
@@ -23,12 +23,12 @@ class AutoImportRequest(BaseModel):
|
|
|
is_reflect_card: bool = Field(True, description="是否是反光卡")
|
|
|
strict_mode: bool = Field(False, description="如果为True,必须提供所有4张主图")
|
|
|
|
|
|
- path_front_ring: Optional[str] = Field(None, description="正面环光图绝对路径")
|
|
|
- path_front_coaxial: Optional[str] = Field(None, description="正面同轴光图绝对路径")
|
|
|
- path_back_ring: Optional[str] = Field(None, description="背面环光图绝对路径")
|
|
|
- path_back_coaxial: Optional[str] = Field(None, description="背面同轴光图绝对路径")
|
|
|
- path_front_gray: Optional[str] = Field(None, description="正面灰度图绝对路径")
|
|
|
- path_back_gray: Optional[str] = Field(None, description="背面灰度图绝对路径")
|
|
|
+ front_ring: Optional[str] = Field(None, description="正面环光图绝对路径")
|
|
|
+ front_coaxial: Optional[str] = Field(None, description="正面同轴光图绝对路径")
|
|
|
+ back_ring: Optional[str] = Field(None, description="背面环光图绝对路径")
|
|
|
+ back_coaxial: Optional[str] = Field(None, description="背面同轴光图绝对路径")
|
|
|
+ front_gray: Optional[str] = Field(None, description="正面灰度图绝对路径")
|
|
|
+ back_gray: Optional[str] = Field(None, description="背面灰度图绝对路径")
|
|
|
|
|
|
|
|
|
# --- 内部辅助函数 ---
|
|
|
@@ -172,25 +172,25 @@ async def auto_import_script_api(request: Request, req_data: AutoImportRequest):
|
|
|
card_type: 卡牌类型
|
|
|
is_reflect_card: 是否是反光卡
|
|
|
strict_mode: 如果为True,必须提供所有4张主图
|
|
|
- path_front_ring: 正面环光图绝对路径
|
|
|
- path_front_coaxial: 正面同轴光图绝对路径
|
|
|
- path_back_ring: 背面环光图绝对路径
|
|
|
- path_back_coaxial: 背面同轴光图绝对路径
|
|
|
- path_front_gray: 正面灰度图绝对路径
|
|
|
- path_back_gray: 背面灰度图绝对路径
|
|
|
+ front_ring: 正面环光图绝对路径
|
|
|
+ front_coaxial: 正面同轴光图绝对路径
|
|
|
+ back_ring: 背面环光图绝对路径
|
|
|
+ back_coaxial: 背面同轴光图绝对路径
|
|
|
+ front_gray: 正面灰度图绝对路径
|
|
|
+ back_gray: 背面灰度图绝对路径
|
|
|
"""
|
|
|
# 动态获取当前服务的 base_url (例如 http://127.0.0.1:7755)
|
|
|
local_base_url = str(request.base_url).rstrip('/')
|
|
|
|
|
|
main_inputs = {
|
|
|
- "front_ring": req_data.path_front_ring,
|
|
|
- "front_coaxial": req_data.path_front_coaxial,
|
|
|
- "back_ring": req_data.path_back_ring,
|
|
|
- "back_coaxial": req_data.path_back_coaxial
|
|
|
+ "front_ring": req_data.front_ring,
|
|
|
+ "front_coaxial": req_data.front_coaxial,
|
|
|
+ "back_ring": req_data.back_ring,
|
|
|
+ "back_coaxial": req_data.back_coaxial
|
|
|
}
|
|
|
gray_inputs = {
|
|
|
- "front_gray": req_data.path_front_gray,
|
|
|
- "back_gray": req_data.path_back_gray
|
|
|
+ "front_gray": req_data.front_gray,
|
|
|
+ "back_gray": req_data.back_gray
|
|
|
}
|
|
|
|
|
|
# 1. 严格模式与路径检查
|