| | |
| | | import org.springframework.web.client.HttpStatusCodeException; |
| | | import org.springframework.web.client.RestClientException; |
| | | |
| | | import java.net.URI; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public <T> T getForObject(String url, Class<T> responseType, Object... uriVariables) throws RestClientException { |
| | | String errMsg = ""; |
| | | T resMsg; |
| | | Date startTime = DateUtil.getCurrentDate(); |
| | | try { |
| | | logger.debug("请求信息:url:{},method:GET", url); |
| | | resMsg = super.getForObject(url, responseType,uriVariables); |
| | | logger.debug("返回信息:responseEntity:{}", resMsg); |
| | | } catch (HttpStatusCodeException e) { |
| | | errMsg = ExceptionUtil.getStackTrace(e); |
| | | throw e; |
| | | } 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); |
| | | } |
| | | return resMsg; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.lang.Nullable; |
| | | import org.springframework.web.client.HttpMessageConverterExtractor; |
| | | import org.springframework.web.client.RequestCallback; |
| | | import org.springframework.web.client.ResponseExtractor; |
| | | import org.springframework.web.client.RestClientException; |
| | | |
| | | import java.net.URI; |
| | | |
| | | /** |
| | | * @author wux |
| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public <T> T getForObject(String url, Class<T> responseType, Object... uriVariables) throws RestClientException { |
| | | |
| | | logger.debug("请求信息:url:{},method:GET", url); |
| | | T responseEntity = super.getForObject(url, responseType,uriVariables); |
| | | logger.debug("返回信息:responseEntity:{}", responseEntity); |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.constant.WechatConstant; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | |
| | | 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"); |