|
@@ -1,10 +1,12 @@
|
|
|
package com.uas.platform.b2c.advertise.ad.service.impl;
|
|
package com.uas.platform.b2c.advertise.ad.service.impl;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
|
import com.uas.platform.b2c.advertise.ad.service.FloorsService;
|
|
import com.uas.platform.b2c.advertise.ad.service.FloorsService;
|
|
|
import com.uas.platform.b2c.core.config.MicroServicesConf;
|
|
import com.uas.platform.b2c.core.config.MicroServicesConf;
|
|
|
import com.uas.platform.b2c.core.utils.JacksonUtils;
|
|
import com.uas.platform.b2c.core.utils.JacksonUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
|
@@ -35,4 +37,18 @@ public class FloorsServiceImpl implements FloorsService {
|
|
|
String result = restTemplate.getForEntity(url, String.class).getBody();
|
|
String result = restTemplate.getForEntity(url, String.class).getBody();
|
|
|
return JacksonUtils.fromJsonArray(result, JSONObject.class);
|
|
return JacksonUtils.fromJsonArray(result, JSONObject.class);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean setFloorsItem(String floorId, String body) {
|
|
|
|
|
+ if ("".equals(floorId)){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ String url = conf.getRequestUrlForFloor(20040, "/floors/"+floorId+"/item");
|
|
|
|
|
+ HttpStatus status = restTemplate.postForEntity(url,body,String.class).getStatusCode();
|
|
|
|
|
+ if (status.equals(HttpStatus.OK)){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|