@Test public void testJsCode2Session() throws WxErrorException { assertThat(this.wxService.jsCode2Session("111")).isNotNull(); }
@Override public WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException { Map<String, String> params = new HashMap<>(2); params.put("js_code", jsCode); params.put("grant_type", "authorization_code"); String result = this.get(JSCODE_TO_SESSION_URL, Joiner.on("&").withKeyValueSeparator("=").join(params)); return WxCpMaJsCode2SessionResult.fromJson(result); }
BaseWxCpServiceImpl implements WxCpService, RequestHttp<H, P> { @Override public WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException { Map<String, String> params = new HashMap<>(2); params.put("js_code", jsCode); params.put("grant_type", "authorization_code"); String result = this.get(JSCODE_TO_SESSION_URL, Joiner.on("&").withKeyValueSeparator("=").join(params)); return WxCpMaJsCode2SessionResult.fromJson(result); } }
BaseWxCpServiceImpl implements WxCpService, RequestHttp<H, P> { @Override public WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException { Map<String, String> params = new HashMap<>(2); params.put("js_code", jsCode); params.put("grant_type", "authorization_code"); String result = this.get(JSCODE_TO_SESSION_URL, Joiner.on("&").withKeyValueSeparator("=").join(params)); return WxCpMaJsCode2SessionResult.fromJson(result); }  }
BaseWxCpServiceImpl implements WxCpService, RequestHttp<H, P> { @Override public WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException { Map<String, String> params = new HashMap<>(2); params.put("js_code", jsCode); params.put("grant_type", "authorization_code"); String result = this.get(JSCODE_TO_SESSION_URL, Joiner.on("&").withKeyValueSeparator("=").join(params)); return WxCpMaJsCode2SessionResult.fromJson(result); }  @Override boolean checkSignature(String msgSignature, String timestamp, String nonce, String data); @Override String getAccessToken(); @Override String getAgentJsapiTicket(); @Override String getAgentJsapiTicket(boolean forceRefresh); @Override String getJsapiTicket(); @Override String getJsapiTicket(boolean forceRefresh); @Override WxJsapiSignature createJsapiSignature(String url); @Override WxCpMessageSendResult messageSend(WxCpMessage message); @Override WxCpMaJsCode2SessionResult jsCode2Session(String jsCode); @Override String[] getCallbackIp(); @Override String get(String url, String queryParam); @Override String post(String url, String postData); @Override T execute(RequestExecutor<T, E> executor, String uri, E data); @Override void setWxCpConfigStorage(WxCpConfigStorage wxConfigProvider); @Override void setRetrySleepMillis(int retrySleepMillis); @Override void setMaxRetryTimes(int maxRetryTimes); @Override WxSession getSession(String id); @Override WxSession getSession(String id, boolean create); @Override void setSessionManager(WxSessionManager sessionManager); @Override WxSessionManager getSessionManager(); @Override String replaceParty(String mediaId); @Override String replaceUser(String mediaId); @Override String getTaskResult(String joinId); File getTmpDirFile(); void setTmpDirFile(File tmpDirFile); @Override WxCpDepartmentService getDepartmentService(); @Override WxCpMediaService getMediaService(); @Override WxCpMenuService getMenuService(); @Override WxCpOAuth2Service getOauth2Service(); @Override WxCpTagService getTagService(); @Override WxCpUserService getUserService(); @Override WxCpChatService getChatService(); @Override WxCpOAService getOAService(); @Override WxCpTaskCardService getTaskCardService(); @Override RequestHttp<?, ?> getRequestHttp(); @Override void setUserService(WxCpUserService userService); @Override void setDepartmentService(WxCpDepartmentService departmentService); @Override void setMediaService(WxCpMediaService mediaService); @Override void setMenuService(WxCpMenuService menuService); @Override void setOauth2Service(WxCpOAuth2Service oauth2Service); @Override void setTagService(WxCpTagService tagService); @Override WxCpAgentService getAgentService(); void setAgentService(WxCpAgentService agentService); }
BaseWxCpServiceImpl implements WxCpService, RequestHttp<H, P> { @Override public WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException { Map<String, String> params = new HashMap<>(2); params.put("js_code", jsCode); params.put("grant_type", "authorization_code"); String result = this.get(JSCODE_TO_SESSION_URL, Joiner.on("&").withKeyValueSeparator("=").join(params)); return WxCpMaJsCode2SessionResult.fromJson(result); }  @Override boolean checkSignature(String msgSignature, String timestamp, String nonce, String data); @Override String getAccessToken(); @Override String getAgentJsapiTicket(); @Override String getAgentJsapiTicket(boolean forceRefresh); @Override String getJsapiTicket(); @Override String getJsapiTicket(boolean forceRefresh); @Override WxJsapiSignature createJsapiSignature(String url); @Override WxCpMessageSendResult messageSend(WxCpMessage message); @Override WxCpMaJsCode2SessionResult jsCode2Session(String jsCode); @Override String[] getCallbackIp(); @Override String get(String url, String queryParam); @Override String post(String url, String postData); @Override T execute(RequestExecutor<T, E> executor, String uri, E data); @Override void setWxCpConfigStorage(WxCpConfigStorage wxConfigProvider); @Override void setRetrySleepMillis(int retrySleepMillis); @Override void setMaxRetryTimes(int maxRetryTimes); @Override WxSession getSession(String id); @Override WxSession getSession(String id, boolean create); @Override void setSessionManager(WxSessionManager sessionManager); @Override WxSessionManager getSessionManager(); @Override String replaceParty(String mediaId); @Override String replaceUser(String mediaId); @Override String getTaskResult(String joinId); File getTmpDirFile(); void setTmpDirFile(File tmpDirFile); @Override WxCpDepartmentService getDepartmentService(); @Override WxCpMediaService getMediaService(); @Override WxCpMenuService getMenuService(); @Override WxCpOAuth2Service getOauth2Service(); @Override WxCpTagService getTagService(); @Override WxCpUserService getUserService(); @Override WxCpChatService getChatService(); @Override WxCpOAService getOAService(); @Override WxCpTaskCardService getTaskCardService(); @Override RequestHttp<?, ?> getRequestHttp(); @Override void setUserService(WxCpUserService userService); @Override void setDepartmentService(WxCpDepartmentService departmentService); @Override void setMediaService(WxCpMediaService mediaService); @Override void setMenuService(WxCpMenuService menuService); @Override void setOauth2Service(WxCpOAuth2Service oauth2Service); @Override void setTagService(WxCpTagService tagService); @Override WxCpAgentService getAgentService(); void setAgentService(WxCpAgentService agentService);  }