| @@ -0,0 +1,13 @@ | |||||
| package com.iformall.douyin.miniapp.api; | |||||
| import cn.binarywang.wx.miniapp.bean.AbstractWxMaQrcodeWrapper; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.io.Serializable; | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = false) | |||||
| public class TtAccessToken extends AbstractWxMaQrcodeWrapper { | |||||
| private String accessToken; | |||||
| } | |||||
| @@ -12,7 +12,7 @@ import java.io.Serializable; | |||||
| */ | */ | ||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = false) | @EqualsAndHashCode(callSuper = false) | ||||
| public class TtMaQrcode extends AbstractWxMaQrcodeWrapper implements Serializable { | |||||
| public class TtMaQrcode extends TtAccessToken implements Serializable { | |||||
| private static final long serialVersionUID = 5777119669111011584L; | private static final long serialVersionUID = 5777119669111011584L; | ||||
| private String appname; | private String appname; | ||||
| private String path; | private String path; | ||||
| @@ -32,6 +32,7 @@ import org.apache.http.impl.client.BasicResponseHandler; | |||||
| import org.apache.http.impl.client.CloseableHttpClient; | import org.apache.http.impl.client.CloseableHttpClient; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.lang.reflect.Field; | |||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import java.util.concurrent.locks.Lock; | import java.util.concurrent.locks.Lock; | ||||
| @@ -218,26 +219,21 @@ public class TtMaServiceImpl implements TtMaService, RequestHttp<CloseableHttpCl | |||||
| } | } | ||||
| String accessToken = getAccessToken(false); | String accessToken = getAccessToken(false); | ||||
| E param = null; | |||||
| try { | try { | ||||
| if(!(data instanceof String)){ | |||||
| JSONObject jsonObject = (JSONObject) JSON.toJSON(data); | |||||
| jsonObject.put("access_token",accessToken); | |||||
| param = (E)jsonObject; | |||||
| Class<?> aClass = data.getClass(); | |||||
| if(!aClass.equals(String.class)){ | |||||
| Field accessToken1 = aClass.getDeclaredField("accessToken"); | |||||
| accessToken1.setAccessible(true); | |||||
| accessToken1.set(data,accessToken); | |||||
| } | } | ||||
| } catch (Exception e){ | |||||
| log.error("\n【请求参数+access_token】:{}\n【错误信息】:{}", dataForLog, e.getMessage()); | |||||
| } | |||||
| if(param == null){ | |||||
| param = data; | |||||
| } catch (Exception e) { | |||||
| log.error("【请求参数】:{}添加accessToken失败"); | |||||
| } | } | ||||
| // String uriWithAccessToken = uri + (uri.contains("?") ? "&" : "?") + "access_token=" + accessToken; | |||||
| String uriWithAccessToken = uri; | |||||
| String uriWithAccessToken = uri + (uri.contains("?") ? "&" : "?") + "access_token=" + accessToken; | |||||
| try { | try { | ||||
| T result = executor.execute(uriWithAccessToken, param, WxType.MiniApp); | |||||
| T result = executor.execute(uriWithAccessToken, data, WxType.MiniApp); | |||||
| log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uriWithAccessToken, dataForLog, result); | log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uriWithAccessToken, dataForLog, result); | ||||
| return result; | return result; | ||||
| } catch (WxErrorException e) { | } catch (WxErrorException e) { | ||||
| @@ -6,10 +6,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumBusiness; | |||||
| import com.iformall.enums.EnumCUserBasicInfoStatus; | |||||
| import com.iformall.enums.EnumScoreRules; | |||||
| import com.iformall.enums.EnumScoreType; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxCUserService; | import com.iformall.service.WxCUserService; | ||||
| @@ -56,7 +53,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| wxScoreRules.setCreateDate(new Date()); | wxScoreRules.setCreateDate(new Date()); | ||||
| wxScoreRules.setUpdateDate(new Date()); | wxScoreRules.setUpdateDate(new Date()); | ||||
| wxScoreRules.setType(EnumScoreRules.CREDIT.getCode()); | wxScoreRules.setType(EnumScoreRules.CREDIT.getCode()); | ||||
| wxScoreRules.setCreditLocked(1); | |||||
| wxScoreRules.setCreditLocked(EnumCreditLockedStatus.OPEN.getCode()); | |||||
| wxScoreRulesMapper.insert(wxScoreRules); | wxScoreRulesMapper.insert(wxScoreRules); | ||||
| wxScoreRules = new WxScoreRules(); | wxScoreRules = new WxScoreRules(); | ||||
| wxScoreRules.setTenantId(tenantId); | wxScoreRules.setTenantId(tenantId); | ||||
| @@ -64,7 +61,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| wxScoreRules.setCreateDate(new Date()); | wxScoreRules.setCreateDate(new Date()); | ||||
| wxScoreRules.setUpdateDate(new Date()); | wxScoreRules.setUpdateDate(new Date()); | ||||
| wxScoreRules.setType(EnumScoreRules.SCORE.getCode()); | wxScoreRules.setType(EnumScoreRules.SCORE.getCode()); | ||||
| wxScoreRules.setCreditLocked(0); | |||||
| wxScoreRules.setCreditLocked(EnumCreditLockedStatus.CLOSE.getCode()); | |||||
| wxScoreRulesMapper.insert(wxScoreRules); | wxScoreRulesMapper.insert(wxScoreRules); | ||||
| } | } | ||||