|
@@ -102,7 +102,6 @@ async def forwardRequest(request: HlmForwardRequest):
|
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
raise UnicornException(e)
|
|
raise UnicornException(e)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
# @app.post('/handle_detail')
|
|
# @app.post('/handle_detail')
|
|
|
# async def handle_detail(request: Request):
|
|
# async def handle_detail(request: Request):
|
|
|
#
|
|
#
|
|
@@ -111,33 +110,32 @@ async def forwardRequest(request: HlmForwardRequest):
|
|
|
# result = baseDealImage.dealMoveImage(image_dir=image_dir, callback_func=None)
|
|
# result = baseDealImage.dealMoveImage(image_dir=image_dir, callback_func=None)
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- #
|
|
|
|
|
- # params = json.dump(request.query_params)
|
|
|
|
|
- # #{'image_dir': 'D:/phpstudy_pro/WWW/auto_photo/output/2024-11-18', 'image_order': '俯视,侧视,后跟,鞋底,内里', 'is_check_number': True, 'resize_image_view': '后跟', 'cutout_mode': '1', 'logo_path': '', 'special_goods_art_no_folder_line': '', 'is_use_excel': True, 'excel_path': '', 'is_check_color_is_all': True, 'assigned_page_dict': {}, 'temp_class': {'huilima-2': <class 'detail_template.huilima.detail_huilima2.DetailPicGet'>, 'huilima-3': <class 'detail_template.huilima.detail_huilima3.DetailPicGet'>, 'huilima-4': <class 'detail_template.huilima.detail_huilima4.DetailPicGet'>, 'huilima-1': <class 'detail_template.huilima.detail_huilima1.DetailPicGet'>}, 'temp_name': 'huilima-2', 'temp_name_list': ['huilima-2', 'huilima-3', 'huilima-4', 'huilima-1'], 'target_error_folder': 'D:/phpstudy_pro/WWW/auto_photo/output/2024-11-18/软件-生成详情错误'}
|
|
|
|
|
- #
|
|
|
|
|
- # config_data = {
|
|
|
|
|
- # 'image_dir': params['image_dir'],
|
|
|
|
|
- # 'image_order': params['image_order'],
|
|
|
|
|
- # 'is_check_number': params['is_check_number'],
|
|
|
|
|
- # 'resize_image_view': params['resize_image_view'],
|
|
|
|
|
- # 'cutout_mode': '1',
|
|
|
|
|
- # 'logo_path': params['logo_path'],
|
|
|
|
|
- # 'special_goods_art_no_folder_line': '',
|
|
|
|
|
- # 'is_use_excel': params['is_use_excel'],
|
|
|
|
|
- # 'excel_path': params['excel_path'],
|
|
|
|
|
- # 'is_check_color_is_all': params['is_check_color_is_all'],
|
|
|
|
|
- # 'assigned_page_dict': {},
|
|
|
|
|
- # 'temp_class': {
|
|
|
|
|
- # 'huilima-2': 'detail_template.huilima.detail_huilima2.DetailPicGet',
|
|
|
|
|
- # 'huilima-3': 'detail_template.huilima.detail_huilima3.DetailPicGet',
|
|
|
|
|
- # 'huilima-4': 'detail_template.huilima.detail_huilima4.DetailPicGet',
|
|
|
|
|
- # 'huilima-1': 'detail_template.huilima.detail_huilima1.DetailPicGet'
|
|
|
|
|
- # },
|
|
|
|
|
- # 'temp_name': 'huilima-2',
|
|
|
|
|
- # 'temp_name_list': ['huilima-2', 'huilima-3', 'huilima-4', 'huilima-1'],
|
|
|
|
|
- # 'target_error_folder': 'D:/phpstudy_pro/WWW/auto_photo/output/2024-11-18/软件-生成详情错误'
|
|
|
|
|
- # }
|
|
|
|
|
|
|
+ #
|
|
|
|
|
+ # params = json.dump(request.query_params)
|
|
|
|
|
+ # #{'image_dir': 'D:/phpstudy_pro/WWW/auto_photo/output/2024-11-18', 'image_order': '俯视,侧视,后跟,鞋底,内里', 'is_check_number': True, 'resize_image_view': '后跟', 'cutout_mode': '1', 'logo_path': '', 'special_goods_art_no_folder_line': '', 'is_use_excel': True, 'excel_path': '', 'is_check_color_is_all': True, 'assigned_page_dict': {}, 'temp_class': {'huilima-2': <class 'detail_template.huilima.detail_huilima2.DetailPicGet'>, 'huilima-3': <class 'detail_template.huilima.detail_huilima3.DetailPicGet'>, 'huilima-4': <class 'detail_template.huilima.detail_huilima4.DetailPicGet'>, 'huilima-1': <class 'detail_template.huilima.detail_huilima1.DetailPicGet'>}, 'temp_name': 'huilima-2', 'temp_name_list': ['huilima-2', 'huilima-3', 'huilima-4', 'huilima-1'], 'target_error_folder': 'D:/phpstudy_pro/WWW/auto_photo/output/2024-11-18/软件-生成详情错误'}
|
|
|
|
|
+ #
|
|
|
|
|
+ # config_data = {
|
|
|
|
|
+ # 'image_dir': params['image_dir'],
|
|
|
|
|
+ # 'image_order': params['image_order'],
|
|
|
|
|
+ # 'is_check_number': params['is_check_number'],
|
|
|
|
|
+ # 'resize_image_view': params['resize_image_view'],
|
|
|
|
|
+ # 'cutout_mode': '1',
|
|
|
|
|
+ # 'logo_path': params['logo_path'],
|
|
|
|
|
+ # 'special_goods_art_no_folder_line': '',
|
|
|
|
|
+ # 'is_use_excel': params['is_use_excel'],
|
|
|
|
|
+ # 'excel_path': params['excel_path'],
|
|
|
|
|
+ # 'is_check_color_is_all': params['is_check_color_is_all'],
|
|
|
|
|
+ # 'assigned_page_dict': {},
|
|
|
|
|
+ # 'temp_class': {
|
|
|
|
|
+ # 'huilima-2': 'detail_template.huilima.detail_huilima2.DetailPicGet',
|
|
|
|
|
+ # 'huilima-3': 'detail_template.huilima.detail_huilima3.DetailPicGet',
|
|
|
|
|
+ # 'huilima-4': 'detail_template.huilima.detail_huilima4.DetailPicGet',
|
|
|
|
|
+ # 'huilima-1': 'detail_template.huilima.detail_huilima1.DetailPicGet'
|
|
|
|
|
+ # },
|
|
|
|
|
+ # 'temp_name': 'huilima-2',
|
|
|
|
|
+ # 'temp_name_list': ['huilima-2', 'huilima-3', 'huilima-4', 'huilima-1'],
|
|
|
|
|
+ # 'target_error_folder': 'D:/phpstudy_pro/WWW/auto_photo/output/2024-11-18/软件-生成详情错误'
|
|
|
|
|
+ # }
|
|
|
|
|
|
|
|
@app.post("/get_device_configs", description="获取可执行程序命令列表")
|
|
@app.post("/get_device_configs", description="获取可执行程序命令列表")
|
|
|
def get_device_configs(params: ModelGetDeviceConfig):
|
|
def get_device_configs(params: ModelGetDeviceConfig):
|
|
@@ -155,8 +153,10 @@ def get_device_configs(params: ModelGetDeviceConfigDetail):
|
|
|
action_id = params.id
|
|
action_id = params.id
|
|
|
session = SqlQuery()
|
|
session = SqlQuery()
|
|
|
configModel = CRUD(DeviceConfig)
|
|
configModel = CRUD(DeviceConfig)
|
|
|
- configList = configModel.read(session, obj_id=action_id)
|
|
|
|
|
- return {"code": 0, "msg": "", "data": configList}
|
|
|
|
|
|
|
+ model = configModel.read(session, conditions={"id": action_id})
|
|
|
|
|
+ if model == None:
|
|
|
|
|
+ return {"code": 1, "msg": "数据不存在", "data": None}
|
|
|
|
|
+ return {"code": 0, "msg": "", "data": model}
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.post("/remove_config", description="删除一条可执行命令")
|
|
@app.post("/remove_config", description="删除一条可执行命令")
|
|
@@ -164,7 +164,10 @@ def get_device_configs(params: ModelGetDeviceConfigDetail):
|
|
|
action_id = params.id
|
|
action_id = params.id
|
|
|
session = SqlQuery()
|
|
session = SqlQuery()
|
|
|
configModel = CRUD(DeviceConfig)
|
|
configModel = CRUD(DeviceConfig)
|
|
|
- configList = configModel.delete(session, obj_id=action_id)
|
|
|
|
|
|
|
+ model = configModel.read(session, conditions={"id": action_id})
|
|
|
|
|
+ if model == None:
|
|
|
|
|
+ return {"code": 1, "msg": "数据不存在", "data": None}
|
|
|
|
|
+ configModel.delete(session, obj_id=action_id)
|
|
|
return {"code": 0, "msg": "删除成功", "data": None}
|
|
return {"code": 0, "msg": "删除成功", "data": None}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -178,6 +181,9 @@ def save_device_config(params: SaveDeviceConfig):
|
|
|
params.id = None
|
|
params.id = None
|
|
|
save_device_config = deviceConfig.create(session, obj_in=params)
|
|
save_device_config = deviceConfig.create(session, obj_in=params)
|
|
|
else:
|
|
else:
|
|
|
|
|
+ model = deviceConfig.read(session, conditions={"id": action_id})
|
|
|
|
|
+ if model == None:
|
|
|
|
|
+ return {"code": 1, "msg": "数据不存在", "data": None}
|
|
|
# 走编辑逻辑
|
|
# 走编辑逻辑
|
|
|
kwargs = params.__dict__
|
|
kwargs = params.__dict__
|
|
|
save_device_config = deviceConfig.update(session, obj_id=action_id, **kwargs)
|
|
save_device_config = deviceConfig.update(session, obj_id=action_id, **kwargs)
|