Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -49,7 +49,7 @@ public class ElementController {
|
||||
public Response<CollectionElementVO> upload(@RequestParam("file") MultipartFile file,
|
||||
@ApiParam("一级类型 Moodboard Printboard Sketchboard MarketingSketch Colorboard")
|
||||
@RequestParam(value = "level1Type") String level1Type,
|
||||
@RequestParam(value = "gender") String gender,
|
||||
@RequestParam(name = "gender", required = false) String gender,
|
||||
@ApiParam("本地时区,比如 'Asia/Tokyo' 东京时间 , 'Asia/Shanghai' 北京时间 由js本地获取")
|
||||
@RequestParam(value = "timeZone") String timeZone) {
|
||||
if (null == file || StringUtils.isEmpty(file.getOriginalFilename())) {
|
||||
|
||||
@@ -2383,12 +2383,17 @@ 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);
|
||||
//生成失败
|
||||
|
||||
@@ -88,6 +88,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
|
||||
String level2Type = null;
|
||||
if (uploadDTO.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())){
|
||||
if (StringUtil.isNullOrEmpty(uploadDTO.getGender())) {
|
||||
throw new BusinessException("gender.cannot.be.empty");
|
||||
}
|
||||
level2Type = pythonService.getClothCategory(path,uploadDTO.getGender());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user