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, wait
getAccessToken, getWxCpConfigStorage, initHttp
getRequestHttpClient, getRequestHttpProxy, getRequestType
protected 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
在接口中 WxCpService
msgSignature
- 消息签名timestamp
- 时间戳nonce
- 随机数data
- 微信传输过来的数据,有可能是echoStr,有可能是xml消息public String getAccessToken() throws WxErrorException
WxCpService
getAccessToken
在接口中 WxCpService
WxErrorException
- 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
在接口中 WxCpService
WxErrorException
- 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
在接口中 WxCpService
forceRefresh
- 强制刷新WxErrorException
- the wx error exceptionpublic String getJsapiTicket() throws WxErrorException
WxCpService
getJsapiTicket
在接口中 WxCpService
WxErrorException
- 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
在接口中 WxCpService
forceRefresh
- 强制刷新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
在接口中 WxCpService
url
- 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
在接口中 WxCpService
url
- urlWxErrorException
- the wx error exceptionpublic WxCpMaJsCode2SessionResult jsCode2Session(String jsCode) throws WxErrorException
WxCpService
jsCode2Session
在接口中 WxCpService
jsCode
- 登录时获取的 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
在接口中 WxCpService
WxErrorException
- the wx error exceptionpublic String[] getApiDomainIp() throws WxErrorException
WxCpService
获取企业微信接口IP段 https://developer.work.weixin.qq.com/document/path/92520
getApiDomainIp
在接口中 WxCpService
WxErrorException
- 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
在接口中 WxCpService
corpId
- 服务商的corpidproviderSecret
- 服务商的secret,在服务商管理后台可见WxErrorException
- .public String get(String url, String queryParam) throws WxErrorException
get
在接口中 WxService
WxErrorException
public String post(String url, String postData) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String post(String url, com.google.gson.JsonObject jsonObject) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String post(String url, ToJson obj) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String upload(String url, CommonUploadParam param) throws WxErrorException
upload
在接口中 WxService
WxErrorException
public String post(String url, Object obj) throws WxErrorException
post
在接口中 WxService
WxErrorException
public String postWithoutToken(String url, String postData) throws WxErrorException
WxCpService
postWithoutToken
在接口中 WxCpService
url
- 接口地址postData
- 请求body字符串WxErrorException
- the wx error exceptionpublic <T,E> T execute(RequestExecutor<T,E> executor, String uri, E data) throws WxErrorException
execute
在接口中 WxCpService
T
- 请求值类型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)
WxCpService
WxCpConfigStorage
的实现setWxCpConfigStorage
在接口中 WxCpService
wxConfigProvider
- 配置对象public void setRetrySleepMillis(int retrySleepMillis)
WxCpService
设置当微信系统响应系统繁忙时,要等待多少 retrySleepMillis(ms) * 2^(重试次数 - 1) 再发起重试 默认:1000ms
setRetrySleepMillis
在接口中 WxCpService
retrySleepMillis
- 重试休息时间public void setMaxRetryTimes(int maxRetryTimes)
WxCpService
设置当微信系统响应系统繁忙时,最大重试次数 默认:5次
setMaxRetryTimes
在接口中 WxCpService
maxRetryTimes
- 最大重试次数public WxSession getSession(String id)
WxCpService
getSession
在接口中 WxCpService
id
- id可以为任意字符串,建议使用FromUserName作为idpublic WxSession getSession(String id, boolean create)
WxCpService
getSession
在接口中 WxCpService
id
- id可以为任意字符串,建议使用FromUserName作为idcreate
- 是否新建public void setSessionManager(WxSessionManager sessionManager)
WxCpService
设置WxSessionManager,只有当需要使用个性化的WxSessionManager的时候才需要调用此方法,
WxCpService默认使用的是StandardSessionManager
setSessionManager
在接口中 WxCpService
sessionManager
- 会话管理器public WxSessionManager getSessionManager()
WxCpService
getSessionManager
在接口中 WxCpService
public String replaceParty(String mediaId) throws WxErrorException
WxCpService
replaceParty
在接口中 WxCpService
mediaId
- 媒体idWxErrorException
- the wx error exceptionpublic String syncUser(String mediaId) throws WxErrorException
WxCpService
syncUser
在接口中 WxCpService
mediaId
- 媒体idWxErrorException
- the wx error exceptionpublic String replaceUser(String mediaId) throws WxErrorException
WxCpService
replaceUser
在接口中 WxCpService
mediaId
- 媒体idWxErrorException
- the wx error exceptionpublic String getTaskResult(String jobId) throws WxErrorException
WxCpService
getTaskResult
在接口中 WxCpService
jobId
- 异步任务idWxErrorException
- the wx error exceptionpublic String buildQrConnectUrl(String redirectUri, String state)
WxCpService
buildQrConnectUrl
在接口中 WxCpService
redirectUri
- 重定向地址,需要进行UrlEncodestate
- 用于保持请求和回调的状态,授权请求后原样带回给企业。该参数可用于防止csrf攻击(跨站请求伪造攻击),建议企业带上该参数,可设置为简单的随机数加session进行校验public File getTmpDirFile()
public void setTmpDirFile(File tmpDirFile)
tmpDirFile
- the tmp dir filepublic WxCpDepartmentService getDepartmentService()
WxCpService
getDepartmentService
在接口中 WxCpService
public WxCpMediaService getMediaService()
WxCpService
getMediaService
在接口中 WxCpService
public WxCpMenuService getMenuService()
WxCpService
getMenuService
在接口中 WxCpService
public WxCpOAuth2Service getOauth2Service()
WxCpService
getOauth2Service
在接口中 WxCpService
public WxCpTagService getTagService()
WxCpService
getTagService
在接口中 WxCpService
public WxCpUserService getUserService()
WxCpService
getUserService
在接口中 WxCpService
public WxCpExternalContactService getExternalContactService()
WxCpService
getExternalContactService
在接口中 WxCpService
public WxCpChatService getChatService()
WxCpService
getChatService
在接口中 WxCpService
public WxCpOaService getOaService()
WxCpService
getOaService
在接口中 WxCpService
public WxCpSchoolService getSchoolService()
WxCpService
getSchoolService
在接口中 WxCpService
public WxCpSchoolUserService getSchoolUserService()
WxCpService
getSchoolUserService
在接口中 WxCpService
public WxCpSchoolHealthService getSchoolHealthService()
WxCpService
getSchoolHealthService
在接口中 WxCpService
public WxCpLivingService getLivingService()
WxCpService
getLivingService
在接口中 WxCpService
public WxCpOaAgentService getOaAgentService()
WxCpService
getOaAgentService
在接口中 WxCpService
public WxCpOaWeDriveService getOaWeDriveService()
WxCpService
getOaWeDriveService
在接口中 WxCpService
public WxCpMsgAuditService getMsgAuditService()
WxCpService
getMsgAuditService
在接口中 WxCpService
public WxCpOaCalendarService getOaCalendarService()
WxCpService
getOaCalendarService
在接口中 WxCpService
public WxCpOaMeetingRoomService getOaMeetingRoomService()
WxCpService
getOaMeetingRoomService
在接口中 WxCpService
public WxCpGroupRobotService getGroupRobotService()
WxCpService
getGroupRobotService
在接口中 WxCpService
public WxCpAgentWorkBenchService getWorkBenchService()
WxCpService
getWorkBenchService
在接口中 WxCpService
public WxCpTaskCardService getTaskCardService()
WxCpService
getTaskCardService
在接口中 WxCpService
public RequestHttp<?,?> getRequestHttp()
WxCpService
getRequestHttp
在接口中 WxCpService
public void setUserService(WxCpUserService userService)
WxCpService
setUserService
在接口中 WxCpService
userService
- the user servicepublic void setDepartmentService(WxCpDepartmentService departmentService)
WxCpService
setDepartmentService
在接口中 WxCpService
departmentService
- the department servicepublic void setMediaService(WxCpMediaService mediaService)
WxCpService
setMediaService
在接口中 WxCpService
mediaService
- the media servicepublic void setMenuService(WxCpMenuService menuService)
WxCpService
setMenuService
在接口中 WxCpService
menuService
- the menu servicepublic void setOauth2Service(WxCpOAuth2Service oauth2Service)
WxCpService
setOauth2Service
在接口中 WxCpService
oauth2Service
- the oauth 2 servicepublic void setTagService(WxCpTagService tagService)
WxCpService
setTagService
在接口中 WxCpService
tagService
- the tag servicepublic WxCpAgentService getAgentService()
WxCpService
getAgentService
在接口中 WxCpService
public WxCpMessageService getMessageService()
WxCpService
getMessageService
在接口中 WxCpService
public void setAgentService(WxCpAgentService agentService)
agentService
- the agent servicepublic WxCpOaScheduleService getOaScheduleService()
WxCpService
getOaScheduleService
在接口中 WxCpService
public WxCpKfService getKfService()
WxCpService
getKfService
在接口中 WxCpService
public void setKfService(WxCpKfService kfService)
WxCpService
setKfService
在接口中 WxCpService
kfService
- the kf servicepublic WxCpExportService getExportService()
WxCpService
getExportService
在接口中 WxCpService
public void setExportService(WxCpExportService exportService)
WxCpService
setExportService
在接口中 WxCpService
exportService
- 异步导出服务public WxCpMeetingService getMeetingService()
WxCpService
getMeetingService
在接口中 WxCpService
public WxCpCorpGroupService getCorpGroupService()
WxCpService
getCorpGroupService
在接口中 WxCpService
Copyright © 2024. All rights reserved.