| @@ -62,10 +62,10 @@ public class TtWebGoodsServiceImpl implements TtWebGoodsService { | |||||
| String result = this.service.execute(getExecutor, apiUrl, param); | String result = this.service.execute(getExecutor, apiUrl, param); | ||||
| BaseGoodsResult baseResult = GSON.fromJson(result, BaseGoodsResult.class); | BaseGoodsResult baseResult = GSON.fromJson(result, BaseGoodsResult.class); | ||||
| if(baseResult.isSuccess()){ | if(baseResult.isSuccess()){ | ||||
| JsonObject object = (JsonObject) baseResult.getData(); | |||||
| if(object != null){ | |||||
| JsonObject product_draft_list = object.getAsJsonObject("product_draft_list"); | |||||
| List<Product> list = GSON.fromJson(product_draft_list.toString(), | |||||
| Map map = (Map) baseResult.getData(); | |||||
| if(map != null){ | |||||
| String product_draft_list = map.get("product_draft_list").toString(); | |||||
| List<Product> list = GSON.fromJson(product_draft_list, | |||||
| new TypeReference<List<Product>>() {}.getType()); | new TypeReference<List<Product>>() {}.getType()); | ||||
| return list; | return list; | ||||
| } | } | ||||
| @@ -114,10 +114,10 @@ public class TtWebGoodsServiceImpl implements TtWebGoodsService { | |||||
| String result = this.service.execute(getExecutor, apiUrl, param); | String result = this.service.execute(getExecutor, apiUrl, param); | ||||
| BaseGoodsResult baseResult = GSON.fromJson(result, BaseGoodsResult.class); | BaseGoodsResult baseResult = GSON.fromJson(result, BaseGoodsResult.class); | ||||
| if(baseResult.isSuccess()){ | if(baseResult.isSuccess()){ | ||||
| JsonObject object = (JsonObject) baseResult.getData(); | |||||
| if(object != null){ | |||||
| JsonObject product_online_list = object.getAsJsonObject("product_online_list"); | |||||
| List<Product> list = GSON.fromJson(product_online_list.toString(), | |||||
| Map map = (Map) baseResult.getData(); | |||||
| if(map != null){ | |||||
| String product_online_list = map.get("product_online_list").toString(); | |||||
| List<Product> list = GSON.fromJson(product_online_list, | |||||
| new TypeReference<List<Product>>() {}.getType()); | new TypeReference<List<Product>>() {}.getType()); | ||||
| return list; | return list; | ||||
| } | } | ||||
| @@ -160,8 +160,8 @@ public class TtWebGoodsServiceImpl implements TtWebGoodsService { | |||||
| String result = this.service.execute(postExecutor, apiUrl, GSON.toJson(product)); | String result = this.service.execute(postExecutor, apiUrl, GSON.toJson(product)); | ||||
| BaseGoodsResult baseResult = GSON.fromJson(result, BaseGoodsResult.class); | BaseGoodsResult baseResult = GSON.fromJson(result, BaseGoodsResult.class); | ||||
| if(baseResult.isSuccess()){ | if(baseResult.isSuccess()){ | ||||
| JsonObject data = (JsonObject) baseResult.getData(); | |||||
| return GsonHelper.getString(data,"product_id"); | |||||
| Map map = (Map) baseResult.getData(); | |||||
| return map.get("product_id").toString(); | |||||
| }else{ | }else{ | ||||
| throw new WxErrorException(WxError.builder().errorCode(baseResult.getErrCode()).errorMsg(baseResult.getErrMsg()).build()); | throw new WxErrorException(WxError.builder().errorCode(baseResult.getErrCode()).errorMsg(baseResult.getErrMsg()).build()); | ||||
| } | } | ||||