|
|
@ -24,10 +24,7 @@ import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.http.client.ClientHttpRequestFactory; |
|
|
|
import org.springframework.http.client.SimpleClientHttpRequestFactory; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
@ -61,20 +58,6 @@ public class MessageServiceImpl implements MessageService { |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
private RestTemplate restTemplate; |
|
|
|
private ClientHttpRequestFactory factory; |
|
|
|
@Autowired |
|
|
|
public void setFactory() { |
|
|
|
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); |
|
|
|
factory.setReadTimeout(5000);//ms
|
|
|
|
factory.setConnectTimeout(15000);//ms
|
|
|
|
this.factory = factory; |
|
|
|
} |
|
|
|
@Autowired |
|
|
|
public void setRestTemplate() { |
|
|
|
this.restTemplate = new RestTemplate(this.factory); |
|
|
|
} |
|
|
|
|
|
|
|
@Value("${wx.message.analysisAppId}") |
|
|
|
private String analysisAppId; |
|
|
|
|
|
|
|