H - the type parameterP - the type parameterpublic abstract class BaseWxCpServiceImpl<H,P> extends Object implements WxCpService, RequestHttp<H,P>
| 限定符和类型 | 字段和说明 |
|---|---|
protected WxCpConfigStorage |
configStorage
The Config storage.
|
protected Object |
globalAccessTokenRefreshLock
全局的是否正在刷新access token的锁.
|
protected Object |
globalAgentJsapiTicketRefreshLock
全局的是否正在刷新agent的jsapi_ticket的锁.
|
protected Object |
globalJsapiTicketRefreshLock
全局的是否正在刷新jsapi_ticket的锁.
|
| 构造器和说明 |
|---|
BaseWxCpServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
buildQrConnectUrl(String redirectUri,
String state)
构造扫码登录链接 - 构造独立窗口登录二维码
|
boolean |
checkSignature(String msgSignature,
String timestamp,
String nonce,
String data)
验证推送过来的消息的正确性
详情请见: http://mp.weixin.qq.com/wiki/index.php?
|
WxCpAgentJsapiSignature |
createAgentJsapiSignature(String url)
创建调用wx.agentConfig时所需要的签名
详情请见:https://open.work.weixin.qq.com/api/doc/90000/90136/94313
|
WxJsapiSignature |
createJsapiSignature(String url)
创建调用jsapi时所需要的签名
详情请见:http://qydev.weixin.qq.com/wiki/index.php?
|
<T,E> T |
execute(RequestExecutor<T,E> executor,
String uri,
E data)
向微信端发送请求,在这里执行的策略是当发生access_token过期时才去刷新,然后重新执行请求,而不是全局定时请求.
|
protected <T,E> T |
executeInternal(RequestExecutor<T,E> executor,
String uri,
E data,
boolean doNotAutoRefresh)
Execute internal t.
|
String |
get(String url,
String queryParam) |
String |
getAccessToken()
获取access_token, 不强制刷新access_token
|
String |
getAgentJsapiTicket()
获得jsapi_ticket,不强制刷新jsapi_ticket
应用的jsapi_ticket用于计算agentConfig(参见“通过agentConfig注入应用的权限”)的签名,签名计算方法与上述介绍的config的签名算法完全相同,但需要注意以下区别:
签名的jsapi_ticket必须使用以下接口获取。
|
String |
getAgentJsapiTicket(boolean forceRefresh)
获取应用的jsapi_ticket
应用的jsapi_ticket用于计算agentConfig(参见“通过agentConfig注入应用的权限”)的签名,签名计算方法与上述介绍的config的签名算法完全相同,但需要注意以下区别:
签名的jsapi_ticket必须使用以下接口获取。
|
WxCpAgentService |
getAgentService()
Gets agent service.
|
String[] |
getApiDomainIp()
获取企业微信接口IP段
https://developer.work.weixin.qq.com/document/path/92520
|
String[] |
getCallbackIp()
获取企业微信回调IP段
http://qydev.weixin.qq.com/wiki/index.php?
|
WxCpChatService |
getChatService()
获取群聊服务
|
WxCpCorpGroupService |
getCorpGroupService()
企业互联的服务类对象
|
WxCpDepartmentService |
getDepartmentService()
获取部门相关接口的服务类对象
|
WxCpExportService |
getExportService()
获取异步导出服务
|
WxCpExternalContactService |
getExternalContactService()
Gets external contact service.
|
WxCpGroupRobotService |
getGroupRobotService()
获取群机器人消息推送服务
|
String |
getJsapiTicket()
获得jsapi_ticket,不强制刷新jsapi_ticket
|
String |
getJsapiTicket(boolean forceRefresh)
获得jsapi_ticket
获得时会检查jsapiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干
详情请见:http://qydev.weixin.qq.com/wiki/index.php?
|
WxCpKfService |
getKfService()
获取微信客服服务
|
WxCpLivingService |
getLivingService()
获取直播相关接口的服务类对象
|
WxCpMediaService |
getMediaService()
获取媒体相关接口的服务类对象
|
WxCpMeetingService |
getMeetingService()
相关接口的服务类对象
|
WxCpMenuService |
getMenuService()
获取菜单相关接口的服务类对象
|
WxCpMessageService |
getMessageService()
Gets message service.
|
WxCpMsgAuditService |
getMsgAuditService()
获取会话存档相关接口的服务类对象
|
WxCpOaAgentService |
getOaAgentService()
获取OA 自建应用相关接口的服务类对象
|
WxCpOaCalendarService |
getOaCalendarService()
获取日历相关接口的服务类对象
|
WxCpOaMeetingRoomService |
getOaMeetingRoomService()
获取会议室相关接口的服务类对象
|
WxCpOaScheduleService |
getOaScheduleService()
获取日程相关接口的服务类对象
|
WxCpOaService |
getOaService()
获取OA相关接口的服务类对象.
|
WxCpOAuth2Service |
getOauth2Service()
获取Oauth2相关接口的服务类对象
|
WxCpOaWeDriveService |
getOaWeDriveService()
获取OA效率工具 微盘的服务类对象
|
WxCpProviderToken |
getProviderToken(String corpId,
String providerSecret)
获取服务商凭证
文档地址:https://work.weixin.qq.com/api/doc#90001/90143/91200
请求方式:POST(HTTPS)
请求地址: https://qyapi.weixin.qq.com/cgi-bin/service/get_provider_token
|
RequestHttp<?,?> |
getRequestHttp()
http请求对象
|
WxCpSchoolHealthService |
getSchoolHealthService()
获取家校应用健康上报的服务类对象
|
WxCpSchoolService |
getSchoolService()
获取家校应用复学码相关接口的服务类对象
|
WxCpSchoolUserService |
getSchoolUserService()
获取家校沟通相关接口的服务类对象
|
WxSession |
getSession(String id)
获取某个sessionId对应的session,如果sessionId没有对应的session,则新建一个并返回。
|
WxSession |
getSession(String id,
boolean create)
获取某个sessionId对应的session,如果sessionId没有对应的session,若create为true则新建一个,否则返回null。
|
WxSessionManager |
getSessionManager()
获取WxSessionManager 对象
|
WxCpTagService |
getTagService()
获取标签相关接口的服务类对象
|
WxCpTaskCardService |
getTaskCardService()
获取任务卡片服务
|
String |
getTaskResult(String jobId)
获取异步任务结果
|
File |
getTmpDirFile()
Gets tmp dir file.
|
WxCpUserService |
getUserService()
获取用户相关接口的服务类对象
|
WxCpAgentWorkBenchService |
getWorkBenchService()
获取工作台服务
|
WxCpMaJsCode2SessionResult |
jsCode2Session(String jsCode)
小程序登录凭证校验
|
String |
post(String url,
com.google.gson.JsonObject jsonObject) |
String |
post(String url,
Object obj) |
String |
post(String url,
String postData) |
String |
post(String url,
ToJson obj) |
String |
postWithoutToken(String url,
String postData)
当不需要自动带accessToken的时候,可以用这个发起post请求
|
String |
replaceParty(String mediaId)
上传部门列表覆盖企业号上的部门信息
|
String |
replaceUser(String mediaId)
上传用户列表覆盖企业号上的用户信息
|
void |
setAgentService(WxCpAgentService agentService)
Sets agent service.
|
void |
setDepartmentService(WxCpDepartmentService departmentService)
Sets department service.
|
void |
setExportService(WxCpExportService exportService)
设置异步导出服务
|
void |
setKfService(WxCpKfService kfService)
Sets kf service.
|
void |
setMaxRetryTimes(int maxRetryTimes)
设置当微信系统响应系统繁忙时,最大重试次数
默认:5次
|
void |
setMediaService(WxCpMediaService mediaService)
Sets media service.
|
void |
setMenuService(WxCpMenuService menuService)
Sets menu service.
|
void |
setOauth2Service(WxCpOAuth2Service oauth2Service)
Sets oauth 2 service.
|
void |
setRetrySleepMillis(int retrySleepMillis)
设置当微信系统响应系统繁忙时,要等待多少 retrySleepMillis(ms) * 2^(重试次数 - 1) 再发起重试
默认:1000ms
|
void |
setSessionManager(WxSessionManager sessionManager)
设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法,
WxCpService默认使用的是
StandardSessionManager
|
void |
setTagService(WxCpTagService tagService)
Sets tag service.
|
void |
setTmpDirFile(File tmpDirFile)
Sets tmp dir file.
|
void |
setUserService(WxCpUserService userService)
Sets user service.
|
void |
setWxCpConfigStorage(WxCpConfigStorage wxConfigProvider)
注入
WxCpConfigStorage 的实现 |
String |
syncUser(String mediaId)
上传用户列表,增量更新成员
|
String |
upload(String url,
CommonUploadParam param) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessToken, getWxCpConfigStorage, initHttpgetRequestHttpClient, getRequestHttpProxy, getRequestTypeprotected final Object globalAccessTokenRefreshLock
protected final Object globalJsapiTicketRefreshLock
protected final Object globalAgentJsapiTicketRefreshLock
protected WxCpConfigStorage configStorage
public boolean checkSignature(String msgSignature, String timestamp, String nonce, String data)
WxCpService验证推送过来的消息的正确性 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=验证消息真实性
checkSignature 在接口中 WxCpServicemsgSignature - 消息签名timestamp - 时间戳nonce - 随机数data - 微信传输过来的数据,有可能是echoStr,有可能是xml消息public String getAccessToken() throws WxErrorException
WxCpServicegetAccessToken 在接口中 WxCpServiceWxErrorException - the wx error exception#getAccessToken(boolean)#getAccessToken(boolean)#getAccessToken(boolean)public String getAgentJsapiTicket() throws WxErrorException
WxCpService签名的jsapi_ticket必须使用以下接口获取。且必须用wx.agentConfig中的agentid对应的应用secret去获取access_token。 签名用的noncestr和timestamp必须与wx.agentConfig中的nonceStr和timestamp相同。
getAgentJsapiTicket 在接口中 WxCpServiceWxErrorException - the wx error exception#getJsapiTicket(boolean)#getJsapiTicket(boolean)#getJsapiTicket(boolean)public String getAgentJsapiTicket(boolean forceRefresh) throws WxErrorException
WxCpService获取应用的jsapi_ticket 应用的jsapi_ticket用于计算agentConfig(参见“通过agentConfig注入应用的权限”)的签名,签名计算方法与上述介绍的config的签名算法完全相同,但需要注意以下区别: 签名的jsapi_ticket必须使用以下接口获取。且必须用wx.agentConfig中的agentid对应的应用secret去获取access_token。 签名用的noncestr和timestamp必须与wx.agentConfig中的nonceStr和timestamp相同。 获得时会检查jsapiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干 详情请见:https://work.weixin.qq.com/api/doc#10029/%E8%8E%B7%E5%8F%96%E5%BA%94%E7%94%A8%E7%9A%84jsapi_ticket
getAgentJsapiTicket 在接口中 WxCpServiceforceRefresh - 强制刷新WxErrorException - the wx error exceptionpublic String getJsapiTicket() throws WxErrorException
WxCpServicegetJsapiTicket 在接口中 WxCpServiceWxErrorException - the wx error exception#getJsapiTicket(boolean)#getJsapiTicket(boolean)#getJsapiTicket(boolean)public String getJsapiTicket(boolean forceRefresh) throws WxErrorException
WxCpService获得jsapi_ticket 获得时会检查jsapiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干 详情请见:http://qydev.weixin.qq.com/wiki/index.php?title=微信JS接口#.E9.99.84.E5.BD.951-JS-SDK.E4.BD.BF.E7.94.A8.E6.9D.83.E9.99.90.E7.AD.BE.E5.90.8D.E7.AE.97.E6.B3.95
getJsapiTicket 在接口中 WxCpServiceforceRefresh - 强制刷新WxErrorException - the wx error exceptionpublic WxJsapiSignature createJsapiSignature(String url) throws WxErrorException
WxCpService创建调用jsapi时所需要的签名 详情请见:http://qydev.weixin.qq.com/wiki/index.php?title=微信JS接口#.E9.99.84.E5.BD.951-JS-SDK.E4.BD.BF.E7.94.A8.E6.9D.83.E9.99.90.E7.AD.BE.E5.90.8D.E7.AE.97.E6.B3.95
createJsapiSignature 在接口中 WxCpServiceurl - urlWxErrorException - the wx error exceptionpublic WxCpAgentJsapiSignature createAgentJsapiSignature(String url) throws WxErrorException
WxCpService创建调用wx.agentConfig时所需要的签名 详情请见:https://open.work.weixin.qq.com/api/doc/90000/90136/94313
createAgentJsapiSignature 在接口中 WxCpServiceurl - urlWxErrorException - the wx error exceptionpublic WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException
WxCpServicejsCode2Session 在接口中 WxCpServicejsCode - 登录时获取的 codeWxErrorException - the wx error exceptionpublic String[] getCallbackIp() throws WxErrorException
WxCpService获取企业微信回调IP段 http://qydev.weixin.qq.com/wiki/index.php?title=回调模式#.E8.8E.B7.E5.8F.96.E5.BE.AE.E4.BF.A1.E6.9C.8D.E5.8A.A1.E5.99.A8.E7.9A.84ip.E6.AE.B5
getCallbackIp 在接口中 WxCpServiceWxErrorException - the wx error exceptionpublic String[] getApiDomainIp() throws WxErrorException
WxCpService获取企业微信接口IP段 https://developer.work.weixin.qq.com/document/path/92520
getApiDomainIp 在接口中 WxCpServiceWxErrorException - the wx error exceptionpublic WxCpProviderToken getProviderToken(String corpId, String providerSecret) throws WxErrorException
WxCpService获取服务商凭证 文档地址:https://work.weixin.qq.com/api/doc#90001/90143/91200 请求方式:POST(HTTPS) 请求地址: https://qyapi.weixin.qq.com/cgi-bin/service/get_provider_token
getProviderToken 在接口中 WxCpServicecorpId - 服务商的corpidproviderSecret - 服务商的secret,在服务商管理后台可见WxErrorException - .public String get(String url, String queryParam) throws WxErrorException
get 在接口中 WxServiceWxErrorExceptionpublic String post(String url, String postData) throws WxErrorException
post 在接口中 WxServiceWxErrorExceptionpublic String post(String url, com.google.gson.JsonObject jsonObject) throws WxErrorException
post 在接口中 WxServiceWxErrorExceptionpublic String post(String url, ToJson obj) throws WxErrorException
post 在接口中 WxServiceWxErrorExceptionpublic String upload(String url, CommonUploadParam param) throws WxErrorException
upload 在接口中 WxServiceWxErrorExceptionpublic String post(String url, Object obj) throws WxErrorException
post 在接口中 WxServiceWxErrorExceptionpublic String postWithoutToken(String url, String postData) throws WxErrorException
WxCpServicepostWithoutToken 在接口中 WxCpServiceurl - 接口地址postData - 请求body字符串WxErrorException - the wx error exceptionpublic <T,E> T execute(RequestExecutor<T,E> executor, String uri, E data) throws WxErrorException
execute 在接口中 WxCpServiceT - 请求值类型E - 返回值类型executor - 执行器uri - 请求地址data - 参数WxErrorException - the wx error exceptionprotected <T,E> T executeInternal(RequestExecutor<T,E> executor, String uri, E data, boolean doNotAutoRefresh) throws WxErrorException
T - the type parameterE - the type parameterexecutor - the executoruri - the uridata - the datadoNotAutoRefresh - the do not auto refreshWxErrorException - the wx error exceptionpublic void setWxCpConfigStorage(WxCpConfigStorage wxConfigProvider)
WxCpServiceWxCpConfigStorage 的实现setWxCpConfigStorage 在接口中 WxCpServicewxConfigProvider - 配置对象public void setRetrySleepMillis(int retrySleepMillis)
WxCpService设置当微信系统响应系统繁忙时,要等待多少 retrySleepMillis(ms) * 2^(重试次数 - 1) 再发起重试 默认:1000ms
setRetrySleepMillis 在接口中 WxCpServiceretrySleepMillis - 重试休息时间public void setMaxRetryTimes(int maxRetryTimes)
WxCpService设置当微信系统响应系统繁忙时,最大重试次数 默认:5次
setMaxRetryTimes 在接口中 WxCpServicemaxRetryTimes - 最大重试次数public WxSession getSession(String id)
WxCpServicegetSession 在接口中 WxCpServiceid - id可以为任意字符串,建议使用FromUserName作为idpublic WxSession getSession(String id, boolean create)
WxCpServicegetSession 在接口中 WxCpServiceid - id可以为任意字符串,建议使用FromUserName作为idcreate - 是否新建public void setSessionManager(WxSessionManager sessionManager)
WxCpService
设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法,
WxCpService默认使用的是StandardSessionManager
setSessionManager 在接口中 WxCpServicesessionManager - 会话管理器public WxSessionManager getSessionManager()
WxCpServicegetSessionManager 在接口中 WxCpServicepublic String replaceParty(String mediaId) throws WxErrorException
WxCpServicereplaceParty 在接口中 WxCpServicemediaId - 媒体idWxErrorException - the wx error exceptionpublic String syncUser(String mediaId) throws WxErrorException
WxCpServicesyncUser 在接口中 WxCpServicemediaId - 媒体idWxErrorException - the wx error exceptionpublic String replaceUser(String mediaId) throws WxErrorException
WxCpServicereplaceUser 在接口中 WxCpServicemediaId - 媒体idWxErrorException - the wx error exceptionpublic String getTaskResult(String jobId) throws WxErrorException
WxCpServicegetTaskResult 在接口中 WxCpServicejobId - 异步任务idWxErrorException - the wx error exceptionpublic String buildQrConnectUrl(String redirectUri, String state)
WxCpServicebuildQrConnectUrl 在接口中 WxCpServiceredirectUri - 重定向地址,需要进行UrlEncodestate - 用于保持请求和回调的状态,授权请求后原样带回给企业。该参数可用于防止csrf攻击(跨站请求伪造攻击),建议企业带上该参数,可设置为简单的随机数加session进行校验public File getTmpDirFile()
public void setTmpDirFile(File tmpDirFile)
tmpDirFile - the tmp dir filepublic WxCpDepartmentService getDepartmentService()
WxCpServicegetDepartmentService 在接口中 WxCpServicepublic WxCpMediaService getMediaService()
WxCpServicegetMediaService 在接口中 WxCpServicepublic WxCpMenuService getMenuService()
WxCpServicegetMenuService 在接口中 WxCpServicepublic WxCpOAuth2Service getOauth2Service()
WxCpServicegetOauth2Service 在接口中 WxCpServicepublic WxCpTagService getTagService()
WxCpServicegetTagService 在接口中 WxCpServicepublic WxCpUserService getUserService()
WxCpServicegetUserService 在接口中 WxCpServicepublic WxCpExternalContactService getExternalContactService()
WxCpServicegetExternalContactService 在接口中 WxCpServicepublic WxCpChatService getChatService()
WxCpServicegetChatService 在接口中 WxCpServicepublic WxCpOaService getOaService()
WxCpServicegetOaService 在接口中 WxCpServicepublic WxCpSchoolService getSchoolService()
WxCpServicegetSchoolService 在接口中 WxCpServicepublic WxCpSchoolUserService getSchoolUserService()
WxCpServicegetSchoolUserService 在接口中 WxCpServicepublic WxCpSchoolHealthService getSchoolHealthService()
WxCpServicegetSchoolHealthService 在接口中 WxCpServicepublic WxCpLivingService getLivingService()
WxCpServicegetLivingService 在接口中 WxCpServicepublic WxCpOaAgentService getOaAgentService()
WxCpServicegetOaAgentService 在接口中 WxCpServicepublic WxCpOaWeDriveService getOaWeDriveService()
WxCpServicegetOaWeDriveService 在接口中 WxCpServicepublic WxCpMsgAuditService getMsgAuditService()
WxCpServicegetMsgAuditService 在接口中 WxCpServicepublic WxCpOaCalendarService getOaCalendarService()
WxCpServicegetOaCalendarService 在接口中 WxCpServicepublic WxCpOaMeetingRoomService getOaMeetingRoomService()
WxCpServicegetOaMeetingRoomService 在接口中 WxCpServicepublic WxCpGroupRobotService getGroupRobotService()
WxCpServicegetGroupRobotService 在接口中 WxCpServicepublic WxCpAgentWorkBenchService getWorkBenchService()
WxCpServicegetWorkBenchService 在接口中 WxCpServicepublic WxCpTaskCardService getTaskCardService()
WxCpServicegetTaskCardService 在接口中 WxCpServicepublic RequestHttp<?,?> getRequestHttp()
WxCpServicegetRequestHttp 在接口中 WxCpServicepublic void setUserService(WxCpUserService userService)
WxCpServicesetUserService 在接口中 WxCpServiceuserService - the user servicepublic void setDepartmentService(WxCpDepartmentService departmentService)
WxCpServicesetDepartmentService 在接口中 WxCpServicedepartmentService - the department servicepublic void setMediaService(WxCpMediaService mediaService)
WxCpServicesetMediaService 在接口中 WxCpServicemediaService - the media servicepublic void setMenuService(WxCpMenuService menuService)
WxCpServicesetMenuService 在接口中 WxCpServicemenuService - the menu servicepublic void setOauth2Service(WxCpOAuth2Service oauth2Service)
WxCpServicesetOauth2Service 在接口中 WxCpServiceoauth2Service - the oauth 2 servicepublic void setTagService(WxCpTagService tagService)
WxCpServicesetTagService 在接口中 WxCpServicetagService - the tag servicepublic WxCpAgentService getAgentService()
WxCpServicegetAgentService 在接口中 WxCpServicepublic WxCpMessageService getMessageService()
WxCpServicegetMessageService 在接口中 WxCpServicepublic void setAgentService(WxCpAgentService agentService)
agentService - the agent servicepublic WxCpOaScheduleService getOaScheduleService()
WxCpServicegetOaScheduleService 在接口中 WxCpServicepublic WxCpKfService getKfService()
WxCpServicegetKfService 在接口中 WxCpServicepublic void setKfService(WxCpKfService kfService)
WxCpServicesetKfService 在接口中 WxCpServicekfService - the kf servicepublic WxCpExportService getExportService()
WxCpServicegetExportService 在接口中 WxCpServicepublic void setExportService(WxCpExportService exportService)
WxCpServicesetExportService 在接口中 WxCpServiceexportService - 异步导出服务public WxCpMeetingService getMeetingService()
WxCpServicegetMeetingService 在接口中 WxCpServicepublic WxCpCorpGroupService getCorpGroupService()
WxCpServicegetCorpGroupService 在接口中 WxCpServiceCopyright © 2024. All rights reserved.