@EnableConfigurationProperties(value=WXWorkProperties.class) @Service public class WXWorkServiceImpl extends Object implements WXWorkService, org.springframework.beans.factory.InitializingBean
| 限定符和类型 | 字段和说明 |
|---|---|
static com.google.gson.Gson |
GSON |
static String |
WXWORK_ALIAS |
| 构造器和说明 |
|---|
WXWorkServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
Map<String,Object> |
callback(Integer callbackIndex,
String msg_signature,
String timestamp,
String nonce,
String xml,
javax.servlet.http.HttpServletResponse response)
处理 callback
|
static String |
dealCurrentPageUrl(String currentPageUrl)
处理当前页面 url
|
byte[] |
downloadTemp(Integer appIndex,
String mediaId)
获取临时素材
|
byte[] |
downloadVoice(Integer appIndex,
String mediaId)
获取高清语音素材
|
AgentConfigSignatureResponseDTO |
getAgentConfigSignature(Integer appIndex,
String currentPageUrl)
获取 agentConfig 签名
|
CallbackIpResponseDTO |
getCallbackIp(Integer appIndex)
获取企业微信服务器的 ip 段
|
CheckinDataResponseDTO |
getCheckinData(Integer openCheckinDataType,
Long startTime,
Long endTime,
List<String> userIdList)
获取打卡记录(token 必须由打卡 secret 获取)
|
ConfigSignatureResponseDTO |
getConfigSignature(Integer appIndex,
String currentPageUrl)
获取 config 签名
|
DepartmentInfoResponseDTO |
getDepartmentInfo(Integer appIndex,
Integer departmentId)
获取 department 部门列表
|
DepartmentUserResponseDTO |
getDepartmentUser(Integer appIndex,
Integer departmentId,
Integer fetchChild)
获取 department 部门 user 简单信息
|
String |
getJsapiTicket(Integer appIndex)
获取 jsapi_ticket
|
String |
getJsapiTicketAgent(Integer appIndex)
获取 jsapi_ticket_agent
|
String |
getJsapiTicketAgentCache(Integer appIndex)
获取 jsapi_ticket_agent 缓存
|
String |
getJsapiTicketCache(Integer appIndex)
获取 jsapi_ticket 缓存
|
TagInfoResponseDTO |
getTagInfo()
获取 tag 标签列表(token 必须由通讯录 secret 获取)
|
TagUserResponseDTO |
getTagUser(Integer tagId)
获取 tag 标签 user 简单信息(token 必须由通讯录 secret 获取)
|
String |
getToken(Integer appIndex)
获取 token
|
String |
getTokenCache(Integer appIndex)
获取 token 缓存
|
UserIdResponseDTO |
getUserId(Integer appIndex,
String code)
获取工号
|
UserInfoResponseDTO |
getUserInfo(Integer appIndex,
String userId)
获取 user 信息
|
AppMsgResponseDTO |
sendAppMarkdownMsg(Integer appIndex,
AppMarkdownMsgRequestDTO object)
发送应用 markdown 消息
|
org.springframework.http.HttpEntity<String> |
sendAppMsg(Integer appIndex,
String json)
发送应用消息
|
AppMsgResponseDTO |
sendAppTextMsg(Integer appIndex,
AppTextMsgRequestDTO object)
发送应用文本消息
|
BotMsgResponseDTO |
sendBotMarkdownMsg(Integer botIndex,
BotMarkdownMsgRequestDTO object)
发送机器人 markdown 消息
|
org.springframework.http.HttpEntity<String> |
sendBotMsg(Integer botIndex,
String json)
发送机器人消息
|
BotMsgResponseDTO |
sendBotTextMsg(Integer botIndex,
BotTextMsgRequestDTO object)
发送机器人文本消息
|
AppUploadImageResponseDTO |
uploadImage(Integer appIndex,
String filePath)
上传图片
|
AppUploadTempResponseDTO |
uploadTemp(Integer appIndex,
UploadTempType tempType,
String filePath)
上传临时素材
|
boolean |
verifyUrl(Integer callbackIndex,
String msg_signature,
String timestamp,
String nonce,
String echostr,
javax.servlet.http.HttpServletResponse response)
验证 url
|
public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanpublic UserIdResponseDTO getUserId(Integer appIndex, String code)
WXWorkServicegetUserId 在接口中 WXWorkServiceappIndex - 索引code - 企业微信返回一次性 code,5 分钟内有效UserIdResponseDTOpublic UserInfoResponseDTO getUserInfo(Integer appIndex, String userId)
WXWorkServicegetUserInfo 在接口中 WXWorkServiceappIndex - 索引userId - 工号UserInfoResponseDTOpublic DepartmentInfoResponseDTO getDepartmentInfo(Integer appIndex, Integer departmentId)
WXWorkServicegetDepartmentInfo 在接口中 WXWorkServiceappIndex - 索引departmentId - 部门 id,获取指定部门及其下的子部门(以及及子部门的子部门等等,递归),如果不填,默认获取全量组织架构DepartmentInfoResponseDTOpublic DepartmentUserResponseDTO getDepartmentUser(Integer appIndex, Integer departmentId, Integer fetchChild)
WXWorkServicegetDepartmentUser 在接口中 WXWorkServiceappIndex - 索引departmentId - 部门 idfetchChild - 是否递归获取子部门下面的成员(1-递归获取,0-只获取本部门)DepartmentUserResponseDTOpublic TagInfoResponseDTO getTagInfo()
WXWorkServicegetTagInfo 在接口中 WXWorkServiceTagInfoResponseDTOpublic TagUserResponseDTO getTagUser(Integer tagId)
WXWorkServicegetTagUser 在接口中 WXWorkServicetagId - 标签 idTagUserResponseDTOpublic AppMsgResponseDTO sendAppTextMsg(Integer appIndex, AppTextMsgRequestDTO object)
WXWorkServicesendAppTextMsg 在接口中 WXWorkServiceappIndex - 索引object - AppTextMsgRequestDTOAppMsgResponseDTOpublic AppMsgResponseDTO sendAppMarkdownMsg(Integer appIndex, AppMarkdownMsgRequestDTO object)
WXWorkServicesendAppMarkdownMsg 在接口中 WXWorkServiceappIndex - 索引object - AppMarkdownMsgRequestDTOAppMsgResponseDTOpublic org.springframework.http.HttpEntity<String> sendAppMsg(Integer appIndex, String json)
appIndex - 索引json - JSONHttpEntitypublic AppUploadTempResponseDTO uploadTemp(Integer appIndex, UploadTempType tempType, String filePath) throws IOException
WXWorkServiceuploadTemp 在接口中 WXWorkServiceappIndex - 索引tempType - UploadTempTypefilePath - 临时素材绝对路径AppUploadTempResponseDTOIOException - 异常public AppUploadImageResponseDTO uploadImage(Integer appIndex, String filePath) throws IOException
WXWorkServiceuploadImage 在接口中 WXWorkServiceappIndex - 索引filePath - 图片绝对路径AppUploadImageResponseDTOIOException - 异常public byte[] downloadTemp(Integer appIndex, String mediaId)
WXWorkServicedownloadTemp 在接口中 WXWorkServiceappIndex - 索引mediaId - 媒体文件 idpublic byte[] downloadVoice(Integer appIndex, String mediaId)
WXWorkServicedownloadVoice 在接口中 WXWorkServiceappIndex - 索引mediaId - 媒体文件 idpublic CheckinDataResponseDTO getCheckinData(Integer openCheckinDataType, Long startTime, Long endTime, List<String> userIdList)
WXWorkServicegetCheckinData 在接口中 WXWorkServiceopenCheckinDataType - 打卡类型(1-上下班打卡,2-外出打卡,3-全部打卡)startTime - 获取打卡记录的开始时间(10 位 Unix 时间戳)endTime - 获取打卡记录的结束时间(10 位 Unix 时间戳)userIdList - 工号集合(至多 100 个)CheckinDataResponseDTOpublic String getTokenCache(Integer appIndex)
WXWorkServicegetTokenCache 在接口中 WXWorkServiceappIndex - 索引public String getJsapiTicketCache(Integer appIndex)
WXWorkServicegetJsapiTicketCache 在接口中 WXWorkServiceappIndex - 索引public String getJsapiTicket(Integer appIndex)
appIndex - 索引public String getJsapiTicketAgentCache(Integer appIndex)
WXWorkServicegetJsapiTicketAgentCache 在接口中 WXWorkServiceappIndex - 索引public String getJsapiTicketAgent(Integer appIndex)
appIndex - 索引public boolean verifyUrl(Integer callbackIndex, String msg_signature, String timestamp, String nonce, String echostr, javax.servlet.http.HttpServletResponse response)
WXWorkServiceverifyUrl 在接口中 WXWorkServicecallbackIndex - 索引msg_signature - 企业微信加密签名,msg_signature计算结合了企业填写的token、请求中的timestamp、nonce、加密的消息体timestamp - 时间戳(与nonce结合使用,用于防止请求重放攻击)nonce - 随机数(与timestamp结合使用,用于防止请求重放攻击)echostr - 加密的字符串(需要解密得到消息内容明文,解密后有random、msg_len、msg、receiveid四个字段,其中msg即为消息内容明文)response - 响应public Map<String,Object> callback(Integer callbackIndex, String msg_signature, String timestamp, String nonce, String xml, javax.servlet.http.HttpServletResponse response)
WXWorkServicecallback 在接口中 WXWorkServicecallbackIndex - 索引msg_signature - 企业微信加密签名,msg_signature结合了企业填写的token、请求中的timestamp、nonce参数、加密的消息体timestamp - 时间戳(与nonce结合使用,用于防止请求重放攻击)nonce - 随机数(与timestamp结合使用,用于防止请求重放攻击)xml - 回调数据(放在 HTTP 请求体中,使用 @RequestBody 注解接收)response - 响应Mappublic ConfigSignatureResponseDTO getConfigSignature(Integer appIndex, String currentPageUrl)
WXWorkServicegetConfigSignature 在接口中 WXWorkServiceappIndex - 索引currentPageUrl - 当前页面 urlConfigSignatureResponseDTOpublic AgentConfigSignatureResponseDTO getAgentConfigSignature(Integer appIndex, String currentPageUrl)
WXWorkServicegetAgentConfigSignature 在接口中 WXWorkServiceappIndex - 索引currentPageUrl - 当前页面 urlAgentConfigSignatureResponseDTOpublic static String dealCurrentPageUrl(String currentPageUrl)
currentPageUrl - 当前页面 urlpublic CallbackIpResponseDTO getCallbackIp(Integer appIndex)
WXWorkServicegetCallbackIp 在接口中 WXWorkServiceappIndex - 索引CallbackIpResponseDTOpublic BotMsgResponseDTO sendBotTextMsg(Integer botIndex, BotTextMsgRequestDTO object)
WXWorkServicesendBotTextMsg 在接口中 WXWorkServicebotIndex - 索引object - BotTextMsgRequestDTOBotMsgResponseDTOpublic BotMsgResponseDTO sendBotMarkdownMsg(Integer botIndex, BotMarkdownMsgRequestDTO object)
WXWorkServicesendBotMarkdownMsg 在接口中 WXWorkServicebotIndex - 索引object - BotMarkdownMsgRequestDTOBotMsgResponseDTOCopyright © 2021. All rights reserved.