|
@@ -359,4 +359,27 @@ public class ZhiHouseService {
|
|
|
//把信息封装为json
|
|
|
return JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getBody().getMessage()));
|
|
|
}
|
|
|
+
|
|
|
+ public Integer getCountRecommendByBrandIds(Integer[] ids) {
|
|
|
+ try {
|
|
|
+ if(ids == null || ids.length <=0){
|
|
|
+ throw new CommonBaseException(ResultCodeEnum.D101 , "入参不全");
|
|
|
+ }
|
|
|
+ String url = zhiHouseHost + "recommend/getCountRecommendByBrandIds";
|
|
|
+ Map<String ,Object> params = new HashMap<>(1);
|
|
|
+ params.put("ids",ids);
|
|
|
+ ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,params,ReturnDTO.class);
|
|
|
+ if(responseEntity.getStatusCode()!= HttpStatus.OK){
|
|
|
+ throw new CommonBaseException(ResultCodeEnum.D100);
|
|
|
+ }
|
|
|
+ if (responseEntity.getBody().getCode() != 200) {
|
|
|
+ throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
|
|
|
+ }
|
|
|
+ //把信息封装为json
|
|
|
+ return Integer.valueOf(JSONObject.toJSONString(responseEntity.getBody().getMessage()));
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|