BUGFIX:添加入参判断
This commit is contained in:
@@ -2383,14 +2383,18 @@ public class PythonService {
|
||||
}
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(bodyString);
|
||||
Boolean result = JSON.parseObject(JSON.toJSONString(response)).getBoolean("successful");
|
||||
if (result && jsonObject.get("msg").equals("OK!")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
JSONArray list = JSONArray.parseArray(data.get("list").toString());
|
||||
JSONObject map = (JSONObject) list.get(0);
|
||||
return map.get("category").toString();
|
||||
try{
|
||||
Boolean result = JSON.parseObject(JSON.toJSONString(response)).getBoolean("successful");
|
||||
if (result && jsonObject.get("msg").equals("OK!")) {
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
JSONArray list = JSONArray.parseArray(data.get("list").toString());
|
||||
JSONObject map = (JSONObject) list.get(0);
|
||||
return map.get("category").toString();
|
||||
}
|
||||
}catch (NullPointerException e){
|
||||
log.info("getClothCategory 失败###{},未返回category", jsonObject);
|
||||
throw new BusinessException("cloth-classification.interface.exception");
|
||||
}
|
||||
log.info("getClothCategory 失败###{}", jsonObject);
|
||||
//生成失败
|
||||
throw new BusinessException("cloth-classification.interface.exception");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user