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