|
@@ -29,13 +29,16 @@ public interface WxCpService {
|
|
|
* @param timestamp 时间戳
|
|
|
* @param nonce 随机数
|
|
|
* @param data 微信传输过来的数据,有可能是echoStr,有可能是xml消息
|
|
|
+ * @return the boolean
|
|
|
*/
|
|
|
boolean checkSignature(String msgSignature, String timestamp, String nonce, String data);
|
|
|
|
|
|
/**
|
|
|
* 获取access_token, 不强制刷新access_token
|
|
|
*
|
|
|
- * @see #getAccessToken(boolean)
|
|
|
+ * @return the access token
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
+ * @see #getAccessToken(boolean) #getAccessToken(boolean)
|
|
|
*/
|
|
|
String getAccessToken() throws WxErrorException;
|
|
|
|
|
@@ -49,13 +52,17 @@ public interface WxCpService {
|
|
|
* </pre>
|
|
|
*
|
|
|
* @param forceRefresh 强制刷新
|
|
|
+ * @return the access token
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String getAccessToken(boolean forceRefresh) throws WxErrorException;
|
|
|
|
|
|
/**
|
|
|
* 获得jsapi_ticket,不强制刷新jsapi_ticket
|
|
|
*
|
|
|
- * @see #getJsapiTicket(boolean)
|
|
|
+ * @return the jsapi ticket
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
+ * @see #getJsapiTicket(boolean) #getJsapiTicket(boolean)
|
|
|
*/
|
|
|
String getJsapiTicket() throws WxErrorException;
|
|
|
|
|
@@ -68,6 +75,8 @@ public interface WxCpService {
|
|
|
* </pre>
|
|
|
*
|
|
|
* @param forceRefresh 强制刷新
|
|
|
+ * @return the jsapi ticket
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String getJsapiTicket(boolean forceRefresh) throws WxErrorException;
|
|
|
|
|
@@ -78,7 +87,9 @@ public interface WxCpService {
|
|
|
* 签名的jsapi_ticket必须使用以下接口获取。且必须用wx.agentConfig中的agentid对应的应用secret去获取access_token。
|
|
|
* 签名用的noncestr和timestamp必须与wx.agentConfig中的nonceStr和timestamp相同。
|
|
|
*
|
|
|
- * @see #getJsapiTicket(boolean)
|
|
|
+ * @return the agent jsapi ticket
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
+ * @see #getJsapiTicket(boolean) #getJsapiTicket(boolean)
|
|
|
*/
|
|
|
String getAgentJsapiTicket() throws WxErrorException;
|
|
|
|
|
@@ -96,6 +107,8 @@ public interface WxCpService {
|
|
|
* </pre>
|
|
|
*
|
|
|
* @param forceRefresh 强制刷新
|
|
|
+ * @return the agent jsapi ticket
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String getAgentJsapiTicket(boolean forceRefresh) throws WxErrorException;
|
|
|
|
|
@@ -107,23 +120,18 @@ public interface WxCpService {
|
|
|
* </pre>
|
|
|
*
|
|
|
* @param url url
|
|
|
+ * @return the wx jsapi signature
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;
|
|
|
|
|
|
- /**
|
|
|
- * <pre>
|
|
|
- * 发送消息
|
|
|
- * 详情请见: http://qydev.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E
|
|
|
- * </pre>
|
|
|
- *
|
|
|
- * @param message 要发送的消息对象
|
|
|
- */
|
|
|
- WxCpMessageSendResult messageSend(WxCpMessage message) throws WxErrorException;
|
|
|
|
|
|
/**
|
|
|
* 小程序登录凭证校验
|
|
|
*
|
|
|
* @param jsCode 登录时获取的 code
|
|
|
+ * @return the wx cp ma js code 2 session result
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException;
|
|
|
|
|
@@ -134,6 +142,7 @@ public interface WxCpService {
|
|
|
* </pre>
|
|
|
*
|
|
|
* @return { "ip_list": ["101.226.103.*", "101.226.62.*"] }
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String[] getCallbackIp() throws WxErrorException;
|
|
|
|
|
@@ -147,12 +156,7 @@ public interface WxCpService {
|
|
|
*
|
|
|
* @param corpId 服务商的corpid
|
|
|
* @param providerSecret 服务商的secret,在服务商管理后台可见
|
|
|
- * @return {
|
|
|
- * "errcode":0 ,
|
|
|
- * "errmsg":"ok" ,
|
|
|
- * "provider_access_token":"enLSZ5xxxxxxJRL",
|
|
|
- * "expires_in":7200
|
|
|
- * }
|
|
|
+ * @return { "errcode":0 , "errmsg":"ok" , "provider_access_token":"enLSZ5xxxxxxJRL", "expires_in":7200 }
|
|
|
* @throws WxErrorException .
|
|
|
*/
|
|
|
WxCpProviderToken getProviderToken(String corpId, String providerSecret) throws WxErrorException;
|
|
@@ -162,6 +166,8 @@ public interface WxCpService {
|
|
|
*
|
|
|
* @param url 接口地址
|
|
|
* @param queryParam 请求参数
|
|
|
+ * @return the string
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String get(String url, String queryParam) throws WxErrorException;
|
|
|
|
|
@@ -170,6 +176,8 @@ public interface WxCpService {
|
|
|
*
|
|
|
* @param url 接口地址
|
|
|
* @param postData 请求body字符串
|
|
|
+ * @return the string
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String post(String url, String postData) throws WxErrorException;
|
|
|
|
|
@@ -178,6 +186,8 @@ public interface WxCpService {
|
|
|
*
|
|
|
* @param url 接口地址
|
|
|
* @param postData 请求body字符串
|
|
|
+ * @return the string
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String postWithoutToken(String url, String postData) throws WxErrorException;
|
|
|
|
|
@@ -188,11 +198,13 @@ public interface WxCpService {
|
|
|
* 可以参考,{@link MediaUploadRequestExecutor}的实现方法
|
|
|
* </pre>
|
|
|
*
|
|
|
+ * @param <T> 请求值类型
|
|
|
+ * @param <E> 返回值类型
|
|
|
* @param executor 执行器
|
|
|
* @param uri 请求地址
|
|
|
* @param data 参数
|
|
|
- * @param <T> 请求值类型
|
|
|
- * @param <E> 返回值类型
|
|
|
+ * @return the t
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
<T, E> T execute(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException;
|
|
|
|
|
@@ -220,6 +232,7 @@ public interface WxCpService {
|
|
|
* 获取某个sessionId对应的session,如果sessionId没有对应的session,则新建一个并返回。
|
|
|
*
|
|
|
* @param id id可以为任意字符串,建议使用FromUserName作为id
|
|
|
+ * @return the session
|
|
|
*/
|
|
|
WxSession getSession(String id);
|
|
|
|
|
@@ -228,13 +241,14 @@ public interface WxCpService {
|
|
|
*
|
|
|
* @param id id可以为任意字符串,建议使用FromUserName作为id
|
|
|
* @param create 是否新建
|
|
|
+ * @return the session
|
|
|
*/
|
|
|
WxSession getSession(String id, boolean create);
|
|
|
|
|
|
/**
|
|
|
* 获取WxSessionManager 对象
|
|
|
*
|
|
|
- * @return WxSessionManager
|
|
|
+ * @return WxSessionManager session manager
|
|
|
*/
|
|
|
WxSessionManager getSessionManager();
|
|
|
|
|
@@ -252,6 +266,8 @@ public interface WxCpService {
|
|
|
* 上传部门列表覆盖企业号上的部门信息
|
|
|
*
|
|
|
* @param mediaId 媒体id
|
|
|
+ * @return the string
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String replaceParty(String mediaId) throws WxErrorException;
|
|
|
|
|
@@ -259,11 +275,17 @@ public interface WxCpService {
|
|
|
* 上传用户列表覆盖企业号上的用户信息
|
|
|
*
|
|
|
* @param mediaId 媒体id
|
|
|
+ * @return the string
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String replaceUser(String mediaId) throws WxErrorException;
|
|
|
|
|
|
/**
|
|
|
* 获取异步任务结果
|
|
|
+ *
|
|
|
+ * @param joinId the join id
|
|
|
+ * @return the task result
|
|
|
+ * @throws WxErrorException the wx error exception
|
|
|
*/
|
|
|
String getTaskResult(String joinId) throws WxErrorException;
|
|
|
|
|
@@ -275,7 +297,7 @@ public interface WxCpService {
|
|
|
/**
|
|
|
* 获取WxMpConfigStorage 对象
|
|
|
*
|
|
|
- * @return WxMpConfigStorage
|
|
|
+ * @return WxMpConfigStorage wx cp config storage
|
|
|
*/
|
|
|
WxCpConfigStorage getWxCpConfigStorage();
|
|
|
|
|
@@ -288,75 +310,141 @@ public interface WxCpService {
|
|
|
|
|
|
/**
|
|
|
* 获取部门相关接口的服务类对象
|
|
|
+ *
|
|
|
+ * @return the department service
|
|
|
*/
|
|
|
WxCpDepartmentService getDepartmentService();
|
|
|
|
|
|
/**
|
|
|
* 获取媒体相关接口的服务类对象
|
|
|
+ *
|
|
|
+ * @return the media service
|
|
|
*/
|
|
|
WxCpMediaService getMediaService();
|
|
|
|
|
|
/**
|
|
|
* 获取菜单相关接口的服务类对象
|
|
|
+ *
|
|
|
+ * @return the menu service
|
|
|
*/
|
|
|
WxCpMenuService getMenuService();
|
|
|
|
|
|
/**
|
|
|
* 获取Oauth2相关接口的服务类对象
|
|
|
+ *
|
|
|
+ * @return the oauth 2 service
|
|
|
*/
|
|
|
WxCpOAuth2Service getOauth2Service();
|
|
|
|
|
|
/**
|
|
|
* 获取标签相关接口的服务类对象
|
|
|
+ *
|
|
|
+ * @return the tag service
|
|
|
*/
|
|
|
WxCpTagService getTagService();
|
|
|
|
|
|
/**
|
|
|
* 获取用户相关接口的服务类对象
|
|
|
+ *
|
|
|
+ * @return the user service
|
|
|
*/
|
|
|
WxCpUserService getUserService();
|
|
|
|
|
|
+ /**
|
|
|
+ * Gets external contact service.
|
|
|
+ *
|
|
|
+ * @return the external contact service
|
|
|
+ */
|
|
|
WxCpExternalContactService getExternalContactService();
|
|
|
|
|
|
/**
|
|
|
* 获取群聊服务
|
|
|
*
|
|
|
- * @return 群聊服务
|
|
|
+ * @return 群聊服务 chat service
|
|
|
*/
|
|
|
WxCpChatService getChatService();
|
|
|
|
|
|
/**
|
|
|
* 获取任务卡片服务
|
|
|
*
|
|
|
- * @return 任务卡片服务
|
|
|
+ * @return 任务卡片服务 task card service
|
|
|
*/
|
|
|
WxCpTaskCardService getTaskCardService();
|
|
|
|
|
|
+ /**
|
|
|
+ * Gets agent service.
|
|
|
+ *
|
|
|
+ * @return the agent service
|
|
|
+ */
|
|
|
WxCpAgentService getAgentService();
|
|
|
|
|
|
+ /**
|
|
|
+ * Gets message service.
|
|
|
+ *
|
|
|
+ * @return the message service
|
|
|
+ */
|
|
|
+ WxCpMessageService getMessageService();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Gets oa service.
|
|
|
+ *
|
|
|
+ * @return the oa service
|
|
|
+ */
|
|
|
WxCpOaService getOAService();
|
|
|
|
|
|
/**
|
|
|
* 获取群机器人消息推送服务
|
|
|
*
|
|
|
- * @return 群机器人消息推送服务
|
|
|
+ * @return 群机器人消息推送服务 group robot service
|
|
|
*/
|
|
|
WxCpGroupRobotService getGroupRobotService();
|
|
|
|
|
|
/**
|
|
|
* http请求对象
|
|
|
+ *
|
|
|
+ * @return the request http
|
|
|
*/
|
|
|
RequestHttp<?, ?> getRequestHttp();
|
|
|
|
|
|
+ /**
|
|
|
+ * Sets user service.
|
|
|
+ *
|
|
|
+ * @param userService the user service
|
|
|
+ */
|
|
|
void setUserService(WxCpUserService userService);
|
|
|
|
|
|
+ /**
|
|
|
+ * Sets department service.
|
|
|
+ *
|
|
|
+ * @param departmentService the department service
|
|
|
+ */
|
|
|
void setDepartmentService(WxCpDepartmentService departmentService);
|
|
|
|
|
|
+ /**
|
|
|
+ * Sets media service.
|
|
|
+ *
|
|
|
+ * @param mediaService the media service
|
|
|
+ */
|
|
|
void setMediaService(WxCpMediaService mediaService);
|
|
|
|
|
|
+ /**
|
|
|
+ * Sets menu service.
|
|
|
+ *
|
|
|
+ * @param menuService the menu service
|
|
|
+ */
|
|
|
void setMenuService(WxCpMenuService menuService);
|
|
|
|
|
|
+ /**
|
|
|
+ * Sets oauth 2 service.
|
|
|
+ *
|
|
|
+ * @param oauth2Service the oauth 2 service
|
|
|
+ */
|
|
|
void setOauth2Service(WxCpOAuth2Service oauth2Service);
|
|
|
|
|
|
+ /**
|
|
|
+ * Sets tag service.
|
|
|
+ *
|
|
|
+ * @param tagService the tag service
|
|
|
+ */
|
|
|
void setTagService(WxCpTagService tagService);
|
|
|
}
|