design Single接口第二版

This commit is contained in:
xupei
2023-09-18 14:44:30 +08:00
parent 778bb9534d
commit 206f365ff3
2 changed files with 10 additions and 5 deletions

View File

@@ -1354,8 +1354,8 @@ public class PythonService {
private DesignPythonItemPrint resolveDesignSinglePrint(DesignSinglePrintDTO printObject, String clothesPath) { private DesignPythonItemPrint resolveDesignSinglePrint(DesignSinglePrintDTO printObject, String clothesPath) {
if (Objects.isNull(printObject)) { if (Objects.isNull(printObject.getPath()) || CollectionUtil.isEmpty(printObject.getPrints())) {
return null; return new DesignPythonItemPrint(new ArrayList<>(),false);
} }
DesignPythonItemPrint print = CopyUtil.copyObject(printObject, DesignPythonItemPrint.class); DesignPythonItemPrint print = CopyUtil.copyObject(printObject, DesignPythonItemPrint.class);
if(StringUtils.isEmpty(printObject.getPath())){ if(StringUtils.isEmpty(printObject.getPath())){
@@ -1519,8 +1519,8 @@ public class PythonService {
} }
public JSONObject designNew(DesignPythonObjects designPythonObjects) { public JSONObject designNew(DesignPythonObjects designPythonObjects) {
//限流校验 // todo 限流校验
AccessLimitUtils.validate("design",5); // AccessLimitUtils.validate("design",5);
OkHttpClient client = new OkHttpClient().newBuilder() OkHttpClient client = new OkHttpClient().newBuilder()
.connectTimeout(30, TimeUnit.SECONDS) .connectTimeout(30, TimeUnit.SECONDS)
.pingInterval(5, TimeUnit.SECONDS)//websocket轮训间隔(单位:秒) .pingInterval(5, TimeUnit.SECONDS)//websocket轮训间隔(单位:秒)
@@ -1556,7 +1556,7 @@ public class PythonService {
log.error("PythonService##design异常###{}", ExceptionUtil.getThrowableList(ioException)); log.error("PythonService##design异常###{}", ExceptionUtil.getThrowableList(ioException));
} }
//去除限流 //去除限流
AccessLimitUtils.validateOut("design"); // AccessLimitUtils.validateOut("design");
if (Objects.isNull(response)) { if (Objects.isNull(response)) {
log.error("PythonService##design异常###{}", "response or body is empty!"); log.error("PythonService##design异常###{}", "response or body is empty!");
throw new BusinessException("system error!"); throw new BusinessException("system error!");

View File

@@ -60,4 +60,9 @@ public class DesignPythonItemPrint {
public DesignPythonItemPrint(String path) { public DesignPythonItemPrint(String path) {
this.path = path; this.path = path;
} }
public DesignPythonItemPrint(List<String> print_path_list, Boolean ifSingle) {
this.print_path_list = print_path_list;
IfSingle = ifSingle;
}
} }