Skip to content

Commit

Permalink
binarywang#759 增加三方平台代小程序业务接口:代码管理、模板管理、成员管理、发布审核等
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanqixun authored and binarywang committed Sep 15, 2018
1 parent 13bee05 commit 941833e
Show file tree
Hide file tree
Showing 27 changed files with 1,524 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.config.WxMaConfig;
import com.google.common.base.Joiner;
import com.google.gson.Gson;
import me.chanjar.weixin.common.bean.WxAccessToken;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.DataUtils;
import me.chanjar.weixin.common.util.crypto.SHA1;
import me.chanjar.weixin.common.util.http.HttpType;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.common.util.http.RequestHttp;
import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor;
import me.chanjar.weixin.common.util.http.SimplePostRequestExecutor;
import me.chanjar.weixin.common.util.http.*;
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder;
import org.apache.http.HttpHost;
Expand Down Expand Up @@ -55,6 +52,8 @@ public class WxMaServiceImpl implements WxMaService, RequestHttp<CloseableHttpCl
private int retrySleepMillis = 1000;
private int maxRetryTimes = 5;

protected static final Gson GSON = new Gson();

@Override
public CloseableHttpClient getRequestHttpClient() {
return httpClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ public WxMpMemberCardUserInfoResult getUserInfo(String cardId, String code) thro
jsonObject.addProperty("code", code);

String responseContent = this.getWxMpService().post(MEMBER_CARD_USER_INFO_GET, jsonObject.toString());
log.debug("{}",responseContent);
JsonElement tmpJsonElement = new JsonParser().parse(responseContent);
return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement,
new TypeToken<WxMpMemberCardUserInfoResult>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class WxMpMemberCardServiceImplTest {

@Inject
protected WxMpService wxService;
private String cardId = "p2iQk1kUixiypVJ1lJYIT-_fMdUg";
private String code = "201808290001";
private String cardId = "p2iQk1g2d03JXhVRDY5fZRVr236A";
private String code = "435223630779";
private String openId = "o2iQk1u5X-XIJkatmAK1Q8VVuS90";

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package me.chanjar.weixin.open.api;

import java.util.List;

import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
Expand All @@ -13,6 +10,8 @@
import me.chanjar.weixin.open.bean.result.WxOpenAuthorizerOptionResult;
import me.chanjar.weixin.open.bean.result.WxOpenQueryAuthResult;

import java.util.List;

/**
* @author <a href="https://github.com/007gzs">007</a>
*/
Expand Down Expand Up @@ -41,7 +40,13 @@ public interface WxOpenComponentService {

WxMpService getWxMpServiceByAppid(String appid);

WxMaService getWxMaServiceByAppid(String appid);
/**
* 获取指定appid的开放平台小程序服务(继承一般小程序服务能力)
*
* @param appid
* @return
*/
WxOpenMaService getWxMaServiceByAppid(String appid);

WxOpenConfigStorage getWxOpenConfigStorage();

Expand Down
Loading

0 comments on commit 941833e

Please sign in to comment.