Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity
| | |
| | | private String configId; |
| | | private String feeName; |
| | | private String importFeeName; |
| | | private String ownerId; |
| | | |
| | | |
| | | public String getPrimeRate() { |
| | |
| | | public void setImportFeeName(String importFeeName) { |
| | | this.importFeeName = importFeeName; |
| | | } |
| | | |
| | | public String getOwnerId() { |
| | | return ownerId; |
| | | } |
| | | |
| | | public void setOwnerId(String ownerId) { |
| | | this.ownerId = ownerId; |
| | | } |
| | | } |
| | |
| | | package com.java110.core.context; |
| | | |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 页面数据封装对象 |
| | |
| | | |
| | | public HttpMethod getMethod(); |
| | | |
| | | Map<String, Object> getHeaders(); |
| | | |
| | | public void setMethod(HttpMethod method); |
| | | |
| | | public String getPayerObjId(); |
| | |
| | | String appId) |
| | | throws IllegalArgumentException; |
| | | |
| | | /** |
| | | * 构建 pd 对象 |
| | | * |
| | | * @param userId 用户ID |
| | | * @param token token |
| | | * @param reqData 请求数据 |
| | | * @param componentCode 组件编码 |
| | | * @param componentMethod 组件方法 |
| | | * @param url 请求url |
| | | * @param sessionId 会话ID |
| | | * @return IPageData对象 |
| | | * @throws IllegalArgumentException 参数错误异常 |
| | | */ |
| | | IPageData builder(String userId, |
| | | String userName, |
| | | String token, |
| | | String reqData, |
| | | String componentCode, |
| | | String componentMethod, |
| | | String url, |
| | | String sessionId, |
| | | String appId, |
| | | Map<String, Object> headers) |
| | | throws IllegalArgumentException; |
| | | |
| | | IPageData builder(String userId, |
| | | String userName, |
| | | String token, |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.util.DateUtil; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | |
| | | private String apiUrl; |
| | | |
| | | private HttpMethod method; |
| | | private Map<String, Object> headers; |
| | | |
| | | /** |
| | | * 付款方id |
| | |
| | | componentMethod, |
| | | url, |
| | | sessionId, |
| | | ""); |
| | | "", |
| | | null); |
| | | } |
| | | |
| | | @Override |
| | |
| | | this.setEndTime(endTime); |
| | | return this; |
| | | } |
| | | |
| | | public IPageData builder(String userId, |
| | | String userName, |
| | | String token, |
| | |
| | | String url, |
| | | String sessionId, |
| | | String appId) |
| | | throws IllegalArgumentException { |
| | | return builder(userId, |
| | | userName, |
| | | token, |
| | | reqData, |
| | | componentCode, |
| | | componentMethod, |
| | | url, |
| | | sessionId, |
| | | appId, |
| | | null); |
| | | } |
| | | |
| | | |
| | | public IPageData builder(String userId, |
| | | String userName, |
| | | String token, |
| | | String reqData, |
| | | String componentCode, |
| | | String componentMethod, |
| | | String url, |
| | | String sessionId, |
| | | String appId, |
| | | Map<String, Object> headers) |
| | | throws IllegalArgumentException { |
| | | this.setComponentCode(componentCode); |
| | | this.setComponentMethod(componentMethod); |
| | |
| | | this.setUrl(url); |
| | | this.setSessionId(sessionId); |
| | | this.setAppId(appId); |
| | | this.setHeaders(headers); |
| | | |
| | | return this; |
| | | } |
| | |
| | | return method; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getHeaders() { |
| | | return null; |
| | | } |
| | | |
| | | public void setHeaders(Map<String, Object> headers) { |
| | | this.headers = headers; |
| | | } |
| | | |
| | | public void setMethod(HttpMethod method) { |
| | | this.method = method; |
| | | } |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.*; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.client.HttpStatusCodeException; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | |
| | | long startTime = DateUtil.getCurrentDate().getTime(); |
| | | logger.debug(url + "调用api开始:" + (startTime)); |
| | | HttpHeaders header = new HttpHeaders(); |
| | | if (pd.getHeaders() != null) { |
| | | for (String key : pd.getHeaders().keySet() |
| | | ) { |
| | | header.add(key, pd.getHeaders().get(key).toString()); |
| | | } |
| | | } |
| | | header.add(CommonConstant.HTTP_APP_ID.toLowerCase(), StringUtil.isEmpty(pd.getAppId()) ? AppDto.WEB_APP_ID : pd.getAppId()); |
| | | header.add(CommonConstant.HTTP_USER_ID.toLowerCase(), StringUtil.isEmpty(pd.getUserId()) ? CommonConstant.ORDER_DEFAULT_USER_ID : pd.getUserId()); |
| | | header.add(CommonConstant.HTTP_TRANSACTION_ID.toLowerCase(), pd.getTransactionId()); |
| | | header.add(CommonConstant.HTTP_REQ_TIME.toLowerCase(), pd.getRequestTime()); |
| | | header.add(CommonConstant.HTTP_SIGN.toLowerCase(), ""); |
| | | |
| | | HttpEntity<String> httpEntity = new HttpEntity<String>(param, header); |
| | | //logger.debug("请求中心服务信息,{}", httpEntity); |
| | | try { |
| | |
| | | <select id="getTransactionLogInfo" parameterType="Map" resultType="Map"> |
| | | select t.src_ip,t.src_ip srcIp,t.service_code,t.service_code serviceCode,t.cost_time,t.cost_time |
| | | costTime,t.ip,t.app_id,t.app_id appId,t.log_id,t.log_id logId,t.state,t.user_id,t.user_id |
| | | userId,t.transaction_id,t.transaction_id transactionId,t.timestamp |
| | | userId,t.transaction_id,t.transaction_id transactionId,t.timestamp,t.create_time createTime |
| | | from transaction_log t |
| | | where 1 =1 |
| | | <if test="srcIp !=null and srcIp != ''"> |
| | |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.*; |
| | | import org.aspectj.lang.annotation.After; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.AfterThrowing; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Before; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.util.Enumeration; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | componentCode = urls[4]; |
| | | } |
| | | } |
| | | pd = PageData.newInstance().builder(userId, userName, this.getToken(request), reqData, componentCode, componentMethod, url, sessionId, appId); |
| | | Map<String, Object> headers = new HashMap<>(); |
| | | Enumeration reqHeaderEnum = request.getHeaderNames(); |
| | | while (reqHeaderEnum.hasMoreElements()) { |
| | | String headerName = (String) reqHeaderEnum.nextElement(); |
| | | headers.put(headerName.toLowerCase(), request.getHeader(headerName)); |
| | | } |
| | | pd = PageData.newInstance().builder(userId, userName, this.getToken(request), reqData, componentCode, componentMethod, url, sessionId, appId, headers); |
| | | pd.setMethod(request.getMethod().equals("GET") ? HttpMethod.GET : HttpMethod.POST); |
| | | request.setAttribute(CommonConstant.CONTEXT_PAGE_DATA, pd); |
| | | } |