Commit b068fa5c zshaohui

1.Api004直接抛出接口返回的原始信息

1 个父辈 282e055d
......@@ -3,6 +3,7 @@ package com.neotel.smfcore.custom.micron1053.api;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.exception.ApiException;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.HttpHelper;
import com.neotel.smfcore.common.utils.JsonUtil;
......@@ -328,19 +329,32 @@ public class MicronApi {
List<DispatchId> resultDis= result.getResult("dispatchIds",false);
if(resultDis==null||resultDis.size()<=0){
log.info("API004 ,接口通信失败");
throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API004"});
//throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API004"});
String msg = "API004 Failed to get data";
Object message = result.getResult("message", false);
if (message != null){
msg = message.toString();
}
throw new ApiException(msg);
}
return resultDis;
}else{
log.info("API004 ,接口通信失败");
throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API004"});
//throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API004"});
String msg = "API004 Failed to get data";
Object message = result.getResult("message", false);
if (message != null){
msg = message.toString();
}
throw new ApiException(msg);
}
} catch (Exception e) {
log.error(url + "出错", e);
throw new ValidateException(e.getMessage(),e.getMessage());
}
return null;
//return null;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!