| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public <T> ResponseEntity<T> postForEntity(String url, @Nullable Object request, |
| | | Class<T> responseType, Object... uriVariables) throws RestClientException { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public <T> ResponseEntity<T> getForEntity(String url, Class<T> responseType, Object... uriVariables) throws RestClientException { |
| | | String errMsg = ""; |
| | | |
| | | ResponseEntity<T> responseEntity = null; |
| | | ResponseEntity tmpResponseEntity = null; |
| | | Date startTime = DateUtil.getCurrentDate(); |
| | | try { |
| | | logger.debug("请求信息:url:{},method:{},uriVariables:{}", url, "POST", uriVariables); |
| | | responseEntity = super.getForEntity(url, responseType, uriVariables); |
| | | logger.debug("返回信息:responseEntity:{}", responseEntity); |
| | | } catch (HttpStatusCodeException e) { |
| | | errMsg = ExceptionUtil.getStackTrace(e); |
| | | throw e; |
| | | } finally { |
| | | |
| | | if (responseEntity != null) { |
| | | tmpResponseEntity = new ResponseEntity(responseEntity.getBody(), responseEntity.getStatusCode()); |
| | | } else { |
| | | tmpResponseEntity = new ResponseEntity(errMsg, HttpStatus.BAD_REQUEST); |
| | | } |
| | | // saveLog(url, "POST", null, tmpResponseEntity, DateUtil.getCurrentDate().getTime() - startTime.getTime()); |
| | | |
| | | LogFactory.saveOutLog(url, "GET", DateUtil.getCurrentDate().getTime() - startTime.getTime(), null, "", tmpResponseEntity); |
| | | } |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public <T> T getForObject(String url, Class<T> responseType, Object... uriVariables) throws RestClientException { |
| | | String errMsg = ""; |
| | | T resMsg; |
| | |
| | | } finally { |
| | | ResponseEntity tmpResponseEntity = new ResponseEntity(errMsg, HttpStatus.OK); |
| | | // saveLog(url, "POST", null, tmpResponseEntity, DateUtil.getCurrentDate().getTime() - startTime.getTime()); |
| | | LogFactory.saveOutLog(url, "POST", DateUtil.getCurrentDate().getTime() - startTime.getTime(), null, "", tmpResponseEntity); |
| | | LogFactory.saveOutLog(url, "GET", DateUtil.getCurrentDate().getTime() - startTime.getTime(), null, "", tmpResponseEntity); |
| | | } |
| | | return resMsg; |
| | | } |
| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | public <T> ResponseEntity<T> getForEntity(String url, Class<T> responseType, Object... uriVariables) throws RestClientException { |
| | | logger.debug("请求信息:url:{},method:GET,uriVariables:{}", url, uriVariables); |
| | | ResponseEntity<T> responseEntity = super.getForEntity(url, responseType, uriVariables); |
| | | logger.debug("返回信息:responseEntity:{}", responseEntity); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public <T> T getForObject(String url, Class<T> responseType, Object... uriVariables) throws RestClientException { |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.client.OutRestTemplate; |
| | | import com.java110.core.factory.WechatFactory; |
| | | import com.java110.core.log.LoggerFactory; |
| | | import com.java110.dto.wechat.SmallWeChatDto; |
| | |
| | | smallWeChatDto.setObjId(communityId); |
| | | List<SmallWeChatDto> smallWeChatDtos = smallWeChatInnerServiceSMOImpl.querySmallWeChats(smallWeChatDto); |
| | | |
| | | if (smallWeChatDtos == null || smallWeChatDtos.size() < 1) { |
| | | if (ListUtil.isNull(smallWeChatDtos)) { |
| | | String appIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appId"); |
| | | String appSecretCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appSecret"); |
| | | String mchIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "mchId"); |