Forráskód Böngészése

修改请求逻辑

tianboguang 3 éve
szülő
commit
92a5880b42

+ 7 - 4
platform-common/src/main/java/com/platform/service/impl/ZhiHouseService.java

@@ -2,10 +2,11 @@ package com.platform.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.google.gson.JsonObject;
 import com.platform.enums.ResultCodeEnum;
 import com.platform.exception.CommonBaseException;
 import com.platform.vos.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
@@ -24,6 +25,7 @@ import java.util.Map;
 
 @Service
 public class ZhiHouseService {
+    private static Logger logger = LoggerFactory.getLogger(ZhiHouseService.class);
 
     @Value("${scenePath}")
     private String zhiHouseHost;
@@ -179,7 +181,8 @@ public class ZhiHouseService {
     }
 
     public Object generateDefaultLiveRoom(String sceneNum) {
-        String url = zhiHouseHost + "/scene/generateDefaultLiveRoom";
+        String url = zhiHouseHost + "scene/generateDefaultLiveRoom";
+        logger.info("请求地址:{}",url);
         Map<String ,Object> params = new HashMap<>(1);
         params.put("sceneNum",sceneNum);
         ResponseEntity<ReturnDTO> responseEntity = restTemplate.postForEntity(url,params,ReturnDTO.class);
@@ -189,7 +192,7 @@ public class ZhiHouseService {
         if (responseEntity.getBody().getCode() != 200) {
             throw new CommonBaseException(ResultCodeEnum.D100,responseEntity.getBody().getError());
         }
-
+        logger.info("返回结果:{}",JSONObject.toJSONString(responseEntity.getBody().getMessage()));
         return responseEntity.getBody().getMessage();
     }
 
@@ -243,7 +246,7 @@ public class ZhiHouseService {
     public TbUser getByUserId(Long userId) {
         Map<String, Object> mp = new HashMap<>();
         mp.put("userId", userId);
-        String url = zhiHouseHost + "api/shop/getByUserId";
+        String url = zhiHouseHost + "shop/sys/user/infoAnon/"+userId;
         ResponseEntity<ReturnDTO>  responseEntity = restTemplate.postForEntity(url, mp,ReturnDTO.class);
         if(responseEntity.getStatusCode()!= HttpStatus.OK){
             throw new CommonBaseException(ResultCodeEnum.D100);