|
|
@@ -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);
|
|
|
}
|
|
|
}
|