Browse Source

fix:域名处理

lidajiu 2 years ago
parent
commit
e77f09cb17

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

@@ -1,7 +1,6 @@
 package com.inspur.customer.service.wechat;
 
 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;
@@ -23,15 +22,17 @@ import javax.annotation.Resource;
 @Slf4j
 @DubboService(interfaceClass = IWeChatService.class)
 public class WeChatServiceImpl implements IWeChatService {
+    @Value("${msr.idms.ASK_USER}")
+    public String ASK_USER;
+
+    @Value("${msr.idms.QUERY_TICKET}")
+    public String QUERY_TICKET;
     @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.replace("MSR_IDMS_TOP", MSR_IDMS_TOP), userId, appKey);
+        String url = String.format(QUERY_TICKET, userId, appKey);
         HttpHeaders header = new HttpHeaders();
         // header.add("Authorization", authorization);
         ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<String>(header), String.class);
@@ -41,6 +42,6 @@ public class WeChatServiceImpl implements IWeChatService {
 
     @Override
     public String askUser(String userId) {
-        return restTemplate.getForObject(String.format(HttpUrlConstant.ASK_USER.replace("MSR_IDMS_TOP", MSR_IDMS_TOP), userId), String.class);
+        return restTemplate.getForObject(String.format(ASK_USER, userId), String.class);
     }
 }

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

@@ -2,11 +2,10 @@ package com.inspur.customer.context;
 
 /**
  * url统一管理
+ *
  * @author wangbo13
  */
 public class HttpUrlConstant {
 
-    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";
 }