Browse Source

fix:msr.idms.top域名更换

lidajiu 2 years ago
parent
commit
1882971df5

+ 6 - 2
smsb-customer-manager-app/src/main/java/com/inspur/customer/service/wechat/WeChatServiceImpl.java

@@ -4,6 +4,7 @@ import com.inspur.customer.client.wechat.IWeChatService;
 import com.inspur.customer.context.HttpUrlConstant;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboService;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
@@ -25,9 +26,12 @@ public class WeChatServiceImpl implements IWeChatService {
     @Resource
     private RestTemplate restTemplate;
 
+    @Value("${msr.idms.top}")
+    private String MSR_IDMS_TOP;
+
     @Override
     public String queryTicket(String appKey, String userId, String authorization) {
-        String url = String.format(HttpUrlConstant.QUERY_TICKET, userId, appKey);
+        String url = String.format(HttpUrlConstant.QUERY_TICKET.replace("MSR_IDMS_TOP", MSR_IDMS_TOP), userId, appKey);
         HttpHeaders header = new HttpHeaders();
         header.add("Authorization", authorization);
         ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<String>(header), String.class);
@@ -37,6 +41,6 @@ public class WeChatServiceImpl implements IWeChatService {
 
     @Override
     public String askUser(String userId) {
-        return restTemplate.getForObject(String.format(HttpUrlConstant.ASK_USER, userId), String.class);
+        return restTemplate.getForObject(String.format(HttpUrlConstant.ASK_USER.replace("MSR_IDMS_TOP", MSR_IDMS_TOP), userId), String.class);
     }
 }

+ 2 - 2
smsb-customer-manager-client/src/main/java/com/inspur/customer/context/HttpUrlConstant.java

@@ -6,7 +6,7 @@ package com.inspur.customer.context;
  */
 public class HttpUrlConstant {
 
-    public static final String QUERY_TICKET = "https://msr.idms.top/prod-api/notice/ticket/%s/%s";
+    public static final String QUERY_TICKET = "https://MSR_IDMS_TOP/prod-api/notice/ticket/%s/%s";
 
-    public static final String ASK_USER = "https://msr.idms.top/prod-api/notice/ask/%s";
+    public static final String ASK_USER = "https://MSR_IDMS_TOP/prod-api/notice/ask/%s";
 }