repo
stringclasses
1k values
file_url
stringlengths
96
373
file_path
stringlengths
11
294
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
6 values
commit_sha
stringclasses
1k values
retrieved_at
stringdate
2026-01-04 14:45:56
2026-01-04 18:30:23
truncated
bool
2 classes
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceJoddHttpImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceJoddHttpImpl.java
package me.chanjar.weixin.cp.api.impl; import jodd.http.HttpConnectionProvider; import jodd.http.HttpRequest; import jodd.http.HttpResponse; import jodd.http.ProxyInfo; import jodd.http.net.SocketHttpConnectionProvider; import me.chanjar.weixin.common.bean.WxAccessToken; import me.chanjar.weixin.common.enums.WxType; import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.http.HttpClientType; import me.chanjar.weixin.cp.config.WxCpConfigStorage; import me.chanjar.weixin.cp.constant.WxCpApiPathConsts; /** * The type Wx cp service jodd http. * * @author someone */ public class WxCpServiceJoddHttpImpl extends BaseWxCpServiceImpl<HttpConnectionProvider, ProxyInfo> { private HttpConnectionProvider httpClient; private ProxyInfo httpProxy; @Override public HttpConnectionProvider getRequestHttpClient() { return httpClient; } @Override public ProxyInfo getRequestHttpProxy() { return httpProxy; } @Override public HttpClientType getRequestType() { return HttpClientType.JODD_HTTP; } @Override public String getAccessToken(boolean forceRefresh) throws WxErrorException { if (!this.configStorage.isAccessTokenExpired() && !forceRefresh) { return this.configStorage.getAccessToken(); } synchronized (this.globalAccessTokenRefreshLock) { HttpRequest request = HttpRequest.get(String.format(this.configStorage.getApiUrl(WxCpApiPathConsts.GET_TOKEN), this.configStorage.getCorpId(), this.configStorage.getCorpSecret())); if (this.httpProxy != null) { httpClient.useProxy(this.httpProxy); } request.withConnectionProvider(httpClient); HttpResponse response = request.send(); String resultContent = response.bodyText(); WxError error = WxError.fromJson(resultContent, WxType.CP); if (error.getErrorCode() != 0) { throw new WxErrorException(error); } WxAccessToken accessToken = WxAccessToken.fromJson(resultContent); this.configStorage.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn()); } return this.configStorage.getAccessToken(); } @Override public void initHttp() { if (this.configStorage.getHttpProxyHost() != null && this.configStorage.getHttpProxyPort() > 0) { httpProxy = new ProxyInfo(ProxyInfo.ProxyType.HTTP, configStorage.getHttpProxyHost(), configStorage.getHttpProxyPort(), configStorage.getHttpProxyUsername(), configStorage.getHttpProxyPassword()); } httpClient = new SocketHttpConnectionProvider(); } @Override public WxCpConfigStorage getWxCpConfigStorage() { return this.configStorage; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.ExternalContact.*; import com.google.gson.Gson; import com.google.gson.JsonObject; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Collections; import java.util.Date; import java.util.List; import java.util.UUID; import lombok.NonNull; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.bean.result.WxMediaUploadResult; import me.chanjar.weixin.common.error.WxCpErrorMsgEnum; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxRuntimeException; import me.chanjar.weixin.common.util.BeanUtils; import me.chanjar.weixin.common.util.fs.FileUtils; import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor; import me.chanjar.weixin.common.util.json.GsonHelper; import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.cp.api.WxCpExternalContactService; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.bean.external.*; import me.chanjar.weixin.cp.bean.external.acquisition.*; import me.chanjar.weixin.cp.bean.external.contact.*; import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRule; import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRuleAddRequest; import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRuleInfo; import me.chanjar.weixin.cp.bean.external.interceptrule.WxCpInterceptRuleList; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; /** * The type Wx cp external contact service. * * @author 曹祖鹏 & yuanqixun & Mr.Pan & Wang_Wong */ @RequiredArgsConstructor public class WxCpExternalContactServiceImpl implements WxCpExternalContactService { private final WxCpService mainService; @Override public WxCpContactWayResult addContactWay(WxCpContactWayInfo info) throws WxErrorException { if (info.getContactWay().getUsers() != null && info.getContactWay().getUsers().size() > 100) { throw new WxRuntimeException("「联系我」使用人数默认限制不超过100人(包括部门展开后的人数)"); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(ADD_CONTACT_WAY); return WxCpContactWayResult.fromJson(this.mainService.post(url, info.getContactWay().toJson())); } @Override public WxCpContactWayInfo getContactWay(String configId) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("config_id", configId); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CONTACT_WAY); return WxCpContactWayInfo.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpContactWayList listContactWay(Long startTime, Long endTime, String cursor, Long limit) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("start_time", startTime); json.addProperty("end_time", endTime); json.addProperty("cursor", cursor); json.addProperty("limit", limit); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(LIST_CONTACT_WAY); return WxCpContactWayList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpBaseResp updateContactWay(WxCpContactWayInfo info) throws WxErrorException { if (StringUtils.isBlank(info.getContactWay().getConfigId())) { throw new WxRuntimeException("更新「联系我」方式需要指定configId"); } if (info.getContactWay().getUsers() != null && info.getContactWay().getUsers().size() > 100) { throw new WxRuntimeException("「联系我」使用人数默认限制不超过100人(包括部门展开后的人数)"); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UPDATE_CONTACT_WAY); return WxCpBaseResp.fromJson(this.mainService.post(url, info.getContactWay().toJson())); } @Override public WxCpBaseResp deleteContactWay(String configId) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("config_id", configId); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEL_CONTACT_WAY); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpBaseResp closeTempChat(String userId, String externalUserId) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("userid", userId); json.addProperty("external_userid", externalUserId); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(CLOSE_TEMP_CHAT); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpExternalContactInfo getExternalContact(String externalUserId) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_EXTERNAL_CONTACT + externalUserId); return WxCpExternalContactInfo.fromJson(this.mainService.get(url, null)); } @Override public WxCpExternalContactInfo getContactDetail(String externalUserId, String cursor) throws WxErrorException { String params = externalUserId; if (StringUtils.isNotEmpty(cursor)) { params = params + "&cursor=" + cursor; } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CONTACT_DETAIL + params); return WxCpExternalContactInfo.fromJson(this.mainService.get(url, null)); } @Override public String convertToOpenid(String externalUserId) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("external_userid", externalUserId); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(CONVERT_TO_OPENID); String responseContent = this.mainService.post(url, json.toString()); return GsonParser.parse(responseContent).get("openid").getAsString(); } @Override public String unionidToExternalUserid(String unionid, String openid) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("unionid", unionid); if (StringUtils.isNotEmpty(openid)) { json.addProperty("openid", openid); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UNIONID_TO_EXTERNAL_USERID); String responseContent = this.mainService.post(url, json.toString()); return GsonParser.parse(responseContent).get("external_userid").getAsString(); } @Override public String toServiceExternalUserid(String externalUserid) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("external_userid", externalUserid); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(TO_SERVICE_EXTERNAL_USERID); String responseContent = this.mainService.post(url, json.toString()); return GsonParser.parse(responseContent).get("external_userid").getAsString(); } @Override public String fromServiceExternalUserid(String externalUserid, String sourceAgentId) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("external_userid", externalUserid); json.addProperty("source_agentid", sourceAgentId); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(FROM_SERVICE_EXTERNAL_USERID); String responseContent = this.mainService.post(url, json.toString()); return GsonParser.parse(responseContent).get("external_userid").getAsString(); } @Override public WxCpExternalUserIdList unionidToExternalUserid3rd(String unionid, String openid, String corpid) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("unionid", unionid); json.addProperty("openid", openid); if (StringUtils.isNotEmpty(corpid)) { json.addProperty("corpid", corpid); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UNIONID_TO_EXTERNAL_USERID_3RD); return WxCpExternalUserIdList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpNewExternalUserIdList getNewExternalUserId(String[] externalUserIdList) throws WxErrorException { JsonObject json = new JsonObject(); if (ArrayUtils.isNotEmpty(externalUserIdList)) { json.add("external_userid_list", new Gson().toJsonTree(externalUserIdList).getAsJsonArray()); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_NEW_EXTERNAL_USERID); return WxCpNewExternalUserIdList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpBaseResp finishExternalUserIdMigration(String corpid) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("corpid", corpid); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(FINISH_EXTERNAL_USERID_MIGRATION); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public String opengidToChatid(String opengid) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("opengid", opengid); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(OPENID_TO_CHATID); String responseContent = this.mainService.post(url, json.toString()); return GsonParser.parse(responseContent).get("chat_id").getAsString(); } @Override public WxCpExternalContactBatchInfo getContactDetailBatch(String[] userIdList, String cursor, Integer limit) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CONTACT_DETAIL_BATCH); JsonObject json = new JsonObject(); json.add("userid_list", new Gson().toJsonTree(userIdList).getAsJsonArray()); if (StringUtils.isNotBlank(cursor)) { json.addProperty("cursor", cursor); } if (limit != null) { json.addProperty("limit", limit); } String responseContent = this.mainService.post(url, json.toString()); return WxCpExternalContactBatchInfo.fromJson(responseContent); } @Override public WxCpExternalContactListInfo getContactList(String cursor, Integer limit) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CONTACT_LIST); JsonObject json = new JsonObject(); if (StringUtils.isNotBlank(cursor)) { json.addProperty("cursor", cursor); } if (limit != null) { json.addProperty("limit", limit); } String responseContent = this.mainService.post(url, json.toString()); return WxCpExternalContactListInfo.fromJson(responseContent); } @Override public void updateRemark(WxCpUpdateRemarkRequest request) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UPDATE_REMARK); this.mainService.post(url, request.toJson()); } @Override public List<String> listExternalContacts(String userId) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(LIST_EXTERNAL_CONTACT + userId); try { String responseContent = this.mainService.get(url, null); return WxCpUserExternalContactList.fromJson(responseContent).getExternalUserId(); } catch (WxErrorException e) { // not external contact,无客户则返回空列表 if (e.getError().getErrorCode() == WxCpErrorMsgEnum.CODE_84061.getCode()) { return Collections.emptyList(); } throw e; } } @Override public List<String> listFollowers() throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_FOLLOW_USER_LIST); String responseContent = this.mainService.get(url, null); return WxCpUserWithExternalPermission.fromJson(responseContent).getFollowers(); } @Override public WxCpUserExternalUnassignList listUnassignedList(Integer pageIndex, String cursor, Integer pageSize) throws WxErrorException { JsonObject json = new JsonObject(); if (pageIndex != null) { json.addProperty("page_id", pageIndex); } json.addProperty("cursor", StringUtils.isEmpty(cursor) ? "" : cursor); json.addProperty("page_size", pageSize == null ? 1000 : pageSize); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(LIST_UNASSIGNED_CONTACT); return WxCpUserExternalUnassignList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpBaseResp transferExternalContact(String externalUserid, String handOverUserid, String takeOverUserid) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("external_userid", externalUserid); json.addProperty("handover_userid", handOverUserid); json.addProperty("takeover_userid", takeOverUserid); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(TRANSFER_UNASSIGNED_CONTACT); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserTransferCustomerResp transferCustomer(WxCpUserTransferCustomerReq req) throws WxErrorException { BeanUtils.checkRequiredFields(req); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(TRANSFER_CUSTOMER); final String result = this.mainService.post(url, req.toJson()); return WxCpUserTransferCustomerResp.fromJson(result); } @Override public WxCpUserTransferResultResp transferResult(String handOverUserid, String takeOverUserid, String cursor) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("cursor", cursor); json.addProperty("handover_userid", handOverUserid); json.addProperty("takeover_userid", takeOverUserid); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(TRANSFER_RESULT); return WxCpUserTransferResultResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserTransferCustomerResp resignedTransferCustomer(WxCpUserTransferCustomerReq req) throws WxErrorException { BeanUtils.checkRequiredFields(req); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(RESIGNED_TRANSFER_CUSTOMER); return WxCpUserTransferCustomerResp.fromJson(this.mainService.post(url, req.toJson())); } @Override public WxCpUserTransferResultResp resignedTransferResult(String handOverUserid, String takeOverUserid, String cursor) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("cursor", cursor); json.addProperty("handover_userid", handOverUserid); json.addProperty("takeover_userid", takeOverUserid); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(RESIGNED_TRANSFER_RESULT); return WxCpUserTransferResultResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalGroupChatList listGroupChat(Integer pageIndex, Integer pageSize, int status, String[] userIds, String[] partyIds) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("offset", pageIndex == null ? 0 : pageIndex); json.addProperty("limit", pageSize == null ? 100 : pageSize); json.addProperty("status_filter", status); if (ArrayUtils.isNotEmpty(userIds) || ArrayUtils.isNotEmpty(partyIds)) { JsonObject ownerFilter = new JsonObject(); if (ArrayUtils.isNotEmpty(userIds)) { ownerFilter.add("userid_list", new Gson().toJsonTree(userIds).getAsJsonArray()); } if (ArrayUtils.isNotEmpty(partyIds)) { ownerFilter.add("partyid_list", new Gson().toJsonTree(partyIds).getAsJsonArray()); } json.add("owner_filter", ownerFilter); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_LIST); return WxCpUserExternalGroupChatList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalGroupChatList listGroupChat(Integer limit, String cursor, int status, String[] userIds) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("cursor", cursor == null ? "" : cursor); json.addProperty("limit", limit == null ? 100 : limit); json.addProperty("status_filter", status); if (ArrayUtils.isNotEmpty(userIds)) { JsonObject ownerFilter = new JsonObject(); if (ArrayUtils.isNotEmpty(userIds)) { ownerFilter.add("userid_list", new Gson().toJsonTree(userIds).getAsJsonArray()); } json.add("owner_filter", ownerFilter); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_LIST); return WxCpUserExternalGroupChatList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalGroupChatInfo getGroupChat(String chatId, Integer needName) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("chat_id", chatId); json.addProperty("need_name", needName); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_INFO); return WxCpUserExternalGroupChatInfo.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalGroupChatTransferResp transferGroupChat(String[] chatIds, String newOwner) throws WxErrorException { JsonObject json = new JsonObject(); if (ArrayUtils.isNotEmpty(chatIds)) { json.add("chat_id_list", new Gson().toJsonTree(chatIds).getAsJsonArray()); } json.addProperty("new_owner", newOwner); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_TRANSFER); return WxCpUserExternalGroupChatTransferResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalGroupChatTransferResp onjobTransferGroupChat(String[] chatIds, String newOwner) throws WxErrorException { JsonObject json = new JsonObject(); if (ArrayUtils.isNotEmpty(chatIds)) { json.add("chat_id_list", new Gson().toJsonTree(chatIds).getAsJsonArray()); } json.addProperty("new_owner", newOwner); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_ONJOB_TRANSFER); return WxCpUserExternalGroupChatTransferResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalUserBehaviorStatistic getUserBehaviorStatistic(Date startTime, Date endTime, String[] userIds, String[] partyIds) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("start_time", startTime.getTime() / 1000); json.addProperty("end_time", endTime.getTime() / 1000); if (ArrayUtils.isNotEmpty(userIds) || ArrayUtils.isNotEmpty(partyIds)) { if (ArrayUtils.isNotEmpty(userIds)) { json.add("userid", new Gson().toJsonTree(userIds).getAsJsonArray()); } if (ArrayUtils.isNotEmpty(partyIds)) { json.add("partyid", new Gson().toJsonTree(partyIds).getAsJsonArray()); } } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(LIST_USER_BEHAVIOR_DATA); return WxCpUserExternalUserBehaviorStatistic.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalGroupChatStatistic getGroupChatStatistic(Date startTime, Integer orderBy, Integer orderAsc, Integer pageIndex, Integer pageSize, String[] userIds, String[] partyIds) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("day_begin_time", startTime.getTime() / 1000); json.addProperty("order_by", orderBy == null ? 1 : orderBy); json.addProperty("order_asc", orderAsc == null ? 0 : orderAsc); json.addProperty("offset", pageIndex == null ? 0 : pageIndex); json.addProperty("limit", pageSize == null ? 500 : pageSize); if (ArrayUtils.isNotEmpty(userIds) || ArrayUtils.isNotEmpty(partyIds)) { JsonObject ownerFilter = new JsonObject(); if (ArrayUtils.isNotEmpty(userIds)) { ownerFilter.add("userid_list", new Gson().toJsonTree(userIds).getAsJsonArray()); } if (ArrayUtils.isNotEmpty(partyIds)) { ownerFilter.add("partyid_list", new Gson().toJsonTree(partyIds).getAsJsonArray()); } json.add("owner_filter", ownerFilter); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(LIST_GROUP_CHAT_DATA); return WxCpUserExternalGroupChatStatistic.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpMsgTemplateAddResult addMsgTemplate(WxCpMsgTemplate wxCpMsgTemplate) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(ADD_MSG_TEMPLATE); return WxCpMsgTemplateAddResult.fromJson(this.mainService.post(url, wxCpMsgTemplate.toJson())); } @Override public WxCpBaseResp remindGroupMsgSend(String msgId) throws WxErrorException { JsonObject params = new JsonObject(); params.addProperty("msgid", msgId); final String url = this.mainService.getWxCpConfigStorage() .getApiUrl(REMIND_GROUP_MSG_SEND); return WxCpBaseResp.fromJson(this.mainService.post(url, params.toString())); } @Override public WxCpBaseResp cancelGroupMsgSend(String msgId) throws WxErrorException { JsonObject params = new JsonObject(); params.addProperty("msgid", msgId); final String url = this.mainService.getWxCpConfigStorage() .getApiUrl(CANCEL_GROUP_MSG_SEND); return WxCpBaseResp.fromJson(this.mainService.post(url, params.toString())); } @Override public void sendWelcomeMsg(WxCpWelcomeMsg msg) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(SEND_WELCOME_MSG); this.mainService.post(url, msg.toJson()); } @Override public WxCpUserExternalTagGroupList getCorpTagList(String[] tagId) throws WxErrorException { JsonObject json = new JsonObject(); if (ArrayUtils.isNotEmpty(tagId)) { json.add("tag_id", new Gson().toJsonTree(tagId).getAsJsonArray()); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CORP_TAG_LIST); return WxCpUserExternalTagGroupList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalTagGroupList getCorpTagList(String[] tagId, String[] groupId) throws WxErrorException { JsonObject json = new JsonObject(); if (ArrayUtils.isNotEmpty(tagId)) { json.add("tag_id", new Gson().toJsonTree(tagId).getAsJsonArray()); } if (ArrayUtils.isNotEmpty(groupId)) { json.add("group_id", new Gson().toJsonTree(groupId).getAsJsonArray()); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CORP_TAG_LIST); return WxCpUserExternalTagGroupList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpUserExternalTagGroupInfo addCorpTag(WxCpUserExternalTagGroupInfo tagGroup) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(ADD_CORP_TAG); return WxCpUserExternalTagGroupInfo.fromJson(this.mainService.post(url, tagGroup.getTagGroup().toJson())); } @Override public WxCpBaseResp editCorpTag(String id, String name, Integer order) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("id", id); json.addProperty("name", name); json.addProperty("order", order); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(EDIT_CORP_TAG); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpBaseResp delCorpTag(String[] tagId, String[] groupId) throws WxErrorException { JsonObject json = new JsonObject(); if (ArrayUtils.isNotEmpty(tagId)) { json.add("tag_id", new Gson().toJsonTree(tagId).getAsJsonArray()); } if (ArrayUtils.isNotEmpty(groupId)) { json.add("group_id", new Gson().toJsonTree(groupId).getAsJsonArray()); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEL_CORP_TAG); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpBaseResp markTag(String userid, String externalUserid, String[] addTag, String[] removeTag) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("userid", userid); json.addProperty("external_userid", externalUserid); if (ArrayUtils.isNotEmpty(addTag)) { json.add("add_tag", new Gson().toJsonTree(addTag).getAsJsonArray()); } if (ArrayUtils.isNotEmpty(removeTag)) { json.add("remove_tag", new Gson().toJsonTree(removeTag).getAsJsonArray()); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(MARK_TAG); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpAddMomentResult addMomentTask(WxCpAddMomentTask task) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(ADD_MOMENT_TASK); return WxCpAddMomentResult.fromJson(this.mainService.post(url, task.toJson())); } @Override public WxCpGetMomentTaskResult getMomentTaskResult(String jobId) throws WxErrorException { String params = "&jobid=" + jobId; final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_MOMENT_TASK_RESULT); return WxCpGetMomentTaskResult.fromJson(this.mainService.get(url, params)); } @Override public WxCpBaseResp cancelMomentTask(String momentId) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(CANCEL_MOMENT_TASK); JsonObject json = new JsonObject(); json.addProperty("moment_id", momentId); return WxCpBaseResp.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGetMomentList getMomentList(Long startTime, Long endTime, String creator, Integer filterType, String cursor, Integer limit) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("start_time", startTime); json.addProperty("end_time", endTime); if (!StringUtils.isEmpty(creator)) { json.addProperty("creator", creator); } if (filterType != null) { json.addProperty("filter_type", filterType); } if (!StringUtils.isEmpty(cursor)) { json.addProperty("cursor", cursor); } if (limit != null) { json.addProperty("limit", limit); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_MOMENT_LIST); return WxCpGetMomentList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGetMomentTask getMomentTask(String momentId, String cursor, Integer limit) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("moment_id", momentId); if (!StringUtils.isEmpty(cursor)) { json.addProperty("cursor", cursor); } if (limit != null) { json.addProperty("limit", limit); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_MOMENT_TASK); return WxCpGetMomentTask.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGetMomentCustomerList getMomentCustomerList(String momentId, String userId, String cursor, Integer limit) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("moment_id", momentId); json.addProperty("userid", userId); if (!StringUtils.isEmpty(cursor)) { json.addProperty("cursor", cursor); } if (limit != null) { json.addProperty("limit", limit); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_MOMENT_CUSTOMER_LIST); return WxCpGetMomentCustomerList.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGetMomentSendResult getMomentSendResult(String momentId, String userId, String cursor, Integer limit) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("moment_id", momentId); json.addProperty("userid", userId); if (!StringUtils.isEmpty(cursor)) { json.addProperty("cursor", cursor); } if (limit != null) { json.addProperty("limit", limit); } final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_MOMENT_SEND_RESULT); return WxCpGetMomentSendResult.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGetMomentComments getMomentComments(String momentId, String userId) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("moment_id", momentId); json.addProperty("userid", userId); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_MOMENT_COMMENTS); return WxCpGetMomentComments.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGroupMsgListResult getGroupMsgListV2(String chatType, Date startTime, Date endTime, String creator, Integer filterType, Integer limit, String cursor) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("chat_type", chatType); json.addProperty("start_time", startTime.getTime() / 1000); json.addProperty("end_time", endTime.getTime() / 1000); json.addProperty("creator", creator); json.addProperty("filter_type", filterType); json.addProperty("limit", limit); json.addProperty("cursor", cursor); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_GROUP_MSG_LIST_V2); return WxCpGroupMsgListResult.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGroupMsgSendResult getGroupMsgSendResult(String msgid, String userid, Integer limit, String cursor) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("msgid", msgid); json.addProperty("userid", userid); json.addProperty("limit", limit); json.addProperty("cursor", cursor); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_GROUP_MSG_SEND_RESULT); return WxCpGroupMsgSendResult.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGroupMsgResult getGroupMsgResult(String msgid, Integer limit, String cursor) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("msgid", msgid); json.addProperty("limit", limit); json.addProperty("cursor", cursor); final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_GROUP_MSG_RESULT); return WxCpGroupMsgResult.fromJson(this.mainService.post(url, json.toString())); } @Override public WxCpGroupMsgTaskResult getGroupMsgTask(String msgid, Integer limit, String cursor) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_GROUP_MSG_TASK); return WxCpGroupMsgTaskResult.fromJson(this.mainService.post(url, GsonHelper.buildJsonObject("msgid", msgid, "limit", limit, "cursor", cursor))); } @Override public String addGroupWelcomeTemplate(WxCpGroupWelcomeTemplateResult template) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_WELCOME_TEMPLATE_ADD); final String responseContent = this.mainService.post(url, template.toJson()); return GsonParser.parse(responseContent).get("template_id").getAsString(); } @Override public WxCpBaseResp editGroupWelcomeTemplate(WxCpGroupWelcomeTemplateResult template) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_WELCOME_TEMPLATE_EDIT); return WxCpGroupWelcomeTemplateResult.fromJson(this.mainService.post(url, template.toJson())); } @Override public WxCpGroupWelcomeTemplateResult getGroupWelcomeTemplate(String templateId) throws WxErrorException { JsonObject json = new JsonObject(); json.addProperty("template_id", templateId);
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
true
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import com.google.gson.JsonObject; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.http.URIUtil; import me.chanjar.weixin.common.util.json.GsonHelper; import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.cp.api.WxCpOAuth2Service; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.WxCpOauth2UserInfo; import me.chanjar.weixin.cp.bean.WxCpUserDetail; import me.chanjar.weixin.cp.bean.workbench.WxCpSecondVerificationInfo; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.Optional; import static me.chanjar.weixin.common.api.WxConsts.OAuth2Scope.*; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.OAuth2.*; /** * <pre> * oauth2相关接口实现类. * Created by Binary Wang on 2017-6-25. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @RequiredArgsConstructor public class WxCpOAuth2ServiceImpl implements WxCpOAuth2Service { private final WxCpService mainService; @Override public String buildAuthorizationUrl(String state) { return this.buildAuthorizationUrl( this.mainService.getWxCpConfigStorage().getOauth2redirectUri(), state ); } @Override public String buildAuthorizationUrl(String redirectUri, String state) { return this.buildAuthorizationUrl(redirectUri, state, SNSAPI_BASE); } @Override public String buildAuthorizationUrl(String redirectUri, String state, String scope) { StringBuilder url = new StringBuilder(URL_OAUTH2_AUTHORIZE); url.append("?appid=").append(this.mainService.getWxCpConfigStorage().getCorpId()); url.append("&redirect_uri=").append(URIUtil.encodeURIComponent(redirectUri)); url.append("&response_type=code"); url.append("&scope=").append(scope); if (SNSAPI_PRIVATEINFO.equals(scope) || SNSAPI_USERINFO.equals(scope)) { url.append("&agentid=").append(this.mainService.getWxCpConfigStorage().getAgentId()); } if (state != null) { url.append("&state=").append(state); } url.append("#wechat_redirect"); return url.toString(); } @Override public WxCpOauth2UserInfo getUserInfo(String code) throws WxErrorException { return this.getUserInfo(this.mainService.getWxCpConfigStorage().getAgentId(), code); } @Override public WxCpOauth2UserInfo getUserInfo(Integer agentId, String code) throws WxErrorException { String responseText = this.mainService.get(String.format(this.mainService.getWxCpConfigStorage().getApiUrl(GET_USER_INFO), code, agentId), null); JsonObject jo = GsonParser.parse(responseText); return WxCpOauth2UserInfo.builder() .userId(Optional.ofNullable(GsonHelper.getString(jo, "UserId")).orElse(GsonHelper.getString(jo, "userid"))) .deviceId(GsonHelper.getString(jo, "DeviceId")) .openId(Optional.ofNullable(GsonHelper.getString(jo, "OpenId")).orElse(GsonHelper.getString(jo, "openid"))) .userTicket(GsonHelper.getString(jo, "user_ticket")) .expiresIn(GsonHelper.getString(jo, "expires_in")) .externalUserId(GsonHelper.getString(jo, "external_userid")) .parentUserId(GsonHelper.getString(jo, "parent_userid")) .studentUserId(GsonHelper.getString(jo, "student_userid")) .build(); } @Override public WxCpOauth2UserInfo getSchoolUserInfo(String code) throws WxErrorException { String responseText = this.mainService.get(String.format(this.mainService.getWxCpConfigStorage().getApiUrl(GET_SCHOOL_USER_INFO), code), null); JsonObject jo = GsonParser.parse(responseText); return WxCpOauth2UserInfo.builder() .deviceId(GsonHelper.getString(jo, "DeviceId")) .parentUserId(GsonHelper.getString(jo, "parent_userid")) .studentUserId(GsonHelper.getString(jo, "student_userid")) .build(); } @Override public WxCpUserDetail getUserDetail(String userTicket) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("user_ticket", userTicket); String responseText = this.mainService.post(this.mainService.getWxCpConfigStorage().getApiUrl(GET_USER_DETAIL), param.toString()); return WxCpGsonBuilder.create().fromJson(responseText, WxCpUserDetail.class); } @Override public WxCpOauth2UserInfo getAuthUserInfo(String code) throws WxErrorException { String responseText = this.mainService.get(String.format(this.mainService.getWxCpConfigStorage().getApiUrl(GET_USER_AUTH_INFO), code), null); JsonObject jo = GsonParser.parse(responseText); return WxCpOauth2UserInfo.builder() .userId(GsonHelper.getString(jo, "userid")) .openId(GsonHelper.getString(jo, "openid")) .userTicket(GsonHelper.getString(jo, "user_ticket")) .externalUserId(GsonHelper.getString(jo, "external_userid")) .build(); } @Override public WxCpSecondVerificationInfo getTfaInfo(String code) throws WxErrorException { String responseText = this.mainService.post(this.mainService.getWxCpConfigStorage().getApiUrl(GET_TFA_INFO), GsonHelper.buildJsonObject("code", code)); return WxCpGsonBuilder.create().fromJson(responseText, WxCpSecondVerificationInfo.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import com.google.gson.JsonObject; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.bean.result.WxMediaUploadResult; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxRuntimeException; import me.chanjar.weixin.common.util.fs.FileUtils; import me.chanjar.weixin.common.util.http.BaseMediaDownloadRequestExecutor; import me.chanjar.weixin.common.util.http.InputStreamData; import me.chanjar.weixin.common.util.http.MediaInputStreamUploadRequestExecutor; import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor; import me.chanjar.weixin.common.util.json.GsonHelper; import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.cp.api.WxCpMediaService; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlReq; import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlResult; import org.apache.commons.io.IOUtils; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.file.Files; import java.util.UUID; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.GET_UPLOAD_BY_URL_RESULT; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.IMG_UPLOAD; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.JSSDK_MEDIA_GET; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.MEDIA_GET; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.MEDIA_UPLOAD; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.UPLOAD_BY_URL; /** * <pre> * 媒体管理接口. * Created by Binary Wang on 2017-6-25. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @RequiredArgsConstructor public class WxCpMediaServiceImpl implements WxCpMediaService { private final WxCpService mainService; @Override public WxMediaUploadResult upload(String mediaType, String fileType, InputStream inputStream) throws WxErrorException, IOException { return this.upload(mediaType, FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType)); } @Override public WxMediaUploadResult upload(String mediaType, String filename, String url) throws WxErrorException, IOException { HttpURLConnection conn = null; InputStream inputStream = null; try { URL remote = new URL(url); conn = (HttpURLConnection) remote.openConnection(); //设置超时间为3秒 conn.setConnectTimeout(60 * 1000); //防止屏蔽程序抓取而返回403错误 conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); inputStream = conn.getInputStream(); return this.mainService.execute(MediaInputStreamUploadRequestExecutor.create(this.mainService.getRequestHttp()) , this.mainService.getWxCpConfigStorage().getApiUrl(MEDIA_UPLOAD + mediaType), new InputStreamData(inputStream, filename)); } finally { IOUtils.closeQuietly(inputStream); if (conn != null) { conn.disconnect(); } } } @Override public WxMediaUploadResult upload(String mediaType, File file, String filename) throws WxErrorException { if(!file.exists()){ throw new WxRuntimeException("文件[" + file.getAbsolutePath() + "]不存在"); } try (InputStream inputStream = Files.newInputStream(file.toPath())) { return this.mainService.execute(MediaInputStreamUploadRequestExecutor.create(this.mainService.getRequestHttp()) , this.mainService.getWxCpConfigStorage().getApiUrl(MEDIA_UPLOAD + mediaType), new InputStreamData(inputStream, filename)); } catch (IOException e) { throw new WxRuntimeException(e); } } @Override public WxMediaUploadResult upload(String mediaType, InputStream inputStream, String filename) throws WxErrorException{ return this.mainService.execute(MediaInputStreamUploadRequestExecutor.create(this.mainService.getRequestHttp()) , this.mainService.getWxCpConfigStorage().getApiUrl(MEDIA_UPLOAD + mediaType), new InputStreamData(inputStream, filename)); } @Override public WxMediaUploadResult upload(String mediaType, File file) throws WxErrorException { return this.mainService.execute(MediaUploadRequestExecutor.create(this.mainService.getRequestHttp()), this.mainService.getWxCpConfigStorage().getApiUrl(MEDIA_UPLOAD + mediaType), file); } @Override public File download(String mediaId) throws WxErrorException { return this.mainService.execute( BaseMediaDownloadRequestExecutor.create(this.mainService.getRequestHttp(), this.mainService.getWxCpConfigStorage().getTmpDirFile()), this.mainService.getWxCpConfigStorage().getApiUrl(MEDIA_GET), "media_id=" + mediaId); } @Override public File getJssdkFile(String mediaId) throws WxErrorException { return this.mainService.execute( BaseMediaDownloadRequestExecutor.create(this.mainService.getRequestHttp(), this.mainService.getWxCpConfigStorage().getTmpDirFile()), this.mainService.getWxCpConfigStorage().getApiUrl(JSSDK_MEDIA_GET), "media_id=" + mediaId); } @Override public String uploadImg(File file) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(IMG_UPLOAD); return this.mainService.execute(MediaUploadRequestExecutor.create(this.mainService.getRequestHttp()), url, file) .getUrl(); } @Override public String uploadByUrl(MediaUploadByUrlReq req) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UPLOAD_BY_URL); String responseContent = this.mainService.post(url, req.toJson()); return GsonHelper.getString(GsonParser.parse(responseContent), "jobid"); } @Override public MediaUploadByUrlResult uploadByUrl(String jobId) throws WxErrorException { final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_UPLOAD_BY_URL_RESULT); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("jobid", jobId); String post = this.mainService.post(url, jsonObject.toString()); return MediaUploadByUrlResult.fromJson(post); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceApacheHttpClientImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpServiceApacheHttpClientImpl.java
package me.chanjar.weixin.cp.api.impl; import me.chanjar.weixin.common.bean.WxAccessToken; import me.chanjar.weixin.common.enums.WxType; import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxRuntimeException; import me.chanjar.weixin.common.util.http.HttpClientType; import me.chanjar.weixin.common.util.http.apache.ApacheBasicResponseHandler; import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder; import me.chanjar.weixin.common.util.http.apache.DefaultApacheHttpClientBuilder; import me.chanjar.weixin.cp.config.WxCpConfigStorage; import me.chanjar.weixin.cp.constant.WxCpApiPathConsts; import org.apache.http.HttpHost; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import java.io.IOException; /** * The type Wx cp service apache http client. * * @author someone */ public class WxCpServiceApacheHttpClientImpl extends BaseWxCpServiceImpl<CloseableHttpClient, HttpHost> { private CloseableHttpClient httpClient; private HttpHost httpProxy; @Override public CloseableHttpClient getRequestHttpClient() { return httpClient; } @Override public HttpHost getRequestHttpProxy() { return httpProxy; } @Override public HttpClientType getRequestType() { return HttpClientType.APACHE_HTTP; } @Override public String getAccessToken(boolean forceRefresh) throws WxErrorException { if (!this.configStorage.isAccessTokenExpired() && !forceRefresh) { return this.configStorage.getAccessToken(); } synchronized (this.globalAccessTokenRefreshLock) { String url = String.format(this.configStorage.getApiUrl(WxCpApiPathConsts.GET_TOKEN), this.configStorage.getCorpId(), this.configStorage.getCorpSecret()); try { HttpGet httpGet = new HttpGet(url); if (this.httpProxy != null) { RequestConfig config = RequestConfig.custom() .setProxy(this.httpProxy).build(); httpGet.setConfig(config); } String resultContent = getRequestHttpClient().execute(httpGet, ApacheBasicResponseHandler.INSTANCE); WxError error = WxError.fromJson(resultContent, WxType.CP); if (error.getErrorCode() != 0) { throw new WxErrorException(error); } WxAccessToken accessToken = WxAccessToken.fromJson(resultContent); this.configStorage.updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn()); } catch (IOException e) { throw new WxRuntimeException(e); } } return this.configStorage.getAccessToken(); } @Override public void initHttp() { ApacheHttpClientBuilder apacheHttpClientBuilder = this.configStorage .getApacheHttpClientBuilder(); if (null == apacheHttpClientBuilder) { apacheHttpClientBuilder = DefaultApacheHttpClientBuilder.get(); } apacheHttpClientBuilder.httpProxyHost(this.configStorage.getHttpProxyHost()) .httpProxyPort(this.configStorage.getHttpProxyPort()) .httpProxyUsername(this.configStorage.getHttpProxyUsername()) .httpProxyPassword(this.configStorage.getHttpProxyPassword()); if (this.configStorage.getHttpProxyHost() != null && this.configStorage.getHttpProxyPort() > 0) { this.httpProxy = new HttpHost(this.configStorage.getHttpProxyHost(), this.configStorage.getHttpProxyPort()); } this.httpClient = apacheHttpClientBuilder.build(); } @Override public WxCpConfigStorage getWxCpConfigStorage() { return this.configStorage; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaMeetingRoomServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOaMeetingRoomServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import com.google.gson.reflect.TypeToken; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.json.GsonHelper; import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.cp.api.WxCpOaMeetingRoomService; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.oa.meetingroom.*; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Oa.*; /** * The type Wx cp oa meeting room service. * * @author fcat * @version 1.0 Create by 2022/8/12 23:49 */ @RequiredArgsConstructor public class WxCpOaMeetingRoomServiceImpl implements WxCpOaMeetingRoomService { private final WxCpService wxCpService; @Override public String addMeetingRoom(WxCpOaMeetingRoom meetingRoom) throws WxErrorException { return this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_ADD), meetingRoom); } @Override public List<WxCpOaMeetingRoom> listMeetingRoom(WxCpOaMeetingRoom meetingRoomRequest) throws WxErrorException { String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_LIST), meetingRoomRequest); return WxCpGsonBuilder.create().fromJson(GsonParser.parse(response).get("meetingroom_list").getAsJsonArray().toString(), new TypeToken<List<WxCpOaMeetingRoom>>() { }.getType()); } @Override public void editMeetingRoom(WxCpOaMeetingRoom meetingRoom) throws WxErrorException { this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_EDIT), meetingRoom); } @Override public void deleteMeetingRoom(Integer meetingRoomId) throws WxErrorException { this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_DEL), GsonHelper.buildJsonObject("meetingroom_id", meetingRoomId)); } @Override public WxCpOaMeetingRoomBookingInfoResult getMeetingRoomBookingInfo(WxCpOaMeetingRoomBookingInfoRequest wxCpOaMeetingRoomBookingInfoRequest) throws WxErrorException { String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_GET_BOOKING_INFO), wxCpOaMeetingRoomBookingInfoRequest); return WxCpOaMeetingRoomBookingInfoResult.fromJson(response); } @Override public WxCpOaMeetingRoomBookResult bookingMeetingRoom(WxCpOaMeetingRoomBookRequest wxCpOaMeetingRoomBookRequest) throws WxErrorException { String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOK), wxCpOaMeetingRoomBookRequest); return WxCpOaMeetingRoomBookResult.fromJson(response); } @Override public WxCpOaMeetingRoomBookResult bookingMeetingRoomBySchedule(WxCpOaMeetingRoomBookByScheduleRequest wxCpOaMeetingRoomBookByScheduleRequest) throws WxErrorException { String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOK_BY_SCHEDULE), wxCpOaMeetingRoomBookByScheduleRequest); return WxCpOaMeetingRoomBookResult.fromJson(response); } @Override public WxCpOaMeetingRoomBookResult bookingMeetingRoomByMeeting(WxCpOaMeetingRoomBookByMeetingRequest wxCpOaMeetingRoomBookByMeetingRequest) throws WxErrorException { String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOK_BY_MEETING), wxCpOaMeetingRoomBookByMeetingRequest); return WxCpOaMeetingRoomBookResult.fromJson(response); } @Override public void cancelBookMeetingRoom(WxCpOaMeetingRoomCancelBookRequest wxCpOaMeetingRoomCancelBookRequest) throws WxErrorException { this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_CANCEL_BOOK), wxCpOaMeetingRoomCancelBookRequest); } @Override public WxCpOaMeetingRoomBookingInfoByBookingIdResult getBookingInfoByBookingId(WxCpOaMeetingRoomBookingInfoByBookingIdRequest wxCpOaMeetingRoomBookingInfoByBookingIdRequest) throws WxErrorException { String response = this.wxCpService.post(this.wxCpService.getWxCpConfigStorage().getApiUrl(MEETINGROOM_BOOKINFO_GET), wxCpOaMeetingRoomBookingInfoByBookingIdRequest); return WxCpOaMeetingRoomBookingInfoByBookingIdResult.fromJson(response); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import com.google.gson.JsonObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.cp.api.WxCpSchoolService; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.living.WxCpLivingResult; import me.chanjar.weixin.cp.bean.school.*; import org.apache.commons.lang3.StringUtils; import java.util.List; import java.util.Optional; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.School.*; /** * 企业微信家校应用 复学码相关接口实现类. * https://developer.work.weixin.qq.com/document/path/93744 * * @author <a href="https://github.com/0katekate0">Wang_Wong</a> created on : 2022/6/1 14:05 */ @Slf4j @RequiredArgsConstructor public class WxCpSchoolServiceImpl implements WxCpSchoolService { private final WxCpService cpService; @Override public WxCpCustomizeHealthInfo getTeacherCustomizeHealthInfo(String date, String nextKey, Integer limit) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_TEACHER_CUSTOMIZE_HEALTH_INFO); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("date", date); jsonObject.addProperty("limit", Optional.ofNullable(limit).orElse(100)); if (nextKey != null) { jsonObject.addProperty("next_key", nextKey); } String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); return WxCpCustomizeHealthInfo.fromJson(responseContent); } @Override public WxCpCustomizeHealthInfo getStudentCustomizeHealthInfo(String date, String nextKey, Integer limit) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_STUDENT_CUSTOMIZE_HEALTH_INFO); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("date", date); jsonObject.addProperty("limit", Optional.ofNullable(limit).orElse(100)); if (nextKey != null) { jsonObject.addProperty("next_key", nextKey); } String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); return WxCpCustomizeHealthInfo.fromJson(responseContent); } @Override public WxCpResultList getHealthQrCode(List<String> userIds, Integer type) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_HEALTH_QRCODE); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("type", type); jsonObject.addProperty("userids", userIds.toString()); String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); return WxCpResultList.fromJson(responseContent); } @Override public WxCpPaymentResult getPaymentResult(String paymentId) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_PAYMENT_RESULT); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("payment_id", paymentId); String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); return WxCpPaymentResult.fromJson(responseContent); } @Override public WxCpTrade getTrade(String paymentId, String tradeNo) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_TRADE); JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("payment_id", paymentId); jsonObject.addProperty("trade_no", tradeNo); String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); return WxCpTrade.fromJson(responseContent); } @Override public WxCpSchoolLivingInfo getLivingInfo(String livingId) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_LIVING_INFO) + livingId; String responseContent = this.cpService.get(apiUrl, null); return WxCpSchoolLivingInfo.fromJson(responseContent); } @Override public WxCpLivingResult.LivingIdResult getUserAllLivingId(String userId, String cursor, Integer limit) throws WxErrorException { return this.cpService.getLivingService().getUserAllLivingId(userId, cursor, limit); } @Override public WxCpSchoolWatchStat getWatchStat(String livingId, String nextKey) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_WATCH_STAT); JsonObject jsonObject = new JsonObject(); if (StringUtils.isNotBlank(nextKey)) { jsonObject.addProperty("next_key", nextKey); } jsonObject.addProperty("livingid", livingId); String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); return WxCpSchoolWatchStat.fromJson(responseContent); } @Override public WxCpSchoolUnwatchStat getUnwatchStat(String livingId, String nextKey) throws WxErrorException { String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(GET_UNWATCH_STAT); JsonObject jsonObject = new JsonObject(); if (StringUtils.isNotBlank(nextKey)) { jsonObject.addProperty("next_key", nextKey); } jsonObject.addProperty("livingid", livingId); String responseContent = this.cpService.post(apiUrl, jsonObject.toString()); return WxCpSchoolUnwatchStat.fromJson(responseContent); } @Override public WxCpLivingResult deleteReplayData(String livingId) throws WxErrorException { return cpService.getLivingService().deleteReplayData(livingId); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/BaseWxCpServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/BaseWxCpServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import com.google.common.base.Joiner; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.api.WxConsts; import me.chanjar.weixin.common.bean.CommonUploadParam; import me.chanjar.weixin.common.bean.ToJson; import me.chanjar.weixin.common.bean.WxJsapiSignature; import me.chanjar.weixin.common.enums.WxType; import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxRuntimeException; import me.chanjar.weixin.common.executor.CommonUploadRequestExecutor; import me.chanjar.weixin.common.session.StandardSessionManager; import me.chanjar.weixin.common.session.WxSession; import me.chanjar.weixin.common.session.WxSessionManager; import me.chanjar.weixin.common.util.DataUtils; import me.chanjar.weixin.common.util.RandomUtils; import me.chanjar.weixin.common.util.crypto.SHA1; import me.chanjar.weixin.common.util.http.*; import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.cp.api.*; import me.chanjar.weixin.cp.bean.WxCpAgentJsapiSignature; import me.chanjar.weixin.cp.bean.WxCpMaJsCode2SessionResult; import me.chanjar.weixin.cp.bean.WxCpProviderToken; import me.chanjar.weixin.cp.config.WxCpConfigStorage; import org.apache.commons.lang3.StringUtils; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.*; /** * . * * @param <H> the type parameter * @param <P> the type parameter * @author chanjarster */ @Slf4j public abstract class BaseWxCpServiceImpl<H, P> implements WxCpService, RequestHttp<H, P> { private WxCpUserService userService = new WxCpUserServiceImpl(this); private final WxCpChatService chatService = new WxCpChatServiceImpl(this); private WxCpDepartmentService departmentService = new WxCpDepartmentServiceImpl(this); private WxCpMediaService mediaService = new WxCpMediaServiceImpl(this); private WxCpMenuService menuService = new WxCpMenuServiceImpl(this); private WxCpOAuth2Service oauth2Service = new WxCpOAuth2ServiceImpl(this); private WxCpTagService tagService = new WxCpTagServiceImpl(this); private WxCpAgentService agentService = new WxCpAgentServiceImpl(this); private final WxCpOaService oaService = new WxCpOaServiceImpl(this); private final WxCpSchoolService schoolService = new WxCpSchoolServiceImpl(this); private final WxCpSchoolUserService schoolUserService = new WxCpSchoolUserServiceImpl(this); private final WxCpSchoolHealthService schoolHealthService = new WxCpSchoolHealthServiceImpl(this); private final WxCpLivingService livingService = new WxCpLivingServiceImpl(this); private final WxCpOaAgentService oaAgentService = new WxCpOaAgentServiceImpl(this); private final WxCpOaWeDriveService oaWeDriveService = new WxCpOaWeDriveServiceImpl(this); private final WxCpMsgAuditService msgAuditService = new WxCpMsgAuditServiceImpl(this); private final WxCpTaskCardService taskCardService = new WxCpTaskCardServiceImpl(this); private final WxCpExternalContactService externalContactService = new WxCpExternalContactServiceImpl(this); private final WxCpGroupRobotService groupRobotService = new WxCpGroupRobotServiceImpl(this); private final WxCpMessageService messageService = new WxCpMessageServiceImpl(this); private final WxCpOaCalendarService oaCalendarService = new WxCpOaCalendarServiceImpl(this); private final WxCpOaMeetingRoomService oaMeetingRoomService = new WxCpOaMeetingRoomServiceImpl(this); private final WxCpOaScheduleService oaScheduleService = new WxCpOaOaScheduleServiceImpl(this); private final WxCpAgentWorkBenchService workBenchService = new WxCpAgentWorkBenchServiceImpl(this); private WxCpKfService kfService = new WxCpKfServiceImpl(this); private WxCpExportService exportService = new WxCpExportServiceImpl(this); private final WxCpMeetingService meetingService = new WxCpMeetingServiceImpl(this); private final WxCpCorpGroupService corpGroupService = new WxCpCorpGroupServiceImpl(this); private final WxCpIntelligentRobotService intelligentRobotService = new WxCpIntelligentRobotServiceImpl(this); /** * 全局的是否正在刷新access token的锁. */ protected final Object globalAccessTokenRefreshLock = new Object(); /** * 全局的是否正在刷新jsapi_ticket的锁. */ protected final Object globalJsapiTicketRefreshLock = new Object(); /** * 全局的是否正在刷新agent的jsapi_ticket的锁. */ protected final Object globalAgentJsapiTicketRefreshLock = new Object(); /** * The Config storage. */ protected WxCpConfigStorage configStorage; private WxSessionManager sessionManager = new StandardSessionManager(); /** * 临时文件目录. */ private File tmpDirFile; private int retrySleepMillis = 1000; private int maxRetryTimes = 5; @Override public boolean checkSignature(String msgSignature, String timestamp, String nonce, String data) { try { return SHA1.gen(this.configStorage.getToken(), timestamp, nonce, data) .equals(msgSignature); } catch (Exception e) { log.error("Checking signature failed, and the reason is :{}", e.getMessage()); return false; } } @Override public String getAccessToken() throws WxErrorException { return getAccessToken(false); } @Override public String getAgentJsapiTicket() throws WxErrorException { return this.getAgentJsapiTicket(false); } @Override public String getAgentJsapiTicket(boolean forceRefresh) throws WxErrorException { if (forceRefresh) { this.configStorage.expireAgentJsapiTicket(); } if (this.configStorage.isAgentJsapiTicketExpired()) { synchronized (this.globalAgentJsapiTicketRefreshLock) { if (this.configStorage.isAgentJsapiTicketExpired()) { String responseContent = this.get(this.configStorage.getApiUrl(GET_AGENT_CONFIG_TICKET), null); JsonObject jsonObject = GsonParser.parse(responseContent); this.configStorage.updateAgentJsapiTicket(jsonObject.get("ticket").getAsString(), jsonObject.get("expires_in").getAsInt()); } } } return this.configStorage.getAgentJsapiTicket(); } @Override public String getJsapiTicket() throws WxErrorException { return getJsapiTicket(false); } @Override public String getJsapiTicket(boolean forceRefresh) throws WxErrorException { if (forceRefresh) { this.configStorage.expireJsapiTicket(); } if (this.configStorage.isJsapiTicketExpired()) { synchronized (this.globalJsapiTicketRefreshLock) { if (this.configStorage.isJsapiTicketExpired()) { String responseContent = this.get(this.configStorage.getApiUrl(GET_JSAPI_TICKET), null); JsonObject tmpJsonObject = GsonParser.parse(responseContent); this.configStorage.updateJsapiTicket(tmpJsonObject.get("ticket").getAsString(), tmpJsonObject.get("expires_in").getAsInt()); } } } return this.configStorage.getJsapiTicket(); } @Override public WxJsapiSignature createJsapiSignature(String url) throws WxErrorException { long timestamp = System.currentTimeMillis() / 1000; String noncestr = RandomUtils.getRandomStr(); String jsapiTicket = getJsapiTicket(false); String signature = SHA1.genWithAmple( "jsapi_ticket=" + jsapiTicket, "noncestr=" + noncestr, "timestamp=" + timestamp, "url=" + url ); WxJsapiSignature jsapiSignature = new WxJsapiSignature(); jsapiSignature.setTimestamp(timestamp); jsapiSignature.setNonceStr(noncestr); jsapiSignature.setUrl(url); jsapiSignature.setSignature(signature); // Fixed bug jsapiSignature.setAppId(this.configStorage.getCorpId()); return jsapiSignature; } @Override public WxCpAgentJsapiSignature createAgentJsapiSignature(String url) throws WxErrorException { long timestamp = System.currentTimeMillis() / 1000; String noncestr = RandomUtils.getRandomStr(); String jsapiTicket = getAgentJsapiTicket(false); String signature = SHA1.genWithAmple( "jsapi_ticket=" + jsapiTicket, "noncestr=" + noncestr, "timestamp=" + timestamp, "url=" + url ); WxCpAgentJsapiSignature jsapiSignature = new WxCpAgentJsapiSignature(); jsapiSignature.setTimestamp(timestamp); jsapiSignature.setNonceStr(noncestr); jsapiSignature.setUrl(url); jsapiSignature.setSignature(signature); jsapiSignature.setCorpid(this.configStorage.getCorpId()); jsapiSignature.setAgentid(this.configStorage.getAgentId()); return jsapiSignature; } @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"); final String url = this.configStorage.getApiUrl(JSCODE_TO_SESSION); return WxCpMaJsCode2SessionResult.fromJson(this.get(url, Joiner.on("&").withKeyValueSeparator("=").join(params))); } @Override public String[] getCallbackIp() throws WxErrorException { return getIp(GET_CALLBACK_IP); } @Override public String[] getApiDomainIp() throws WxErrorException { return getIp(GET_API_DOMAIN_IP); } /** * 获取 IP * * @param suffixUrl 接口URL 后缀 * @return 返回结果 * @throws WxErrorException 异常信息 */ private String[] getIp(String suffixUrl) throws WxErrorException { String responseContent = get(this.configStorage.getApiUrl(suffixUrl), null); JsonObject tmpJsonObject = GsonParser.parse(responseContent); JsonArray jsonArray = tmpJsonObject.get("ip_list").getAsJsonArray(); String[] ips = new String[jsonArray.size()]; for (int i = 0; i < jsonArray.size(); i++) { ips[i] = jsonArray.get(i).getAsString(); } return ips; } @Override public WxCpProviderToken getProviderToken(String corpId, String providerSecret) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("corpid", corpId); jsonObject.addProperty("provider_secret", providerSecret); return WxCpProviderToken.fromJson(this.post(this.configStorage.getApiUrl(Tp.GET_PROVIDER_TOKEN), jsonObject.toString())); } @Override public String get(String url, String queryParam) throws WxErrorException { return execute(SimpleGetRequestExecutor.create(this), url, queryParam); } @Override public String post(String url, String postData) throws WxErrorException { return execute(SimplePostRequestExecutor.create(this), url, postData); } @Override public String post(String url, JsonObject jsonObject) throws WxErrorException { return this.post(url, jsonObject.toString()); } @Override public String post(String url, ToJson obj) throws WxErrorException { return this.post(url, obj.toJson()); } @Override public String upload(String url, CommonUploadParam param) throws WxErrorException { RequestExecutor<String, CommonUploadParam> executor = CommonUploadRequestExecutor.create(getRequestHttp()); return this.execute(executor, url, param); } @Override public String post(String url, Object obj) throws WxErrorException { return this.post(url, obj.toString()); } @Override public String postWithoutToken(String url, String postData) throws WxErrorException { return this.executeNormal(SimplePostRequestExecutor.create(this), url, postData); } /** * 向微信端发送请求,在这里执行的策略是当发生access_token过期时才去刷新,然后重新执行请求,而不是全局定时请求. */ @Override public <T, E> T execute(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException { int retryTimes = 0; do { try { return this.executeInternal(executor, uri, data, false); } catch (WxErrorException e) { if (retryTimes + 1 > this.maxRetryTimes) { log.warn("重试达到最大次数【{}】", this.maxRetryTimes); //最后一次重试失败后,直接抛出异常,不再等待 throw new WxRuntimeException("微信服务端异常,超出重试次数"); } WxError error = e.getError(); /* * -1 系统繁忙, 1000ms后重试 */ if (error.getErrorCode() == -1) { int sleepMillis = this.retrySleepMillis * (1 << retryTimes); try { log.debug("微信系统繁忙,{} ms 后重试(第{}次)", sleepMillis, retryTimes + 1); Thread.sleep(sleepMillis); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } } else { throw e; } } } while (retryTimes++ < this.maxRetryTimes); log.warn("重试达到最大次数【{}】", this.maxRetryTimes); throw new WxRuntimeException("微信服务端异常,超出重试次数"); } /** * Execute internal t. * * @param <T> the type parameter * @param <E> the type parameter * @param executor the executor * @param uri the uri * @param data the data * @param doNotAutoRefresh the do not auto refresh * @return the t * @throws WxErrorException the wx error exception */ protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data, boolean doNotAutoRefresh) throws WxErrorException { E dataForLog = DataUtils.handleDataWithSecret(data); if (uri.contains("access_token=")) { throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri); } String accessToken = getAccessToken(false); String uriWithAccessToken = uri + (uri.contains("?") ? "&" : "?") + "access_token=" + accessToken; try { T result = executor.execute(uriWithAccessToken, data, WxType.CP); log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uriWithAccessToken, dataForLog, result); return result; } catch (WxErrorException e) { WxError error = e.getError(); if (WxConsts.ACCESS_TOKEN_ERROR_CODES.contains(error.getErrorCode())) { // 强制设置wxCpConfigStorage它的access token过期了,这样在下一次请求里就会刷新access token this.configStorage.expireAccessToken(); if (this.getWxCpConfigStorage().autoRefreshToken() && !doNotAutoRefresh) { log.warn("即将重新获取新的access_token,错误代码:{},错误信息:{}", error.getErrorCode(), error.getErrorMsg()); //下一次不再自动重试 //当小程序误调用第三方平台专属接口时,第三方无法使用小程序的access token,如果可以继续自动获取token会导致无限循环重试,直到栈溢出 return this.executeInternal(executor, uri, data, true); } } if (error.getErrorCode() != 0) { log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uriWithAccessToken, dataForLog, error); throw new WxErrorException(error, e); } return null; } catch (IOException e) { log.warn("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uriWithAccessToken, dataForLog, e.getMessage()); throw new WxRuntimeException(e); } } /** * 普通请求,不自动带accessToken */ private <T, E> T executeNormal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException { try { T result = executor.execute(uri, data, WxType.CP); log.debug("\n【请求地址】: {}\n【请求参数】:{}\n【响应数据】:{}", uri, data, result); return result; } catch (WxErrorException e) { WxError error = e.getError(); if (error.getErrorCode() != 0) { log.error("\n【请求地址】: {}\n【请求参数】:{}\n【错误信息】:{}", uri, data, error); throw new WxErrorException(error, e); } return null; } catch (IOException e) { log.error("\n【请求地址】: {}\n【请求参数】:{}\n【异常信息】:{}", uri, data, e.getMessage()); throw new WxErrorException(e); } } @Override public void setWxCpConfigStorage(WxCpConfigStorage wxConfigProvider) { this.configStorage = wxConfigProvider; this.initHttp(); } @Override public void setRetrySleepMillis(int retrySleepMillis) { this.retrySleepMillis = retrySleepMillis; } @Override public void setMaxRetryTimes(int maxRetryTimes) { this.maxRetryTimes = maxRetryTimes; } @Override public WxSession getSession(String id) { if (this.sessionManager == null) { return null; } return this.sessionManager.getSession(id); } @Override public WxSession getSession(String id, boolean create) { if (this.sessionManager == null) { return null; } return this.sessionManager.getSession(id, create); } @Override public void setSessionManager(WxSessionManager sessionManager) { this.sessionManager = sessionManager; } @Override public WxSessionManager getSessionManager() { return this.sessionManager; } @Override public String replaceParty(String mediaId) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("media_id", mediaId); return post(this.configStorage.getApiUrl(BATCH_REPLACE_PARTY), jsonObject.toString()); } @Override public String syncUser(String mediaId) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("media_id", mediaId); String responseContent = post(this.configStorage.getApiUrl(BATCH_SYNC_USER), jsonObject.toString()); JsonObject tmpJson = GsonParser.parse(responseContent); return tmpJson.get("jobid").getAsString(); } @Override public String replaceUser(String mediaId) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("media_id", mediaId); return post(this.configStorage.getApiUrl(BATCH_REPLACE_USER), jsonObject.toString()); } @Override public String getTaskResult(String jobId) throws WxErrorException { String url = this.configStorage.getApiUrl(BATCH_GET_RESULT + jobId); return get(url, null); } @Override public String buildQrConnectUrl(String redirectUri, String state) { return String.format("https://open.work.weixin.qq.com/wwopen/sso/qrConnect?appid=%s&agentid=%s&redirect_uri=%s" + "&state=%s", this.configStorage.getCorpId(), this.configStorage.getAgentId(), URIUtil.encodeURIComponent(redirectUri), StringUtils.trimToEmpty(state)); } /** * Gets tmp dir file. * * @return the tmp dir file */ public File getTmpDirFile() { return this.tmpDirFile; } /** * Sets tmp dir file. * * @param tmpDirFile the tmp dir file */ public void setTmpDirFile(File tmpDirFile) { this.tmpDirFile = tmpDirFile; } @Override public WxCpDepartmentService getDepartmentService() { return departmentService; } @Override public WxCpMediaService getMediaService() { return mediaService; } @Override public WxCpMenuService getMenuService() { return menuService; } @Override public WxCpOAuth2Service getOauth2Service() { return oauth2Service; } @Override public WxCpTagService getTagService() { return tagService; } @Override public WxCpUserService getUserService() { return userService; } @Override public WxCpExternalContactService getExternalContactService() { return externalContactService; } @Override public WxCpChatService getChatService() { return chatService; } @Override public WxCpOaService getOaService() { return oaService; } @Override public WxCpSchoolService getSchoolService() { return schoolService; } @Override public WxCpSchoolUserService getSchoolUserService() { return schoolUserService; } @Override public WxCpSchoolHealthService getSchoolHealthService() { return schoolHealthService; } @Override public WxCpLivingService getLivingService() { return livingService; } @Override public WxCpOaAgentService getOaAgentService() { return oaAgentService; } @Override public WxCpOaWeDriveService getOaWeDriveService() { return oaWeDriveService; } @Override public WxCpMsgAuditService getMsgAuditService() { return msgAuditService; } @Override public WxCpOaCalendarService getOaCalendarService() { return this.oaCalendarService; } @Override public WxCpOaMeetingRoomService getOaMeetingRoomService() { return this.oaMeetingRoomService; } @Override public WxCpGroupRobotService getGroupRobotService() { return groupRobotService; } @Override public WxCpAgentWorkBenchService getWorkBenchService() { return workBenchService; } @Override public WxCpTaskCardService getTaskCardService() { return taskCardService; } @Override public RequestHttp<?, ?> getRequestHttp() { return this; } @Override public void setUserService(WxCpUserService userService) { this.userService = userService; } @Override public void setDepartmentService(WxCpDepartmentService departmentService) { this.departmentService = departmentService; } @Override public void setMediaService(WxCpMediaService mediaService) { this.mediaService = mediaService; } @Override public void setMenuService(WxCpMenuService menuService) { this.menuService = menuService; } @Override public void setOauth2Service(WxCpOAuth2Service oauth2Service) { this.oauth2Service = oauth2Service; } @Override public void setTagService(WxCpTagService tagService) { this.tagService = tagService; } @Override public WxCpAgentService getAgentService() { return agentService; } @Override public WxCpMessageService getMessageService() { return this.messageService; } /** * Sets agent service. * * @param agentService the agent service */ public void setAgentService(WxCpAgentService agentService) { this.agentService = agentService; } @Override public WxCpOaScheduleService getOaScheduleService() { return this.oaScheduleService; } @Override public WxCpKfService getKfService() { return kfService; } @Override public void setKfService(WxCpKfService kfService) { this.kfService = kfService; } @Override public WxCpExportService getExportService() { return exportService; } @Override public void setExportService(WxCpExportService exportService) { this.exportService = exportService; } @Override public WxCpMeetingService getMeetingService() { return meetingService; } @Override public WxCpCorpGroupService getCorpGroupService() { return corpGroupService; } @Override public WxCpIntelligentRobotService getIntelligentRobotService() { return this.intelligentRobotService; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpGroupRobotServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpGroupRobotServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.cp.api.WxCpGroupRobotService; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.article.NewArticle; import me.chanjar.weixin.cp.bean.message.WxCpGroupRobotMessage; import me.chanjar.weixin.cp.config.WxCpConfigStorage; import me.chanjar.weixin.cp.constant.WxCpApiPathConsts; import org.apache.commons.lang3.StringUtils; import java.util.List; import static me.chanjar.weixin.cp.constant.WxCpConsts.GroupRobotMsgType; /** * 企业微信群机器人消息发送api 实现 * * @author yr created on 2020-08-20 */ @RequiredArgsConstructor public class WxCpGroupRobotServiceImpl implements WxCpGroupRobotService { private final WxCpService cpService; private String getWebhookUrl() throws WxErrorException { WxCpConfigStorage wxCpConfigStorage = this.cpService.getWxCpConfigStorage(); final String webhookKey = wxCpConfigStorage.getWebhookKey(); if (StringUtils.isEmpty(webhookKey)) { throw new WxErrorException("请先设置WebhookKey"); } return wxCpConfigStorage.getApiUrl(WxCpApiPathConsts.WEBHOOK_SEND) + webhookKey; } @Override public void sendText(String content, List<String> mentionedList, List<String> mobileList) throws WxErrorException { this.sendText(this.getWebhookUrl(), content, mentionedList, mobileList); } @Override public void sendMarkdown(String content) throws WxErrorException { this.sendMarkdown(this.getWebhookUrl(), content); } @Override public void sendMarkdownV2(String content) throws WxErrorException { this.sendMarkdownV2(this.getWebhookUrl(), content); } @Override public void sendImage(String base64, String md5) throws WxErrorException { this.sendImage(this.getWebhookUrl(), base64, md5); } @Override public void sendNews(List<NewArticle> articleList) throws WxErrorException { this.sendNews(this.getWebhookUrl(), articleList); } @Override public void sendText(String webhookUrl, String content, List<String> mentionedList, List<String> mobileList) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage() .setMsgType(GroupRobotMsgType.TEXT) .setContent(content) .setMentionedList(mentionedList) .setMentionedMobileList(mobileList) .toJson()); } @Override public void sendMarkdown(String webhookUrl, String content) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage() .setMsgType(GroupRobotMsgType.MARKDOWN) .setContent(content) .toJson()); } @Override public void sendMarkdownV2(String webhookUrl, String content) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage() .setMsgType(GroupRobotMsgType.MARKDOWN_V2) .setContent(content) .toJson()); } @Override public void sendImage(String webhookUrl, String base64, String md5) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage() .setMsgType(GroupRobotMsgType.IMAGE) .setBase64(base64) .setMd5(md5).toJson()); } @Override public void sendNews(String webhookUrl, List<NewArticle> articleList) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage() .setMsgType(GroupRobotMsgType.NEWS) .setArticles(articleList).toJson()); } @Override public void sendFile(String webhookUrl, String mediaId) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage() .setMsgType(GroupRobotMsgType.FILE) .setMediaId(mediaId).toJson()); } @Override public void sendVoice(String webhookUrl, String mediaId) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, new WxCpGroupRobotMessage() .setMsgType(GroupRobotMsgType.VOICE) .setMediaId(mediaId).toJson()); } @Override public void sendTemplateCardMessage(String webhookUrl, WxCpGroupRobotMessage wxCpGroupRobotMessage) throws WxErrorException { this.cpService.postWithoutToken(webhookUrl, wxCpGroupRobotMessage.toJson()); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpDepartmentServiceImpl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpDepartmentServiceImpl.java
package me.chanjar.weixin.cp.api.impl; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.json.GsonHelper; import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.cp.api.WxCpDepartmentService; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.WxCpDepart; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Department.*; /** * <pre> * 部门管理接口 * Created by BinaryWang on 2017/6/24. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @RequiredArgsConstructor public class WxCpDepartmentServiceImpl implements WxCpDepartmentService { private final WxCpService mainService; @Override public Long create(WxCpDepart depart) throws WxErrorException { String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_CREATE); String responseContent = this.mainService.post(url, depart.toJson()); JsonObject tmpJsonObject = GsonParser.parse(responseContent); return GsonHelper.getAsLong(tmpJsonObject.get("id")); } @Override public WxCpDepart get(Long id) throws WxErrorException { String url = String.format(this.mainService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_GET), id); String responseContent = this.mainService.get(url, null); JsonObject tmpJsonObject = GsonParser.parse(responseContent); return WxCpGsonBuilder.create() .fromJson(tmpJsonObject.get("department"), new TypeToken<WxCpDepart>() { }.getType() ); } @Override public void update(WxCpDepart group) throws WxErrorException { String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_UPDATE); this.mainService.post(url, group.toJson()); } @Override public void delete(Long departId) throws WxErrorException { String url = String.format(this.mainService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_DELETE), departId); this.mainService.get(url, null); } @Override public List<WxCpDepart> list(Long id) throws WxErrorException { String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST); if (id != null) { url += "?id=" + id; } String responseContent = this.mainService.get(url, null); JsonObject tmpJsonObject = GsonParser.parse(responseContent); return WxCpGsonBuilder.create() .fromJson(tmpJsonObject.get("department"), new TypeToken<List<WxCpDepart>>() { }.getType() ); } @Override public List<WxCpDepart> simpleList(Long id) throws WxErrorException { String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_SIMPLE_LIST); if (id != null) { url += "?id=" + id; } String responseContent = this.mainService.get(url, null); JsonObject tmpJsonObject = GsonParser.parse(responseContent); return WxCpGsonBuilder.create() .fromJson(tmpJsonObject.get("department_id"), new TypeToken<List<WxCpDepart>>() { }.getType() ); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpCorp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpCorp.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 微信部门. * * @author Daniel Qian */ @Data public class WxCpTpCorp implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("corpid") private String corpId; @SerializedName("corp_name") private String corpName; @SerializedName("corp_full_name") private String corpFullName; @SerializedName("corp_type") private String corpType; @SerializedName("corp_square_logo_url") private String corpSquareLogoUrl; @SerializedName("corp_user_max") private String corpUserMax; @SerializedName("permanent_code") private String permanentCode; @SerializedName("auth_info") private String authInfo; /** * From json wx cp tp corp. * * @param json the json * @return the wx cp tp corp */ public static WxCpTpCorp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpCorp.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxTpCustomizedAuthUrl.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxTpCustomizedAuthUrl.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * @author freedom * @since 2022/10/20 16:36 */ @Data public class WxTpCustomizedAuthUrl extends WxCpBaseResp { /** * 可用来生成二维码的授权url,需要开发者自行生成为二维码 */ @SerializedName("qrcode_url") private String qrCodeURL; /** * 有效期(秒)。10天过期。 */ @SerializedName("expires_in") private Integer expiresIn; /** * From json wx cp tp customized auth url. * * @param json the json * @return the wx cp tp customized auth url */ public static WxTpCustomizedAuthUrl fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxTpCustomizedAuthUrl.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUnionidToExternalUseridResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUnionidToExternalUseridResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.*; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; @Getter @Setter public class WxCpTpUnionidToExternalUseridResult extends WxCpBaseResp { private static final long serialVersionUID = -6153589164415497369L; @SerializedName("external_userid") private String externalUserid; @SerializedName("pending_id") private String pendingId; public static WxCpTpUnionidToExternalUseridResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpUnionidToExternalUseridResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserDetail.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserDetail.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * The type Wx cp tp user detail. * * @author huangxiaoming */ @Data @EqualsAndHashCode(callSuper = true) public class WxCpTpUserDetail extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; /** * 用户所属企业的corpid */ @SerializedName("corpid") private String corpId; /** * 成员UserID */ @SerializedName("userid") private String userId; /** * 成员姓名 */ @SerializedName("name") private String name; /** * 性别。0表示未定义,1表示男性,2表示女性 */ @SerializedName("gender") private String gender; /** * 头像url。仅在用户同意snsapi_privateinfo授权时返回 */ @SerializedName("avatar") private String avatar; /** * 员工个人二维码(扫描可添加为外部联系人),仅在用户同意snsapi_privateinfo授权时返回 */ @SerializedName("qr_code") private String qrCode; /** * 手机,仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 */ @SerializedName("mobile") private String mobile; /** * 邮箱,仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 */ @SerializedName("email") private String email; /** * 企业邮箱,仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 */ @SerializedName("biz_mail") private String bizMail; /** * 仅在用户同意snsapi_privateinfo授权时返回,第三方应用不可获取 */ @SerializedName("address") private String address; /** * From json wx cp tp user detail. * * @param json the json * @return the wx cp tp user detail */ public static WxCpTpUserDetail fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpUserDetail.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearch.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearch.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.experimental.Accessors; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * The type Wx cp tp contact search. * * @author uianz * @since 2020 /12/23 下午 02:43 */ @Data @Accessors(chain = true) public class WxCpTpContactSearch implements Serializable { private static final long serialVersionUID = -4301684507150486556L; /** * 查询的企业corpid */ @SerializedName("auth_corpid") private String authCorpId; /** * 搜索关键词。当查询用户时应为用户名称、名称拼音或者英文名;当查询部门时应为部门名称或者部门名称拼音 */ @SerializedName("query_word") private String queryWord; /** * 查询类型 1:查询用户,返回用户userid列表 2:查询部门,返回部门id列表。 不填该字段或者填0代表同时查询部门跟用户 */ @SerializedName("query_type") private Integer type; /** * 应用id,若非0则只返回应用可见范围内的用户或者部门信息 */ @SerializedName("agentid") private Integer agentId; /** * 查询返回的最大数量,默认为50,最多为200,查询返回的数量可能小于limit指定的值 */ @SerializedName("limit") private Integer limit; /** * 如果需要精确匹配用户名称或者部门名称或者英文名,不填则默认为模糊匹配;1:匹配用户名称或者部门名称 2:匹配用户英文名 */ @SerializedName("full_match_field") private Integer fullMatchField; /** * 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填 */ @SerializedName("cursor") private String cursor; /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpProlongTryResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpProlongTryResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 应用市场延长试用期结果 * * @author leiguoqing created on 2022年4月24日 */ @Getter @Setter public class WxCpTpProlongTryResult extends WxCpBaseResp { /** * The constant serialVersionUID. */ private static final long serialVersionUID = -5028321625140879571L; /** * 延长后的试用到期时间(秒级时间戳) */ @SerializedName("try_end_time") private Long tryEndTime; /** * From json wx cp tp order list get result. * * @param json the json * @return the wx cp tp order list get result */ public static WxCpTpProlongTryResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpProlongTryResult.class); } /** * To json string. * * @return the string */ @Override public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTaskCardUpdateResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTaskCardUpdateResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * <pre> * 更新任务卡片消息状态的返回类 * 参考文档:https://work.weixin.qq.com/api/doc#90000/90135/91579 * Created by Jeff on 2019-05-16. * </pre> * * @author <a href="https://github.com/domainname">Jeff</a> created on 2019-05-16 */ @Data @AllArgsConstructor @NoArgsConstructor public class WxCpTaskCardUpdateResult implements Serializable { @SerializedName("errcode") private Integer errcode; @SerializedName("errmsg") private String errmsg; /** * 用户列表 */ @SerializedName("invaliduser") private List<String> invalidUsers; /** * From json wx cp task card update result. * * @param json the json * @return the wx cp task card update result */ public static WxCpTaskCardUpdateResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTaskCardUpdateResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpInviteResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpInviteResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 邀请成员的结果对象类. * Created by Binary Wang on 2018-5-13. * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data public class WxCpInviteResult implements Serializable { private static final long serialVersionUID = 1420065684270213578L; @Override public String toString() { return WxCpGsonBuilder.create().toJson(this); } /** * From json wx cp invite result. * * @param json the json * @return the wx cp invite result */ public static WxCpInviteResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpInviteResult.class); } @SerializedName("errcode") private Integer errCode; @SerializedName("errmsg") private String errMsg; @SerializedName("invaliduser") private String[] invalidUsers; @SerializedName("invalidparty") private String[] invalidParties; @SerializedName("invalidtag") private String[] invalidTags; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOauth2UserInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOauth2UserInfo.java
package me.chanjar.weixin.cp.bean; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import java.io.Serializable; /** * <pre> * 用oauth2获取用户信息的结果类 * Created by BinaryWang on 2019/5/26. * </pre> * <p> * 文档1:https://developer.work.weixin.qq.com/document/path/91707 * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data @Accessors(chain = true) @NoArgsConstructor @AllArgsConstructor @Builder public class WxCpOauth2UserInfo implements Serializable { private static final long serialVersionUID = -4301684507150486556L; private String openId; private String deviceId; private String userId; private String userTicket; private String expiresIn; private String externalUserId; private String parentUserId; private String studentUserId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpOpenKfIdConvertResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpOpenKfIdConvertResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; @Setter @Getter public class WxCpTpOpenKfIdConvertResult extends WxCpBaseResp { /** * 微信客服ID转换结果 */ @SerializedName("items") private List<Item> items; /** * 无法转换的微信客服ID列表 */ @SerializedName("invalid_open_kfid_list") private List<String> invalidOpenKfIdList; @Getter @Setter public static class Item { /*** * 企业主体下的微信客服ID */ @SerializedName("open_kfid") private String openKfId; /** * 服务商主体下的微信客服ID,如果传入的open_kfid已经是服务商主体下的ID,则new_open_kfid与open_kfid相同。 */ @SerializedName("new_open_kfid") private String newOpenKfId; } public static WxCpTpOpenKfIdConvertResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpOpenKfIdConvertResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearchResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpContactSearchResp.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * The type Wx cp tp contact search resp. * * @author uianz * @since 2020 /12/23 下午 02:55 */ @EqualsAndHashCode(callSuper = true) @Data public class WxCpTpContactSearchResp extends WxCpBaseResp { @SerializedName("is_last") private Boolean isLast; @SerializedName("query_result") private QueryResult queryResult; @SerializedName("next_cursor") private String nextCursor; /** * The type Query result. */ @Data public static class QueryResult implements Serializable { private static final long serialVersionUID = -4301684507150486556L; @SerializedName("user") private User user; @SerializedName("party") private Party party; /** * The type User. */ @Data public static class User implements Serializable { private static final long serialVersionUID = -4301684507150486556L; @SerializedName("userid") private List<String> userid; @SerializedName("open_userid") private List<String> openUserId; } /** * The type Party. */ @Data public static class Party implements Serializable { private static final long serialVersionUID = -4301684507150486556L; @SerializedName("department_id") private List<Integer> departmentId; } } /** * From json wx cp tp contact search resp. * * @param json the json * @return the wx cp tp contact search resp */ public static WxCpTpContactSearchResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpContactSearchResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTag.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTag.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * The type Wx cp tp tag. * * @author zhangq <zhangq002@gmail.com> * @since 2021 -02-14 16:15 16:15 */ @Data public class WxCpTpTag implements Serializable { private static final long serialVersionUID = 581740383760234134L; @SerializedName("tagid") private String tagId; @SerializedName("tagname") private String tagName; /** * Deserialize wx cp tp tag. * * @param json the json * @return the wx cp tp tag */ public static WxCpTpTag deserialize(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpTag.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxTpLoginInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxTpLoginInfo.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 登录信息 * * @author Jamie.shi created on 2020-08-03 17:18 */ @Data @EqualsAndHashCode(callSuper = true) public class WxTpLoginInfo extends WxCpBaseResp { private static final long serialVersionUID = -6994487991072386856L; @SerializedName("usertype") private Integer userType; @SerializedName("user_info") private UserInfo userInfo; @SerializedName("corp_info") private CorpInfoBean corpInfo; @SerializedName("auth_info") private AuthInfo authInfo; private List<Agent> agent; /** * From json wx tp login info. * * @param json the json * @return the wx tp login info */ public static WxTpLoginInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxTpLoginInfo.class); } /** * The type User info. */ @Data public static class UserInfo implements Serializable { private static final long serialVersionUID = -4558358748587735192L; @SerializedName("userid") private String userId; @SerializedName("open_userid") private String openUserId; private String name; private String avatar; } /** * The type Corp info bean. */ @Data public static class CorpInfoBean implements Serializable { private static final long serialVersionUID = -3160146744148144984L; @SerializedName("corpid") private String corpId; } /** * The type Auth info. */ @Data public static class AuthInfo implements Serializable { private static final long serialVersionUID = -8697184659526210472L; private List<Department> department; /** * The type Department. */ @Data public static class Department implements Serializable { private static final long serialVersionUID = -4389328276936557541L; private int id; private boolean writable; } } /** * The type Agent. */ @Data public static class Agent implements Serializable { private static final long serialVersionUID = 1461544500964159037L; @SerializedName("agentid") private int agentId; @SerializedName("auth_type") private int authType; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgent.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgent.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * <pre> * 企业号应用信息. * Created by huansinho on 2018/4/13. * </pre> * * @author <a href="https://github.com/huansinho">huansinho</a> */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class WxCpAgent implements Serializable { private static final long serialVersionUID = 5002894979081127234L; @SerializedName("errcode") private Integer errCode; @SerializedName("errmsg") private String errMsg; @SerializedName("agentid") private Integer agentId; @SerializedName("name") private String name; @SerializedName("square_logo_url") private String squareLogoUrl; @SerializedName("logo_mediaid") private String logoMediaId; @SerializedName("description") private String description; @SerializedName("allow_userinfos") private Users allowUserInfos; @SerializedName("allow_partys") private Parties allowParties; @SerializedName("allow_tags") private Tags allowTags; @SerializedName("close") private Integer close; @SerializedName("redirect_domain") private String redirectDomain; @SerializedName("report_location_flag") private Integer reportLocationFlag; @SerializedName("isreportenter") private Integer isReportEnter; @SerializedName("home_url") private String homeUrl; @SerializedName("customized_publish_status") private Integer customizedPublishStatus; /** * From json wx cp agent. * * @param json the json * @return the wx cp agent */ public static WxCpAgent fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpAgent.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } /** * The type Users. */ @Data public static class Users implements Serializable { private static final long serialVersionUID = 8801100463558788565L; @SerializedName("user") private List<User> users; } /** * The type User. */ @Data public static class User implements Serializable { private static final long serialVersionUID = 7287632514385508024L; @SerializedName("userid") private String userId; } /** * The type Parties. */ @Data public static class Parties { @SerializedName("partyid") private List<Long> partyIds = null; } /** * The type Tags. */ @Data public static class Tags { @SerializedName("tagid") private List<Integer> tagIds = null; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTagAddOrRemoveUsersResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTagAddOrRemoveUsersResult.java
package me.chanjar.weixin.cp.bean; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 企业微信第三方开发-增加标签成员成员api响应体 * * @author zhangq <zhangq002@gmail.com> * @since 2021 /2/14 16:44 */ public class WxCpTpTagAddOrRemoveUsersResult extends WxCpTagAddOrRemoveUsersResult { private static final long serialVersionUID = 3490401800490702052L; /** * Deserialize wx cp tp tag add or remove users result. * * @param json the json * @return the wx cp tp tag add or remove users result */ public static WxCpTpTagAddOrRemoveUsersResult deserialize(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpTagAddOrRemoveUsersResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpDepart.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpDepart.java
package me.chanjar.weixin.cp.bean; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 企业微信的部门. * * @author Daniel Qian */ @Data public class WxCpTpDepart implements Serializable { private static final long serialVersionUID = -5028321625140879571L; private Integer id; private String name; private String enName; private Integer parentid; private Integer order; /** * From json wx cp tp depart. * * @param json the json * @return the wx cp tp depart */ public static WxCpTpDepart fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpDepart.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTagIdListConvertResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTagIdListConvertResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; @Getter @Setter public class WxCpTpTagIdListConvertResult extends WxCpBaseResp { private static final long serialVersionUID = -6153589164415497369L; /** * 客户标签转换结果 */ @SerializedName("items") private List<Item> items; /** * 无法转换的客户标签ID列表 */ @SerializedName("invalid_external_tagid_list") private List<String> invalidExternalTagIdList; @Getter @Setter public static class Item { /** * 企业主体下的客户标签ID */ @SerializedName("external_tagid") private String externalTagId; /** * 服务商主体下的客户标签ID,如果传入的external_tagid已经是服务商主体下的ID,则open_external_tagid与external_tagid相同。 */ @SerializedName("open_external_tagid") private String openExternalTagId; } public static WxCpTpTagIdListConvertResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpTagIdListConvertResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTagAddOrRemoveUsersResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTagAddOrRemoveUsersResult.java
package me.chanjar.weixin.cp.bean; import com.google.common.base.Splitter; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import org.apache.commons.lang3.StringUtils; import java.io.Serializable; import java.util.Collections; import java.util.List; /** * 为标签添加或移除用户结果对象类. * Created by Binary Wang on 2017-6-22. * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data public class WxCpTagAddOrRemoveUsersResult implements Serializable { private static final long serialVersionUID = 1420065684270213578L; @Override public String toString() { return WxCpGsonBuilder.create().toJson(this); } /** * From json wx cp tag add or remove users result. * * @param json the json * @return the wx cp tag add or remove users result */ public static WxCpTagAddOrRemoveUsersResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTagAddOrRemoveUsersResult.class); } @SerializedName("errcode") private Integer errCode; @SerializedName("errmsg") private String errMsg; @SerializedName("invalidlist") private String invalidUsers; @SerializedName("invalidparty") private String[] invalidParty; /** * Gets invalid user list. * * @return the invalid user list */ public List<String> getInvalidUserList() { return this.content2List(this.invalidUsers); } private List<String> content2List(String content) { if (StringUtils.isBlank(content)) { return Collections.emptyList(); } return Splitter.on("|").splitToList(content); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpCorpId2OpenCorpId.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpCorpId2OpenCorpId.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 应用的管理员 * * @author huangxiaoming */ @Data @EqualsAndHashCode(callSuper = true) public class WxCpTpCorpId2OpenCorpId extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("open_corpid") private String openCorpId; /** * From json wx cp tp admin. * * @param json the json * @return the wx cp tp admin */ public static WxCpTpCorpId2OpenCorpId fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpCorpId2OpenCorpId.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOpenUseridToUseridResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOpenUseridToUseridResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * userid转换 * 将代开发应用或第三方应用获取的密文open_userid转换为明文userid * @author yiyingcanfeng */ @Data public class WxCpOpenUseridToUseridResult implements Serializable { private static final long serialVersionUID = 5179329535139861515L; @Override public String toString() { return WxCpGsonBuilder.create().toJson(this); } /** * From json wx cp open userid to userid result. * * @param json the json * @return the wx cp open userid to userid result */ public static WxCpOpenUseridToUseridResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpOpenUseridToUseridResult.class); } @SerializedName("errcode") private Integer errCode; @SerializedName("errmsg") private String errMsg; @SerializedName("userid_list") private List<WxCpUseridToOpenUserid> useridList; @SerializedName("invalid_open_userid_list") private List<String> invalidOpenUseridList; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUseridToOpenUseridResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUseridToOpenUseridResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * userid转换为open_userid * 将自建应用或代开发应用获取的userid转换为第三方应用的userid * Created by gxh0797 on 2022.07.26. */ @Data public class WxCpUseridToOpenUseridResult implements Serializable { private static final long serialVersionUID = 1420065684270213578L; @Override public String toString() { return WxCpGsonBuilder.create().toJson(this); } /** * From json wx cp userid to open userid result. * * @param json the json * @return the wx cp userid to open userid result */ public static WxCpUseridToOpenUseridResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpUseridToOpenUseridResult.class); } @SerializedName("errcode") private Integer errCode; @SerializedName("errmsg") private String errMsg; @SerializedName("open_userid_list") private List<WxCpUseridToOpenUserid> openUseridList; @SerializedName("invalid_userid_list") private List<String> invalidUseridList; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAuthInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAuthInfo.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 服务商模式获取授权信息 * * @author yuanqixun */ @Getter @Setter public class WxCpTpAuthInfo extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; /** * 服务商信息 */ @SerializedName("dealer_corp_info") private DealerCorpInfo dealerCorpInfo; /** * 授权企业信息 */ @SerializedName("auth_corp_info") private AuthCorpInfo authCorpInfo; /** * 授权信息。如果是通讯录应用,且没开启实体应用,是没有该项的。通讯录应用拥有企业通讯录的全部信息读写权限 */ @SerializedName("auth_info") private AuthInfo authInfo; /** * 企业当前生效的版本信息 */ @SerializedName("edition_info") private EditionInfo editionInfo; /** * The type Dealer corp info. */ @Getter @Setter public static class DealerCorpInfo extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("corpid") private String corpId; @SerializedName("corp_name") private String corpName; } /** * The type Auth corp info. */ @Getter @Setter public static class AuthCorpInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("corpid") private String corpId; @SerializedName("corp_name") private String corpName; @SerializedName("corp_type") private String corpType; @SerializedName("corp_square_logo_url") private String corpSquareLogoUrl; @SerializedName("corp_round_logo_url") private String corpRoundLogoUrl; @SerializedName("corp_user_max") private String corpUserMax; @SerializedName("corp_agent_max") private String corpAgentMax; /** * 所绑定的企业微信主体名称(仅认证过的企业有) */ @SerializedName("corp_full_name") private String corpFullName; /** * 认证到期时间 */ @SerializedName("verified_end_time") private Long verifiedEndTime; /** * 企业类型,1. 企业; 2. 政府以及事业单位; 3. 其他组织, 4.团队号 */ @SerializedName("subject_type") private Integer subjectType; /** * 授权企业在微工作台(原企业号)的二维码,可用于关注微工作台 */ @SerializedName("corp_wxqrcode") private String corpWxQrcode; @SerializedName("corp_scale") private String corpScale; @SerializedName("corp_industry") private String corpIndustry; @SerializedName("corp_sub_industry") private String corpSubIndustry; @SerializedName("location") private String location; } /** * 授权信息 */ @Getter @Setter public static class AuthInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; /** * 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent */ @SerializedName("agent") private List<Agent> agents; } /** * 企业当前生效的版本信息 */ @Getter @Setter public static class EditionInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; /** * 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent */ @SerializedName("agent") private List<Agent> agents; } /** * The type Agent. */ @Getter @Setter public static class Agent implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("agentid") private Integer agentId; @SerializedName("name") private String name; @SerializedName("round_logo_url") private String roundLogoUrl; @SerializedName("square_logo_url") private String squareLogoUrl; /** * 旧的多应用套件中的对应应用id,新开发者请忽略 */ @SerializedName("appid") @Deprecated private String appid; /** * 授权模式,0为管理员授权;1为成员授权 */ @SerializedName("auth_mode") private Integer authMode; /** * 是否为代开发自建应用 */ @SerializedName("is_customized_app") private Boolean isCustomizedApp; /** * 应用权限 */ @SerializedName("privilege") private Privilege privilege; /** * 版本id */ @SerializedName("edition_id") private String editionId; /** * 版本名称 */ @SerializedName("edition_name") private String editionName; /** * 付费状态 * <br/> * <ul> * <li>0-没有付费;</li> * <li>1-限时试用;</li> * <li>2-试用过期;</li> * <li>3-购买期内;</li> * <li>4-购买过期;</li> * <li>5-不限时试用;</li> * <li>6-购买期内,但是人数超标, 注意,超标后还可以用7天;</li> * <li>7-购买期内,但是人数超标, 且已经超标试用7天</li> * </ul> */ @SerializedName("app_status") private Integer appStatus; /** * 用户上限。 * <p>特别注意, 以下情况该字段无意义,可以忽略:</p> * <ul> * <li>1. 固定总价购买</li> * <li>2. app_status = 限时试用/试用过期/不限时试用</li> * <li>3. 在第2条“app_status=不限时试用”的情况下,如果该应用的配置为“小企业无使用限制”,user_limit有效,且为限制的人数</li> * </ul> */ @SerializedName("user_limit") private Long userLimit; /** * 版本到期时间, 秒级时间戳, 根据需要自行乘以1000(根据购买版本,可能是试用到期时间或付费使用到期时间)。 * <p>特别注意,以下情况该字段无意义,可以忽略:</p> * <ul> * <li>1. app_status = 不限时试用</li> * </ul> */ @SerializedName("expired_time") private Long expiredTime; /** * 是否虚拟版本 */ @SerializedName("is_virtual_version") private Boolean isVirtualVersion; /** * 是否由互联企业分享安装。详见 <a href='https://developer.work.weixin.qq.com/document/path/93360#24909'>企业互联</a> */ @SerializedName("is_shared_from_other_corp") private Boolean isSharedFromOtherCorp; } /** * 应用对应的权限 */ @Getter @Setter public static class Privilege implements Serializable { private static final long serialVersionUID = -5028321625140879571L; /** * 权限等级。 * 1:通讯录基本信息只读 * 2:通讯录全部信息只读 * 3:通讯录全部信息读写 * 4:单个基本信息只读 * 5:通讯录全部信息只写 */ @SerializedName("level") private Integer level; @SerializedName("allow_party") private List<Integer> allowParties; @SerializedName("allow_user") private List<String> allowUsers; @SerializedName("allow_tag") private List<Integer> allowTags; @SerializedName("extra_party") private List<Integer> extraParties; @SerializedName("extra_user") private List<String> extraUsers; @SerializedName("extra_tag") private List<Integer> extraTags; } /** * From json wx cp tp auth info. * * @param json the json * @return the wx cp tp auth info */ public static WxCpTpAuthInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpAuthInfo.class); } @Override public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpUserInfo.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * The type Wx cp tp user info. * * @author huangxiaoming */ @Data @EqualsAndHashCode(callSuper = true) public class WxCpTpUserInfo extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; /** * 用户所属企业的corpid */ @SerializedName("corpid") private String corpId; /** * 用户在企业内的UserID,如果该企业与第三方应用有授权关系时,返回明文UserId,否则返回密文UserId */ @SerializedName("userid") private String userId; /** * 成员票据,最大为512字节。 * scope为snsapi_userinfo或snsapi_privateinfo,且用户在应用可见范围之内时返回此参数。 * 后续利用该参数可以获取用户信息或敏感信息,参见:<a href="https://work.weixin.qq.com/api/doc/90001/90143/91122">...</a> */ @SerializedName("user_ticket") private String userTicket; /** * user_ticket的有效时间(秒),随user_ticket一起返回 */ @SerializedName("expires_in") private String expiresIn; /** * 全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取 */ @SerializedName("open_userid") private String openUserId; /** 非企业成员的标识,对当前服务商唯一 */ @SerializedName("openid") private String openid; /** * From json wx cp tp user info. * * @param json the json * @return the wx cp tp user info */ public static WxCpTpUserInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpUserInfo.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserDetail.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; /** * <pre> * 使用user_ticket获取成员详情接口返回类. * Created by BinaryWang on 2018/4/22. * 官方文档:https://developer.work.weixin.qq.com/document/path/91122 * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data public class WxCpUserDetail implements Serializable { private static final long serialVersionUID = -4301684507150486556L; /** * 成员UserID */ @SerializedName("userid") private String userId; /** * 成员姓名,2022年6月20号后的新应用将不再返回此字段,旧应用正常返回 */ private String name; /** * 成员手机号,仅在用户同意snsapi_privateinfo授权时返回 */ private String mobile; /** * 性别。0表示未定义,1表示男性,2表示女性 */ private String gender; /** * 成员邮箱,仅在用户同意snsapi_privateinfo授权时返回 */ private String email; /** * 头像url。注:如果要获取小图将url最后的”/0”改成”/100”即可。仅在用户同意snsapi_privateinfo授权时返回 */ private String avatar; /** * 员工个人二维码(扫描可添加为外部联系人),仅在用户同意snsapi_privateinfo授权时返回 */ @SerializedName("qr_code") private String qrCode; /** * 企业邮箱,仅在用户同意snsapi_privateinfo授权时返回,2022年6月20号后的新应用将返回 */ @SerializedName("biz_mail") private String bizMail; /** * 地址,仅在用户同意snsapi_privateinfo授权时返回,2022年6月20号后的新应用将返回 */ private String address; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOpenUseridToUserid.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpOpenUseridToUserid.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * userid转换 * 将代开发应用或第三方应用获取的密文open_userid转换为明文userid * 中间对象 * @author yiyingcanfeng */ @Data public class WxCpOpenUseridToUserid implements Serializable { private static final long serialVersionUID = 1714909184316350423L; @Override public String toString() { return WxCpGsonBuilder.create().toJson(this); } /** * From json wx cp open userid to userid result. * * @param json the json * @return the wx cp open userid to userid result. */ public static WxCpOpenUseridToUserid fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpOpenUseridToUserid.class); } @SerializedName("userid") private String userid; @SerializedName("open_userid") private String openUserid; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTagGetResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpTagGetResult.java
package me.chanjar.weixin.cp.bean; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 获取标签成员接口响应体 * * @author zhangq <zhangq002@gmail.com> * @since 2021 /2/14 16:28 */ public class WxCpTpTagGetResult extends WxCpTagGetResult { private static final long serialVersionUID = 9051748686315562400L; /** * Deserialize wx cp tp tag get result. * * @param json the json * @return the wx cp tp tag get result */ public static WxCpTpTagGetResult deserialize(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpTagGetResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpChat.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpChat.java
package me.chanjar.weixin.cp.bean; import lombok.Data; import java.io.Serializable; import java.util.List; /** * 群聊 * * @author gaigeshen */ @Data public class WxCpChat implements Serializable { private static final long serialVersionUID = -4301684507150486556L; private String id; private String name; private String owner; private List<String> users; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpConvertTmpExternalUserIdResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpConvertTmpExternalUserIdResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; @Setter @Getter public class WxCpTpConvertTmpExternalUserIdResult extends WxCpBaseResp { @SerializedName("invalid_tmp_external_userid_list") private List<Results> results; @Getter @Setter public static class Results { @SerializedName("tmp_external_userid") private String tmpExternalUserId; @SerializedName("external_userid") private String externalUserId; @SerializedName("corpid") private String corpId; @SerializedName("userid") private String userId; } @SerializedName("invalid_tmp_external_userid_list") private List<String> invalidTmpExternalUserIdList; public static WxCpTpConvertTmpExternalUserIdResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpConvertTmpExternalUserIdResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTagGetResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTagGetResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * <pre> * 管理企业号应用-测试 * Created by huansinho on 2018/4/16. * </pre> * * @author <a href="https://github.com/huansinho">huansinho</a> */ @Data @AllArgsConstructor @NoArgsConstructor public class WxCpTagGetResult implements Serializable { @SerializedName("errcode") private Integer errcode; @SerializedName("errmsg") private String errmsg; /** * 用户列表. */ @SerializedName("userlist") private List<WxCpUser> userlist; /** * 部门列表. */ @SerializedName("partylist") private List<Integer> partylist; /** * 标签名称. */ @SerializedName("tagname") private String tagname; /** * From json wx cp tag get result. * * @param json the json * @return the wx cp tag get result */ public static WxCpTagGetResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTagGetResult.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserExternalContactInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUserExternalContactInfo.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.*; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * <pre> * 外部联系人详情 * Created by Binary Wang on 2018/9/16. * 参考文档:https://work.weixin.qq.com/api/doc#13878 * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Getter @Setter public class WxCpUserExternalContactInfo implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("external_contact") private ExternalContact externalContact; @SerializedName("follow_user") private List<FollowedUser> followedUsers; /** * The type External contact. */ @Getter @Setter public static class ExternalContact implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("external_userid") private String externalUserId; @SerializedName("position") private String position; @SerializedName("name") private String name; @SerializedName("avatar") private String avatar; @SerializedName("corp_name") private String corpName; @SerializedName("corp_full_name") private String corpFullName; @SerializedName("type") private Integer type; @SerializedName("gender") private Integer gender; @SerializedName("unionid") private String unionId; @SerializedName("external_profile") private ExternalProfile externalProfile; } /** * The type External profile. */ @Setter @Getter public static class ExternalProfile implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("external_attr") private List<ExternalAttribute> externalAttrs; } /** * The type External attribute. */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public static class ExternalAttribute implements Serializable { private static final long serialVersionUID = -5696099236344075582L; /** * The type Text. */ @Setter @Getter public static class Text implements Serializable { private static final long serialVersionUID = -5696099236344075582L; private String value; } /** * The type Web. */ @Setter @Getter public static class Web implements Serializable { private static final long serialVersionUID = -5696099236344075582L; private String title; private String url; } /** * The type Mini program. */ @Setter @Getter public static class MiniProgram implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("pagepath") private String pagePath; private String appid; private String title; } private int type; private String name; private Text text; private Web web; @SerializedName("miniprogram") private MiniProgram miniProgram; } /** * The type Followed user. */ @Setter @Getter public static class FollowedUser implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("userid") private String userId; private String remark; private String description; @SerializedName("createtime") private Long createTime; private String state; @SerializedName("remark_company") private String remarkCompany; @SerializedName("remark_mobiles") private String[] remarkMobiles; private Tag[] tags; @SerializedName("add_way") private Integer addWay; @SerializedName("oper_userid") private String operUserid; } /** * From json wx cp user external contact info. * * @param json the json * @return the wx cp user external contact info */ public static WxCpUserExternalContactInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpUserExternalContactInfo.class); } /** * The type Tag. */ @Setter @Getter public static class Tag implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("group_name") private String groupName; @SerializedName("tag_name") private String tagName; private int type; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentJsapiSignature.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentJsapiSignature.java
package me.chanjar.weixin.cp.bean; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 调用wx.agentConfig时所需要的签名信息 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class WxCpAgentJsapiSignature implements Serializable { private static final long serialVersionUID = 2650119900835832545L; private String url; private String corpid; private Integer agentid; private long timestamp; private String nonceStr; private String signature; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpBaseResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpBaseResp.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 返回结果 * * @author yqx & WangWong created on 2020/3/16 */ @Getter @Setter public class WxCpBaseResp implements Serializable { private static final long serialVersionUID = -4301684507150486556L; /** * The Errcode. */ @SerializedName("errcode") protected Long errcode; /** * The Errmsg. */ @SerializedName("errmsg") protected String errmsg; /** * Success boolean. * * @return the boolean */ public boolean success() { return getErrcode() == 0; } /** * From json wx cp base resp. * * @param json the json * @return the wx cp base resp */ public static WxCpBaseResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpBaseResp.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpXmlPackage.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpXmlPackage.java
package me.chanjar.weixin.cp.bean; import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamConverter; import lombok.Data; import me.chanjar.weixin.common.util.XmlUtils; import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; import me.chanjar.weixin.cp.util.xml.XStreamTransformer; import java.io.Serializable; import java.util.Map; /** * 回调消息包. * https://work.weixin.qq.com/api/doc#90001/90143/91116 * * @author zhenjun cai */ @XStreamAlias("xml") @Data public class WxCpTpXmlPackage implements Serializable { private static final long serialVersionUID = 6031833682211475786L; /** * 使用dom4j解析的存放所有xml属性和值的map. */ private Map<String, Object> allFieldsMap; /** * The To user name. */ @XStreamAlias("ToUserName") @XStreamConverter(value = XStreamCDataConverter.class) protected String toUserName; /** * The Agent id. */ @XStreamAlias("AgentID") @XStreamConverter(value = XStreamCDataConverter.class) protected String agentId; /** * The Msg encrypt. */ @XStreamAlias("Encrypt") @XStreamConverter(value = XStreamCDataConverter.class) protected String msgEncrypt; /** * From xml wx cp tp xml package. * * @param xml the xml * @return the wx cp tp xml package */ public static WxCpTpXmlPackage fromXml(String xml) { //修改微信变态的消息内容格式,方便解析 //xml = xml.replace("</PicList><PicList>", ""); final WxCpTpXmlPackage xmlPackage = XStreamTransformer.fromXml(WxCpTpXmlPackage.class, xml); xmlPackage.setAllFieldsMap(XmlUtils.xml2Map(xml)); return xmlPackage; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAppQrcode.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAppQrcode.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 应用的管理员 * * @author huangxiaoming */ @Data @EqualsAndHashCode(callSuper = true) public class WxCpTpAppQrcode extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("qrcode") private String qrcode; /** * From json wx cp tp admin. * * @param json the json * @return the wx cp tp admin */ public static WxCpTpAppQrcode fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpAppQrcode.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPermanentCodeInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPermanentCodeInfo.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 服务商模式获取永久授权码信息 * * @author yunaqixun */ @Getter @Setter public class WxCpTpPermanentCodeInfo extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("access_token") private String accessToken; @SerializedName("expires_in") private Long expiresIn; @SerializedName("permanent_code") private String permanentCode; /** * 授权企业信息 */ @SerializedName("auth_corp_info") private AuthCorpInfo authCorpInfo; /** * 授权信息。如果是通讯录应用,且没开启实体应用,是没有该项的。通讯录应用拥有企业通讯录的全部信息读写权限 */ @SerializedName("auth_info") private AuthInfo authInfo; /** * 授权用户信息 */ @SerializedName("auth_user_info") private AuthUserInfo authUserInfo; /** * 推广二维码安装相关信息 */ @SerializedName("register_code_info") private RegisterCodeInfo registerCodeInfo; /** * 企业当前生效的版本信息 */ @SerializedName("edition_info") private EditionInfo editionInfo; /** * 安装应用时,扫码或者授权链接中带的state值。详见state说明 * state说明: * 目前会返回state包含以下几个场景。 * (1)扫带参二维码授权代开发模版。 */ @SerializedName("state") private String state; /** * The type Auth corp info. */ @Getter @Setter public static class AuthCorpInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("corpid") private String corpId; @SerializedName("corp_name") private String corpName; @SerializedName("corp_type") private String corpType; @SerializedName("corp_square_logo_url") private String corpSquareLogoUrl; @SerializedName("corp_round_logo_url") private String corpRoundLogoUrl; @SerializedName("corp_user_max") private String corpUserMax; @SerializedName("corp_agent_max") private String corpAgentMax; /** * 所绑定的企业微信主体名称(仅认证过的企业有) */ @SerializedName("corp_full_name") private String corpFullName; /** * 认证到期时间 */ @SerializedName("verified_end_time") private Long verifiedEndTime; /** * 企业类型,1. 企业; 2. 政府以及事业单位; 3. 其他组织, 4.团队号 */ @SerializedName("subject_type") private Integer subjectType; /** * 授权企业在微工作台(原企业号)的二维码,可用于关注微工作台 */ @SerializedName("corp_wxqrcode") private String corpWxQrcode; @SerializedName("corp_scale") private String corpScale; @SerializedName("corp_industry") private String corpIndustry; @SerializedName("corp_sub_industry") private String corpSubIndustry; @SerializedName("location") private String location; } /** * 授权信息 */ @Getter @Setter public static class AuthInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; /** * 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent */ @SerializedName("agent") private List<Agent> agents; } /** * 企业当前生效的版本信息 */ @Getter @Setter public static class EditionInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; /** * 授权的应用信息,注意是一个数组,但仅旧的多应用套件授权时会返回多个agent,对新的单应用授权,永远只返回一个agent */ @SerializedName("agent") private List<Agent> agents; } /** * The type Agent. */ @Getter @Setter public static class Agent implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("agentid") private Integer agentId; @SerializedName("name") private String name; @SerializedName("round_logo_url") private String roundLogoUrl; @SerializedName("square_logo_url") private String squareLogoUrl; /** * 旧的多应用套件中的对应应用id,新开发者请忽略 */ @SerializedName("appid") @Deprecated private String appid; /** * 授权模式,0为管理员授权;1为成员授权 */ @SerializedName("auth_mode") private Integer authMode; /** * 是否为代开发自建应用 */ @SerializedName("is_customized_app") private Boolean isCustomizedApp; /** * 应用权限 */ @SerializedName("privilege") private Privilege privilege; /** * 版本id */ @SerializedName("edition_id") private String editionId; /** * 版本名称 */ @SerializedName("edition_name") private String editionName; /** * 付费状态 * <br/> * <ul> * <li>0-没有付费;</li> * <li>1-限时试用;</li> * <li>2-试用过期;</li> * <li>3-购买期内;</li> * <li>4-购买过期;</li> * <li>5-不限时试用;</li> * <li>6-购买期内,但是人数超标, 注意,超标后还可以用7天;</li> * <li>7-购买期内,但是人数超标, 且已经超标试用7天</li> * </ul> */ @SerializedName("app_status") private Integer appStatus; /** * 用户上限。 * <p>特别注意, 以下情况该字段无意义,可以忽略:</p> * <ul> * <li>1. 固定总价购买</li> * <li>2. app_status = 限时试用/试用过期/不限时试用</li> * <li>3. 在第2条“app_status=不限时试用”的情况下,如果该应用的配置为“小企业无使用限制”,user_limit有效,且为限制的人数</li> * </ul> */ @SerializedName("user_limit") private Long userLimit; /** * 版本到期时间, 秒级时间戳, 根据需要自行乘以1000(根据购买版本,可能是试用到期时间或付费使用到期时间)。 * <p>特别注意,以下情况该字段无意义,可以忽略:</p> * <ul> * <li>1. app_status = 不限时试用</li> * </ul> */ @SerializedName("expired_time") private Long expiredTime; /** * 是否虚拟版本 */ @SerializedName("is_virtual_version") private Boolean isVirtualVersion; /** * 是否由互联企业分享安装。详见 <a href='https://developer.work.weixin.qq.com/document/path/93360#24909'>企业互联</a> */ @SerializedName("is_shared_from_other_corp") private Boolean isSharedFromOtherCorp; } /** * 授权人员信息 */ @Getter @Setter public static class AuthUserInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("userid") private String userId; @SerializedName("name") private String name; @SerializedName("avatar") private String avatar; /** * 授权管理员的open_userid,可能为空 */ @SerializedName("open_userid") private String openUserid; } /** * 推广二维码安装相关信息 */ @Getter @Setter public static class RegisterCodeInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; /** * 注册码 */ @SerializedName("register_code") private String registerCode; /** * 推广包ID */ @SerializedName("template_id") private String templateId; /** * 仅当获取注册码指定该字段时才返回 */ @SerializedName("state") private String state; } /** * 应用对应的权限 */ @Getter @Setter public static class Privilege implements Serializable { private static final long serialVersionUID = -5028321625140879571L; /** * 权限等级。 * 1:通讯录基本信息只读 * 2:通讯录全部信息只读 * 3:通讯录全部信息读写 * 4:单个基本信息只读 * 5:通讯录全部信息只写 */ @SerializedName("level") private Integer level; @SerializedName("allow_party") private List<Integer> allowParties; @SerializedName("allow_user") private List<String> allowUsers; @SerializedName("allow_tag") private List<Integer> allowTags; @SerializedName("extra_party") private List<Integer> extraParties; @SerializedName("extra_user") private List<String> extraUsers; @SerializedName("extra_tag") private List<Integer> extraTags; } /** * From json wx cp tp permanent code info. * * @param json the json * @return the wx cp tp permanent code info */ public static WxCpTpPermanentCodeInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpPermanentCodeInfo.class); } @Override public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpProviderToken.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpProviderToken.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 服务商凭证. * * @author <a href="https://github.com/binarywang">Binary Wang</a> created on 2019-11-02 */ @Data public class WxCpProviderToken implements Serializable { private static final long serialVersionUID = -4301684507150486556L; /** * 服务商的access_token,最长为512字节。 */ @SerializedName("provider_access_token") private String providerAccessToken; /** * provider_access_token有效期(秒) */ @SerializedName("expires_in") private Integer expiresIn; /** * From json wx cp provider token. * * @param json the json * @return the wx cp provider token */ public static WxCpProviderToken fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpProviderToken.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/Gender.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/Gender.java
package me.chanjar.weixin.cp.bean; import lombok.AllArgsConstructor; import lombok.Getter; /** * <pre> * 性别枚举 * Created by BinaryWang on 2018/4/22. * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Getter @AllArgsConstructor public enum Gender { /** * 未定义 */ UNDEFINED("未定义", "0"), /** * 男 */ MALE("男", "1"), /** * 女 */ FEMALE("女", "2"); private final String genderName; private final String code; /** * From code gender. * * @param code the code * @return the gender */ public static Gender fromCode(String code) { for (Gender a : Gender.values()) { if (a.code.equals(code)) { return a; } } return null; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTag.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTag.java
package me.chanjar.weixin.cp.bean; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * Created by Daniel Qian. * * @author Daniel Qian */ @Data @AllArgsConstructor @NoArgsConstructor public class WxCpTag implements Serializable { private static final long serialVersionUID = -7243320279646928402L; private String id; private String name; /** * From json wx cp tag. * * @param json the json * @return the wx cp tag */ public static WxCpTag fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTag.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPreauthCode.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpPreauthCode.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 预授权码返回 * * @author yqx created on 2020/3/19 */ @Getter @Setter public class WxCpTpPreauthCode extends WxCpBaseResp { /** * The Pre auth code. */ @SerializedName("pre_auth_code") String preAuthCode; /** * The Expires in. */ @SerializedName("expires_in") Long expiresIn; /** * From json wx cp tp preauth code. * * @param json the json * @return the wx cp tp preauth code */ public static WxCpTpPreauthCode fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpPreauthCode.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUseridToOpenUserid.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUseridToOpenUserid.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * userid转换为open_userid * 将自建应用或代开发应用获取的userid转换为第三方应用的userid * 中间对象 * Created by gxh0797 on 2022.07.26. */ @Data public class WxCpUseridToOpenUserid implements Serializable { private static final long serialVersionUID = 1420065684270213578L; @Override public String toString() { return WxCpGsonBuilder.create().toJson(this); } /** * From json wx cp userid to open userid. * * @param json the json * @return the wx cp userid to open userid */ public static WxCpUseridToOpenUserid fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpUseridToOpenUserid.class); } @SerializedName("userid") private String userid; @SerializedName("open_userid") private String openUserid; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAdmin.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpTpAdmin.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * 应用的管理员 * * @author huangxiaoming */ @Data @EqualsAndHashCode(callSuper = true) public class WxCpTpAdmin extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("admin") private List<Admin> admin; /** * The type Admin. */ @Getter @Setter public static class Admin extends WxCpBaseResp { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("userid") private String userId; @SerializedName("open_userid") private String openUserId; @SerializedName("auth_type") private Integer authType; public String toJson() { return WxGsonBuilder.create().toJson(this); } } /** * From json wx cp tp admin. * * @param json the json * @return the wx cp tp admin */ public static WxCpTpAdmin fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpTpAdmin.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMaJsCode2SessionResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpMaJsCode2SessionResult.java
package me.chanjar.weixin.cp.bean; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * <pre> * 小程序登录凭证校验 * 文档地址:https://work.weixin.qq.com/api/doc#90000/90136/90289/wx.qy.login * </pre> * * @author <a href="https://github.com/binarywang">Binary Wang</a> */ @Data public class WxCpMaJsCode2SessionResult implements Serializable { private static final long serialVersionUID = 6229609023682814765L; @SerializedName("session_key") private String sessionKey; @SerializedName("userid") private String userId; @SerializedName("corpid") private String corpId; /** * From json wx cp ma js code 2 session result. * * @param json the json * @return the wx cp ma js code 2 session result */ public static WxCpMaJsCode2SessionResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpMaJsCode2SessionResult.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java
package me.chanjar.weixin.cp.bean; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.cp.bean.workbench.WorkBenchKeyData; import me.chanjar.weixin.cp.bean.workbench.WorkBenchList; import me.chanjar.weixin.cp.constant.WxCpConsts; import java.io.Serializable; import java.util.List; /** * The type Wx cp agent work bench. * * @author songshiyu created on : create in 16:09 2020/9/27 工作台自定义展示 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class WxCpAgentWorkBench implements Serializable { private static final long serialVersionUID = -4136604790232843229L; /** * 展示类型,目前支持 “keydata”、 “image”、 “list” 、”webview” */ private String type; /** * 用户的userid */ private String userId; /** * 用户的userIds */ private List<String> useridList; /** * 应用id */ private Long agentId; /** * 点击跳转url,若不填且应用设置了主页url,则跳转到主页url,否则跳到应用会话窗口 */ private String jumpUrl; /** * 若应用为小程序类型,该字段填小程序pagepath,若未设置,跳到小程序主页 */ private String pagePath; /** * 图片url:图片的最佳比例为3.35:1;webview:渲染展示的url */ private String url; /** * 是否覆盖用户工作台的数据。设置为true的时候,会覆盖企业所有用户当前设置的数据。若设置为false,则不会覆盖用户当前设置的所有数据 */ private Boolean replaceUserData; /** * 是否开启webview内的链接跳转能力,默认值为false。注意:开启之后,会使jump_url失效。 链接跳转仅支持以下schema方式:wxwork://openurl?url=xxxx,注意url需要进行编码。 * 参考示例:<a href="wxwork://openurl?url=https%3A%2F%2Fwork.weixin.qq.com%2F">今日要闻</a> */ private Boolean enableWebviewClick; /** * 高度。可以有两种选择:single_row与double_row。当为single_row时,高度为106px(如果隐藏标题则为147px)。 * 当为double_row时,高度固定为171px(如果隐藏标题则为212px)。默认值为double_row */ private String height; /** * 是否要隐藏展示了应用名称的标题部分,默认值为false。 */ private Boolean hideTitle; private List<WorkBenchKeyData> keyDataList; private List<WorkBenchList> lists; /** * 生成模板Json字符串 * * @return the string */ public String toTemplateString() { JsonObject templateObject = new JsonObject(); templateObject.addProperty("agentid", this.agentId); templateObject.addProperty("type", this.type); if (this.replaceUserData != null) { templateObject.addProperty("replace_user_data", this.replaceUserData); } this.handle(templateObject); return templateObject.toString(); } /** * 生成用户数据Json字符串 * * @return the string */ public String toUserDataString() { JsonObject userDataObject = new JsonObject(); userDataObject.addProperty("agentid", this.agentId); userDataObject.addProperty("userid", this.userId); userDataObject.addProperty("type", this.type); this.handle(userDataObject); return userDataObject.toString(); } /** * 生成批量用户数据Json字符串 * * @return the string */ public String toBatchUserDataString() { JsonObject userDataObject = new JsonObject(); userDataObject.addProperty("agentid", this.agentId); JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.useridList).getAsJsonArray(); userDataObject.add("userid_list", useridList); this.handleBatch(userDataObject); return userDataObject.toString(); } /** * 处理不用类型的工作台数据 */ private void handle(JsonObject templateObject) { switch (this.getType()) { case WxCpConsts.WorkBenchType.KEYDATA: { JsonArray keyDataArray = new JsonArray(); JsonObject itemsObject = new JsonObject(); for (WorkBenchKeyData keyDataItem : this.keyDataList) { JsonObject keyDataObject = new JsonObject(); keyDataObject.addProperty("key", keyDataItem.getKey()); keyDataObject.addProperty("data", keyDataItem.getData()); keyDataObject.addProperty("jump_url", keyDataItem.getJumpUrl()); keyDataObject.addProperty("pagepath", keyDataItem.getPagePath()); keyDataArray.add(keyDataObject); } itemsObject.add("items", keyDataArray); templateObject.add("keydata", itemsObject); break; } case WxCpConsts.WorkBenchType.IMAGE: { JsonObject image = new JsonObject(); image.addProperty("url", this.url); image.addProperty("jump_url", this.jumpUrl); image.addProperty("pagepath", this.pagePath); templateObject.add("image", image); break; } case WxCpConsts.WorkBenchType.LIST: { JsonArray listArray = new JsonArray(); JsonObject itemsObject = new JsonObject(); for (WorkBenchList listItem : this.lists) { JsonObject listObject = new JsonObject(); listObject.addProperty("title", listItem.getTitle()); listObject.addProperty("jump_url", listItem.getJumpUrl()); listObject.addProperty("pagepath", listItem.getPagePath()); listArray.add(listObject); } itemsObject.add("items", listArray); templateObject.add("list", itemsObject); break; } case WxCpConsts.WorkBenchType.WEBVIEW: { JsonObject webview = new JsonObject(); webview.addProperty("url", this.url); webview.addProperty("jump_url", this.jumpUrl); webview.addProperty("pagepath", this.pagePath); if (this.enableWebviewClick != null) { webview.addProperty("enable_webview_click", this.enableWebviewClick); } webview.addProperty("height", this.height); if (this.hideTitle != null) { webview.addProperty("hide_title", this.hideTitle); } templateObject.add("webview", webview); break; } default: { //do nothing } } } /** * 处理不用类型的工作台数据 */ private void handleBatch(JsonObject templateObject) { switch (this.getType()) { case WxCpConsts.WorkBenchType.KEYDATA: { JsonArray keyDataArray = new JsonArray(); JsonObject itemsObject = new JsonObject(); for (WorkBenchKeyData keyDataItem : this.keyDataList) { JsonObject keyDataObject = new JsonObject(); keyDataObject.addProperty("key", keyDataItem.getKey()); keyDataObject.addProperty("data", keyDataItem.getData()); keyDataObject.addProperty("jump_url", keyDataItem.getJumpUrl()); keyDataObject.addProperty("pagepath", keyDataItem.getPagePath()); keyDataArray.add(keyDataObject); } itemsObject.add("items", keyDataArray); JsonObject dataObject = new JsonObject(); dataObject.addProperty("type", WxCpConsts.WorkBenchType.KEYDATA); dataObject.add("keydata", itemsObject); templateObject.add("data", dataObject); break; } case WxCpConsts.WorkBenchType.IMAGE: { JsonObject image = new JsonObject(); image.addProperty("url", this.url); image.addProperty("jump_url", this.jumpUrl); image.addProperty("pagepath", this.pagePath); JsonObject dataObject = new JsonObject(); dataObject.addProperty("type", WxCpConsts.WorkBenchType.IMAGE); dataObject.add("image", image); templateObject.add("data", dataObject); break; } case WxCpConsts.WorkBenchType.LIST: { JsonArray listArray = new JsonArray(); JsonObject itemsObject = new JsonObject(); for (WorkBenchList listItem : this.lists) { JsonObject listObject = new JsonObject(); listObject.addProperty("title", listItem.getTitle()); listObject.addProperty("jump_url", listItem.getJumpUrl()); listObject.addProperty("pagepath", listItem.getPagePath()); listArray.add(listObject); } itemsObject.add("items", listArray); JsonObject dataObject = new JsonObject(); dataObject.addProperty("type", WxCpConsts.WorkBenchType.LIST); dataObject.add("list", itemsObject); templateObject.add("data", dataObject); break; } case WxCpConsts.WorkBenchType.WEBVIEW: { JsonObject webview = new JsonObject(); webview.addProperty("url", this.url); webview.addProperty("jump_url", this.jumpUrl); webview.addProperty("pagepath", this.pagePath); if (this.enableWebviewClick != null) { webview.addProperty("enable_webview_click", this.enableWebviewClick); } webview.addProperty("height", this.height); if (this.hideTitle != null) { webview.addProperty("hide_title", this.hideTitle); } JsonObject dataObject = new JsonObject(); dataObject.addProperty("type", WxCpConsts.WorkBenchType.WEBVIEW); dataObject.add("webview", webview); templateObject.add("data", dataObject); break; } default: { //do nothing } } } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpUser.java
package me.chanjar.weixin.cp.bean; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * 微信用户信息. * * @author Daniel Qian */ @Data @Accessors(chain = true) public class WxCpUser implements Serializable { private static final long serialVersionUID = -5696099236344075582L; private String userId; private String newUserId; private String name; private Long[] departIds; private Integer[] orders; private String position; private String[] positions; /** * 代开发自建应用类型于2022年6月20号后的新建应用将不再返回此字段,需要在【获取访问用户敏感信息】接口中获取 */ private String mobile; /** * 代开发自建应用类型于2022年6月20号后的新建应用将不再返回此字段,需要在【获取访问用户敏感信息】接口中获取 */ private Gender gender; /** * 代开发自建应用类型于2022年6月20号后的新建应用将不再返回此字段,需要在【获取访问用户敏感信息】接口中获取 */ private String email; /** * 代开发自建应用类型于2022年6月20号后的新建应用将不再返回此字段,需要在【获取访问用户敏感信息】接口中获取 */ private String bizMail; /** * 代开发自建应用类型于2022年6月20号后的新建应用将不再返回此字段,需要在【获取访问用户敏感信息】接口中获取 */ private String avatar; private String thumbAvatar; private String mainDepartment; /** * 全局唯一。对于同一个服务商,不同应用获取到企业内同一个成员的open_userid是相同的,最多64个字节。仅第三方应用可获取 */ private String openUserId; /** * 地址。长度最大128个字符,代开发自建应用类型于2022年6月20号后的新建应用将不再返回此字段,需要在【获取访问用户敏感信息】接口中获取 */ private String address; private String avatarMediaId; private Integer status; private Integer enable; /** * 别名;第三方仅通讯录应用可获取 */ private String alias; private Integer isLeader; /** * is_leader_in_dept. * 个数必须和department一致,表示在所在的部门内是否为上级。1表示为上级,0表示非上级。在审批等应用里可以用来标识上级审批人 */ private Integer[] isLeaderInDept; private final List<Attr> extAttrs = new ArrayList<>(); private Integer hideMobile; private String englishName; private String telephone; /** * 代开发自建应用类型于2022年6月20号后的新建应用将不再返回此字段,需要在【获取访问用户敏感信息】接口中获取 */ private String qrCode; private Boolean toInvite; /** * 成员对外信息. */ private List<ExternalAttribute> externalAttrs = new ArrayList<>(); private String externalPosition; private String externalCorpName; private WechatChannels wechatChannels; private String[] directLeader; /** * Add external attr. * * @param externalAttr the external attr */ public void addExternalAttr(ExternalAttribute externalAttr) { this.externalAttrs.add(externalAttr); } /** * Add ext attr. * * @param name the name * @param value the value */ public void addExtAttr(String name, String value) { this.extAttrs.add(new Attr().setType(0).setName(name).setTextValue(value)); } /** * Add ext attr. * * @param attr the attr */ public void addExtAttr(Attr attr) { this.extAttrs.add(attr); } /** * From json wx cp user. * * @param json the json * @return the wx cp user */ public static WxCpUser fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpUser.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } /** * The type Attr. */ @Data @Accessors(chain = true) @Builder @NoArgsConstructor @AllArgsConstructor public static class Attr implements Serializable { private static final long serialVersionUID = -5696099236344075582L; /** * 属性类型: 0-文本 1-网页 */ private Integer type; private String name; private String textValue; private String webUrl; private String webTitle; } /** * The type External attribute. */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public static class ExternalAttribute implements Serializable { private static final long serialVersionUID = -5696099236344075582L; /** * 属性类型: 0-本文 1-网页 2-小程序. */ private Integer type; /** * 属性名称: 需要先确保在管理端有创建改属性,否则会忽略. */ private String name; /** * 文本属性内容,长度限制12个UTF8字符. */ private String value; /** * 网页的url,必须包含http或者https头. */ private String url; /** * 小程序的展示标题,长度限制12个UTF8字符. * 或者 网页的展示标题,长度限制12个UTF8字符 */ private String title; /** * 小程序appid,必须是有在本企业安装授权的小程序,否则会被忽略. */ private String appid; /** * 小程序的页面路径. */ private String pagePath; } /** * The type Wechat channels. */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public static class WechatChannels implements Serializable { private static final long serialVersionUID = -5696099236344075582L; private String nickname; private Integer status; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpDepart.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpDepart.java
package me.chanjar.weixin.cp.bean; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 企业微信的部门. * * @author Daniel Qian */ @Data public class WxCpDepart implements Serializable { private static final long serialVersionUID = -5028321625140879571L; private Long id; private String name; private String enName; private String[] departmentLeader; private Long parentId; private Long order; /** * From json wx cp depart. * * @param json the json * @return the wx cp depart */ public static WxCpDepart fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpDepart.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/taskcard/TaskCardButton.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/taskcard/TaskCardButton.java
package me.chanjar.weixin.cp.bean.taskcard; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * <pre> * 任务卡片按钮 * Created by Jeff on 2019-05-16. * </pre> * * @author <a href="https://github.com/domainname">Jeff</a> created on 2019-05-16 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class TaskCardButton implements Serializable { private static final long serialVersionUID = -4301684507150486556L; private String key; private String name; private String replaceName; private String color; private Boolean bold; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingResult.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingResult.java
package me.chanjar.weixin.cp.bean.living; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 直播返回对象. * * @author Wang_Wong */ @Data public class WxCpLivingResult implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("errcode") private Integer errcode; @SerializedName("errmsg") private String errmsg; /** * The type Living id result. */ @Getter @Setter public static class LivingIdResult implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("next_cursor") private String nextCursor; @SerializedName("livingid_list") private String[] livingIdList; /** * From json living id result. * * @param json the json * @return the living id result */ public static LivingIdResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, LivingIdResult.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } } /** * From json wx cp living result. * * @param json the json * @return the wx cp living result */ public static WxCpLivingResult fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpLivingResult.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingShareInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingShareInfo.java
package me.chanjar.weixin.cp.bean.living; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 跳转小程序商城的直播观众信息. * * @author Wang_Wong */ @Data public class WxCpLivingShareInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; private String livingid; @SerializedName("viewer_userid") private String viewerUserid; @SerializedName("viewer_external_userid") private String viewerExternalUserid; @SerializedName("invitor_userid") private String invitorUserid; @SerializedName("invitor_external_userid") private String invitorExternalUserid; /** * From json wx cp living share info. * * @param json the json * @return the wx cp living share info */ public static WxCpLivingShareInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpLivingShareInfo.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingModifyRequest.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingModifyRequest.java
package me.chanjar.weixin.cp.bean.living; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 创建预约直播请求. * * @author Wang_Wong created on 2021-12-23 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class WxCpLivingModifyRequest implements Serializable { private static final long serialVersionUID = -4960239393895754138L; @SerializedName("livingid") private String livingId; @SerializedName("theme") private String theme; @SerializedName("living_start") private Long livingStart; @SerializedName("living_duration") private Long livingDuration; @SerializedName("remind_time") private Long remindTime; @SerializedName("description") private String description; @SerializedName("type") private Integer type; /** * From json wx cp living modify request. * * @param json the json * @return the wx cp living modify request */ public static WxCpLivingModifyRequest fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpLivingModifyRequest.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingCreateRequest.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingCreateRequest.java
package me.chanjar.weixin.cp.bean.living; import com.google.gson.annotations.SerializedName; import lombok.*; import lombok.experimental.Accessors; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 创建预约直播请求. * * @author Wang_Wong created on 2021-12-23 */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class WxCpLivingCreateRequest implements Serializable { private static final long serialVersionUID = -4960239393895754138L; @SerializedName("anchor_userid") private String anchorUserid; @SerializedName("theme") private String theme; @SerializedName("living_start") private Long livingStart; @SerializedName("living_duration") private Long livingDuration; @SerializedName("remind_time") private Long remindTime; @SerializedName("description") private String description; @SerializedName("type") private Integer type; @SerializedName("agentid") private Integer agentId; @SerializedName("activity_cover_mediaid") private String activityCoverMediaid; @SerializedName("activity_share_mediaid") private String activityShareMediaid; @SerializedName("activity_detail") private ActivityDetail activityDetail; /** * The type Activity detail. */ @Getter @Setter public static class ActivityDetail implements Serializable { @SerializedName("image_list") private List<String> imageList; @SerializedName("description") private String description; /** * From json activity detail. * * @param json the json * @return the activity detail */ public static ActivityDetail fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, ActivityDetail.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } } /** * From json wx cp living create request. * * @param json the json * @return the wx cp living create request */ public static WxCpLivingCreateRequest fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpLivingCreateRequest.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpLivingInfo.java
package me.chanjar.weixin.cp.bean.living; import com.google.gson.annotations.SerializedName; import lombok.Data; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; /** * 直播详情信息. * * @author Wang_Wong */ @Data public class WxCpLivingInfo implements Serializable { private static final long serialVersionUID = -5028321625140879571L; @SerializedName("theme") private String theme; @SerializedName("living_start") private Long livingStart; @SerializedName("living_duration") private Long livingDuration; @SerializedName("status") private Integer status; @SerializedName("reserve_living_duration") private Long reserveLivingDuration; @SerializedName("reserve_start") private Long reserveStart; @SerializedName("description") private String description; @SerializedName("anchor_userid") private String anchorUserid; @SerializedName("main_department") private Long mainDepartment; @SerializedName("viewer_num") private Integer viewerNum; @SerializedName("comment_num") private Integer commentNum; @SerializedName("mic_num") private Integer micNum; @SerializedName("open_replay") private Integer openReplay; @SerializedName("replay_status") private Integer replayStatus; @SerializedName("type") private Integer type; @SerializedName("push_stream_url") private String pushStreamUrl; @SerializedName("online_count") private Integer onlineCount; @SerializedName("subscribe_count") private Integer subscribeCount; /** * From json wx cp living info. * * @param json the json * @return the wx cp living info */ public static WxCpLivingInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpLivingInfo.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpWatchStat.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/living/WxCpWatchStat.java
package me.chanjar.weixin.cp.bean.living; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 直播观看明细. * * @author Wang_Wong */ @Data public class WxCpWatchStat implements Serializable { private static final long serialVersionUID = -5028321625140879571L; private Integer ending; @SerializedName("next_key") private String nextKey; @SerializedName("stat_info") private StatInfo statInfo; /** * The type Stat info. */ @Getter @Setter public static class StatInfo implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("users") private List<WxCpWatchStat.User> users; @SerializedName("external_users") private List<WxCpWatchStat.ExternalUser> externalUsers; } /** * The type User. */ @Getter @Setter public static class User implements Serializable { private static final long serialVersionUID = -5696099236344075582L; private String userid; @SerializedName("watch_time") private Long watchTime; @SerializedName("is_comment") private Integer isComment; @SerializedName("is_mic") private Integer isMic; } /** * The type External user. */ @Getter @Setter public static class ExternalUser implements Serializable { private static final long serialVersionUID = -5696099236344075582L; private String name; private Integer type; @SerializedName("external_userid") private String externalUserid; @SerializedName("watch_time") private Long watchTime; @SerializedName("is_comment") private Integer isComment; @SerializedName("is_mic") private Integer isMic; } /** * From json wx cp watch stat. * * @param json the json * @return the wx cp watch stat */ public static WxCpWatchStat fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpWatchStat.class); } /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetServicerStatisticRequest.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetServicerStatisticRequest.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * 获取「客户数据统计」接待人员明细数据 * * @author MsThink created on 2023/5/13 */ @NoArgsConstructor @Data public class WxCpKfGetServicerStatisticRequest { /** * 客服帐号ID */ @SerializedName("open_kfid") private String openKfId; /** * 接待人员的userid。第三方应用为密文userid,即open_userid */ @SerializedName("servicer_userid") private String servicerUserid; /** * 起始日期的时间戳,填这一天的0时0分0秒(否则系统自动处理为当天的0分0秒)。取值范围:昨天至前180天 */ @SerializedName("start_time") private Long startTime; /** * 结束日期的时间戳,填这一天的0时0分0秒(否则系统自动处理为当天的0分0秒)。取值范围:昨天至前180天 */ @SerializedName("end_time") private Long endTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetServicerStatisticResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetServicerStatisticResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * 获取「客户数据统计」接待人员明细数据 * * @author MsThink created on 2023/5/13 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfGetServicerStatisticResp extends WxCpBaseResp { /** * 统计数据列表 */ @SerializedName("statistic_list") private List<WxCpKfGetServicerStatisticResp.StatisticList> statisticList; /** * The type Statistic list. */ @NoArgsConstructor @Data public static class StatisticList { /** * 数据统计日期,为当日0点的时间戳 */ @SerializedName("stat_time") private Long statTime; /** * 一天的统计数据。若当天未产生任何下列统计数据或统计数据还未计算完成则不会返回此项 */ @SerializedName("statistic") private WxCpKfGetServicerStatisticResp.Statistic statistic; } /** * The type Statistic. */ @NoArgsConstructor @Data public static class Statistic { /** * 接入人工会话数。客户发过消息并分配给接待人员的咨询会话数 */ @SerializedName("session_cnt") private Integer sessionCnt; /** * 咨询客户数。在会话中发送过消息且接入了人工会话的客户数量,若客户多次咨询只计算一个客户 */ @SerializedName("customer_cnt") private Integer customerCnt; /** * 咨询消息总数。客户在会话中发送的消息的数量 */ @SerializedName("customer_msg_cnt") private Integer customerMsgCnt; /** * 人工回复率。一个自然日内,客户给接待人员发消息的会话中,接待人员回复了的会话的占比。若数据项不返回,代表没有给接待人员发送消息的客户,此项无法计算。 */ @SerializedName("reply_rate") private Float replyRate; /** * 平均首次响应时长,单位:秒。一个自然日内,客户给接待人员发送的第一条消息至接待人员回复之间的时长,为首次响应时长。所有的首次回复总时长/已回复的咨询会话数, * 即为平均首次响应时长 。若数据项不返回,代表没有给接待人员发送消息的客户,此项无法计算 */ @SerializedName("first_reply_average_sec") private Float firstReplyAverageSec; /** * 满意度评价发送数。当api托管了会话分配,满意度原生功能失效,满意度评价发送数为0 */ @SerializedName("satisfaction_investgate_cnt") private Integer satisfactionInvestgateCnt; /** * 满意度参评率 。当api托管了会话分配,满意度原生功能失效。若数据项不返回,代表没有发送满意度评价,此项无法计算 */ @SerializedName("satisfaction_participation_rate") private Float satisfactionParticipationRate; /** * “满意”评价占比 。在客户参评的满意度评价中,评价是“满意”的占比。当api托管了会话分配,满意度原生功能失效。若数据项不返回,代表没有客户参评的满意度评价,此项无法计算 */ @SerializedName("satisfied_rate") private Float satisfiedRate; /** * “一般”评价占比 。在客户参评的满意度评价中,评价是“一般”的占比。当api托管了会话分配,满意度原生功能失效。若数据项不返回,代表没有客户参评的满意度评价,此项无法计算 */ @SerializedName("middling_rate") private Float middlingRate; /** * “不满意”评价占比。在客户参评的满意度评价中,评价是“不满意”的占比。当api托管了会话分配,满意度原生功能失效。若数据项不返回,代表没有客户参评的满意度评价,此项无法计算 */ @SerializedName("dissatisfied_rate") private Float dissatisfiedRate; /** * 升级服务客户数。通过「升级服务」功能成功添加专员或加入客户群的客户数,若同一个客户添加多个专员或客户群,只计算一个客户。在2022年3月10日以后才会有对应统计数据 */ @SerializedName("upgrade_service_customer_cnt") private Integer upgradeServiceCustomerCnt; /** * 专员服务邀请数。接待人员通过「升级服务-专员服务」向客户发送服务专员名片的次数。在2022年3月10日以后才会有对应统计数据 */ @SerializedName("upgrade_service_member_invite_cnt") private Integer upgradeServiceMemberInviteCnt; /** * 添加专员的客户数 。客户成功添加专员为好友的数量,若同一个客户添加多个专员,则计算多个客户数。在2022年3月10日以后才会有对应统计数据 */ @SerializedName("upgrade_service_member_customer_cnt") private Integer upgradeServiceMemberCustomerCnt; /** * 客户群服务邀请数。接待人员通过「升级服务-客户群服务」向客户发送客户群二维码的次数。在2022年3月10日以后才会有对应统计数据 */ @SerializedName("upgrade_service_groupchat_invite_cnt") private Integer upgradeServiceGroupchatInviteCnt; /** * 加入客户群的客户数。客户成功加入客户群的数量,若同一个客户加多个客户群,则计算多个客户数。在2022年3月10日以后才会有对应统计数据 */ @SerializedName("upgrade_service_groupchat_customer_cnt") private Integer upgradeServiceGroupchatCustomerCnt; /** * 被拒收消息的客户数。被接待人员设置了“不再接收消息”的客户数 */ @SerializedName("msg_rejected_customer_cnt") private Integer msgRejectedCustomerCnt; } /** * From json wx cp kf get servicer statistic resp. * * @param json the json * @return the wx cp kf get servicer statistic resp */ public static WxCpKfGetServicerStatisticResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfGetServicerStatisticResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountLink.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountLink.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 获取客服帐号链接-请求参数 * * @author Fu created on 2022/1/19 19:18 */ @NoArgsConstructor @Data public class WxCpKfAccountLink implements Serializable { private static final long serialVersionUID = -1920926948347984256L; /** * 客服帐号ID */ @SerializedName("open_kfid") private String openKfid; /** * 场景值,字符串类型,由开发者自定义。 * 不多于32字节 * 字符串取值范围(正则表达式):[0-9a-zA-Z_-]* * <p> * 1. 若scene非空,返回的客服链接开发者可拼接scene_param=SCENE_PARAM参数使用,用户进入会话事件会将SCENE_PARAM原样返回。 * 其中SCENE_PARAM需要urlencode,且长度不能超过128字节。 * 如 https://work.weixin.qq.com/kf/kfcbf8f8d07ac7215f?enc_scene=ENCGFSDF567DF&scene_param=a%3D1%26b%3D2 * 2. 历史调用接口返回的客服链接(包含encScene=XXX参数),不支持scene_param参数。 * 3. 返回的客服链接,不能修改或复制参数到其他链接使用。否则进入会话事件参数校验不通过,导致无法回调。 */ @SerializedName("scene") private String scene; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServicerOpResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServicerOpResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * 添加/删除客服接待人员返回结果 * * @author leiin created on 2022/1/26 4:11 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfServicerOpResp extends WxCpBaseResp { private static final long serialVersionUID = -4082459764202987034L; @SerializedName("result_list") private List<WxCpKfServicerResp> resultList; /** * The type Wx cp kf servicer resp. */ @Data @NoArgsConstructor public static class WxCpKfServicerResp extends WxCpBaseResp { @SerializedName("userid") private String userId; } /** * From json wx cp kf servicer op resp. * * @param json the json * @return the wx cp kf servicer op resp */ public static WxCpKfServicerOpResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfServicerOpResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountDel.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountDel.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 删除客服帐号-请求参数 * * @author Fu created on 2022/1/19 19:09 */ @NoArgsConstructor @Data public class WxCpKfAccountDel implements Serializable { private static final long serialVersionUID = 1997221467585676772L; /** * 客服帐号ID。 * 不多于64字节 */ @SerializedName("open_kfid") private String openKfid; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServiceUpgradeConfigResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServiceUpgradeConfigResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * The type Wx cp kf service upgrade config resp. * * @author leiin created on 2022/4/26 5:21 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfServiceUpgradeConfigResp extends WxCpBaseResp { private static final long serialVersionUID = -3212550906238196617L; @SerializedName("member_range") private MemberRange memberRange; @SerializedName("groupchat_range") private GroupchatRange groupchatRange; /** * From json wx cp kf service upgrade config resp. * * @param json the json * @return the wx cp kf service upgrade config resp */ public static WxCpKfServiceUpgradeConfigResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfServiceUpgradeConfigResp.class); } /** * The type Member range. */ @Data @NoArgsConstructor public static class MemberRange { @SerializedName("userid_list") private List<String> useridList; @SerializedName("department_id_list") private List<Integer> departmentIdList; } /** * The type Groupchat range. */ @Data @NoArgsConstructor public static class GroupchatRange { @SerializedName("chat_id_list") private List<String> chatIdList; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfMsgSendResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfMsgSendResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * The type Wx cp kf msg send resp. * * @author leiin created on 2022/1/26 7:41 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfMsgSendResp extends WxCpBaseResp { @SerializedName("msgid") private String msgId; /** * From json wx cp kf msg send resp. * * @param json the json * @return the wx cp kf msg send resp */ public static WxCpKfMsgSendResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfMsgSendResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServiceStateTransResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServiceStateTransResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * The type Wx cp kf service state trans resp. * * @author leiin created on 2022/1/26 5:03 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfServiceStateTransResp extends WxCpBaseResp { private static final long serialVersionUID = -7874378445629022791L; @SerializedName("msg_code") private String msgCode; /** * From json wx cp kf service state trans resp. * * @param json the json * @return the wx cp kf service state trans resp */ public static WxCpKfServiceStateTransResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfServiceStateTransResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfMsgListResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfMsgListResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.bean.kf.msg.*; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * The type Wx cp kf msg list resp. * * @author leiin created on 2022/1/26 5:24 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfMsgListResp extends WxCpBaseResp { private static final long serialVersionUID = -3115552079069452091L; @SerializedName("next_cursor") private String nextCursor; @SerializedName("has_more") private Integer hasMore; @SerializedName("msg_list") private List<WxCpKfMsgItem> msgList; /** * The type Wx cp kf msg item. */ @NoArgsConstructor @Data public static class WxCpKfMsgItem { @SerializedName("msgid") private String msgId; @SerializedName("open_kfid") private String openKfid; @SerializedName("external_userid") private String externalUserId; @SerializedName("send_time") private Long sendTime; private Integer origin; @SerializedName("servicer_userid") private String servicerUserId; @SerializedName("msgtype") private String msgType; private WxCpKfTextMsg text; private WxCpKfResourceMsg image; private WxCpKfResourceMsg voice; private WxCpKfResourceMsg video; private WxCpKfResourceMsg file; private WxCpKfLocationMsg location; private WxCpKfLinkMsg link; @SerializedName("business_card") private WxCpKfBusinessCardMsg businessCard; @SerializedName("miniprogram") private WxCpKfMiniProgramMsg miniProgram; @SerializedName("msgmenu") private WxCpKfMenuMsg msgMenu; private WxCpKfEventMsg event; @SerializedName("channels_shop_product") private WxCpKfChannelsShopProductMsg channelsShopProduct; @SerializedName("channels_shop_order") private WxCpKfChannelsShopOrderMsg channelsShopOrder; } /** * From json wx cp kf msg list resp. * * @param json the json * @return the wx cp kf msg list resp */ public static WxCpKfMsgListResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfMsgListResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetCorpStatisticRequest.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetCorpStatisticRequest.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * 获取「客户数据统计」企业汇总数据 * * @author zhongjun created on 2022/4/25 */ @NoArgsConstructor @Data public class WxCpKfGetCorpStatisticRequest { /** * 客服帐号ID。不传入时返回的数据为企业维度汇总的数据 */ @SerializedName("open_kfid") private String openKfId; /** * 起始日期的时间戳,填这一天的0时0分0秒(否则系统自动处理为当天的0分0秒)。取值范围:昨天至前180天 */ @SerializedName("start_time") private Long startTime; /** * 结束日期的时间戳,填这一天的0时0分0秒(否则系统自动处理为当天的0分0秒)。取值范围:昨天至前180天 */ @SerializedName("end_time") private Long endTime; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfCustomerBatchGetResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfCustomerBatchGetResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.bean.external.contact.ExternalContact; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * The type Wx cp kf customer batch get resp. * * @author leiin created on 2022/1/26 7:56 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfCustomerBatchGetResp extends WxCpBaseResp { private static final long serialVersionUID = -3697709507605389887L; @SerializedName("customer_list") private List<ExternalContact> customerList; @SerializedName("invalid_external_userid") private List<String> invalidExternalUserId; /** * From json wx cp kf customer batch get resp. * * @param json the json * @return the wx cp kf customer batch get resp */ public static WxCpKfCustomerBatchGetResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfCustomerBatchGetResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountAdd.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountAdd.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 添加客服帐号-请求参数 * * @author Fu created on 2022/1/19 18:59 */ @NoArgsConstructor @Data public class WxCpKfAccountAdd implements Serializable { private static final long serialVersionUID = 3565729481246537411L; /** * 客服名称;不多于16个字符 */ @SerializedName("name") private String name; /** * 客服头像临时素材。可以调用上传临时素材接口获取。 * 不多于128个字节 */ @SerializedName("media_id") private String mediaId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountLinkResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountLinkResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 获取客服帐号链接-结果 * * @author Fu created on 2022/1/19 19:18 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfAccountLinkResp extends WxCpBaseResp { private static final long serialVersionUID = 910205439597092481L; /** * 客服链接,开发者可将该链接嵌入到H5页面中,用户点击链接即可向对应的微信客服帐号发起咨询。开发者也可根据该url自行生成需要的二维码图片 */ @SerializedName("url") private String url; /** * From json wx cp kf account link resp. * * @param json the json * @return the wx cp kf account link resp */ public static WxCpKfAccountLinkResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfAccountLinkResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServiceStateResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServiceStateResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * The type Wx cp kf service state resp. * * @author leiin created on 2022/1/26 5:00 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfServiceStateResp extends WxCpBaseResp { private static final long serialVersionUID = 8077134413448067090L; @SerializedName("service_state") private Integer serviceState; @SerializedName("servicer_userid") private String servicerUserId; /** * From json wx cp kf service state resp. * * @param json the json * @return the wx cp kf service state resp */ public static WxCpKfServiceStateResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfServiceStateResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServicerListResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfServicerListResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * The type Wx cp kf servicer list resp. * * @author leiin created on 2022/1/26 4:29 下午 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfServicerListResp extends WxCpBaseResp { private static final long serialVersionUID = -5079770046571012449L; @SerializedName("servicer_list") private List<WxCpKfServicerStatus> servicerList; /** * The type Wx cp kf servicer status. */ @NoArgsConstructor @Data public static class WxCpKfServicerStatus { @SerializedName("userid") private String userId; private Integer status; } /** * From json wx cp kf servicer list resp. * * @param json the json * @return the wx cp kf servicer list resp */ public static WxCpKfServicerListResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfServicerListResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountUpd.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountUpd.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; /** * 修改客服帐号-请求参数 * * @author Fu created on 2022/1/19 19:10 */ @NoArgsConstructor @Data public class WxCpKfAccountUpd implements Serializable { private static final long serialVersionUID = -900712046553752529L; /** * 要修改的客服帐号ID。 * 不多于64字节 */ @SerializedName("open_kfid") private String openKfid; /** * 新的客服名称,如不需要修改可不填。 * 不多于16个字符 */ @SerializedName("name") private String name; /** * 新的客服头像临时素材,如不需要修改可不填。可以调用上传临时素材接口获取。 * 不多于128个字节 */ @SerializedName("media_id") private String mediaId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountAddResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountAddResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; /** * 添加客服帐号-返回结果 * * @author Fu created on 2022/1/19 19:04 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfAccountAddResp extends WxCpBaseResp { private static final long serialVersionUID = -6649323005421772827L; /** * 新创建的客服帐号ID */ @SerializedName("open_kfid") private String openKfid; /** * From json wx cp kf account add resp. * * @param json the json * @return the wx cp kf account add resp */ public static WxCpKfAccountAddResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfAccountAddResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountListResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfAccountListResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * 获取客服帐号列表-结果 * * @author Fu created on 2022/1/19 19:13 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfAccountListResp extends WxCpBaseResp { private static final long serialVersionUID = -1317201649692262217L; /** * 帐号信息列表 */ @SerializedName("account_list") private List<AccountListDTO> accountList; /** * The type Account list dto. */ @NoArgsConstructor @Data public static class AccountListDTO { /** * 客服帐号ID */ @SerializedName("open_kfid") private String openKfid; /** * 客服名称 */ @SerializedName("name") private String name; /** * 客服头像URL */ @SerializedName("avatar") private String avatar; /** * 当前调用接口的应用身份,是否有该客服账号的管理权限(编辑客服账号信息、分配会话和收发消息)。组件应用不返回此字段 */ @SerializedName("manage_privilege") private Boolean hasManagePrivilege; } /** * From json wx cp kf account list resp. * * @param json the json * @return the wx cp kf account list resp */ public static WxCpKfAccountListResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfAccountListResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfMsgSendRequest.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfMsgSendRequest.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.kf.msg.*; /** * The type Wx cp kf msg send request. * * @author leiin created on 2022/1/26 7:00 下午 */ @NoArgsConstructor @Data public class WxCpKfMsgSendRequest { /** * (发送欢迎语等事件响应消息) 事件响应消息对应的code。通过事件回调下发,仅可使用一次。 */ private String code; /** * <pre> * 参数:touser * 是否必须:是 * 类型:string * 说明:指定接收消息的客户UserID * </pre> */ @SerializedName("touser") private String toUser; /** * <pre> * 参数:open_kfid * 是否必须:是 * 类型:string * 说明:指定发送消息的客服帐号ID * </pre> */ @SerializedName("open_kfid") private String openKfid; /** * <pre> * 参数:msgid * 是否必须:否 * 类型:string * 说明:指定消息ID * </pre> */ @SerializedName("msgid") private String msgId; /** * <pre> * 参数:msgtype * 是否必须:是 * 类型:string * 说明:消息类型,(text,image,voice,video,file,link,miniprogram,msgmenu,location) * </pre> */ @SerializedName("msgtype") private String msgType; /** * <pre> * 参数:text * 是否必须:是 * 类型:obj * 说明:文本消息 * </pre> */ private WxCpKfTextMsg text; /** * <pre> * 参数:image * 是否必须:是 * 类型:obj * 说明:图片消息 * </pre> */ private WxCpKfResourceMsg image; /** * <pre> * 参数:voice * 是否必须:是 * 类型:obj * 说明:语音消息 * </pre> */ private WxCpKfResourceMsg voice; /** * <pre> * 参数:video * 是否必须:是 * 类型:obj * 说明:视频消息 * </pre> */ private WxCpKfResourceMsg video; /** * <pre> * 参数:file * 是否必须:是 * 类型:obj * 说明:文件消息 * </pre> */ private WxCpKfResourceMsg file; /** * <pre> * 参数:link * 是否必须:是 * 类型:obj * 说明:链接消息 * </pre> */ private WxCpKfLinkMsg link; /** * <pre> * 参数:miniprogram * 是否必须:是 * 类型:obj * 说明:小程序消息 * </pre> */ @SerializedName("miniprogram") private WxCpKfMiniProgramMsg miniProgram; /** * <pre> * 参数:msgmenu * 是否必须:是 * 类型:obj * 说明:菜单消息 * </pre> */ @SerializedName("msgmenu") private WxCpKfMenuMsg msgMenu; /** * <pre> * 参数:location * 是否必须:是 * 类型:obj * 说明:菜单消息 * </pre> */ @SerializedName("location") private WxCpKfLocationMsg location; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetCorpStatisticResp.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/WxCpKfGetCorpStatisticResp.java
package me.chanjar.weixin.cp.bean.kf; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.util.List; /** * 获取「客户数据统计」企业汇总数据 * * @author zhongjun created on 2022/4/25 */ @EqualsAndHashCode(callSuper = true) @NoArgsConstructor @Data public class WxCpKfGetCorpStatisticResp extends WxCpBaseResp { private static final long serialVersionUID = -89898989898989898L; /** * 统计数据列表 */ @SerializedName("statistic_list") private List<StatisticList> statisticList; /** * The type Statistic list. */ @NoArgsConstructor @Data public static class StatisticList { /** * 数据统计日期,为当日0点的时间戳 */ @SerializedName("stat_time") private Long statTime; /** * 一天的统计数据。若当天未产生任何下列统计数据或统计数据还未计算完成则不会返回此项 */ @SerializedName("statistic") private Statistic statistic; } /** * The type Statistic. */ @NoArgsConstructor @Data public static class Statistic { /** * 咨询会话数。客户发过消息并分配给接待人员或智能助手的客服会话数,转接不会产生新的会话 */ @SerializedName("session_cnt") private Integer sessionCnt; /** * 咨询客户数。在会话中发送过消息的客户数量,若客户多次咨询只计算一个客户 */ @SerializedName("customer_cnt") private Integer customerCnt; /** * 咨询消息总数。客户在会话中发送的消息的数量 */ @SerializedName("customer_msg_cnt") private Integer customerMsgCnt; /** * 升级服务客户数。通过「升级服务」功能成功添加专员或加入客户群的客户数,若同一个客户添加多个专员或客户群,只计算一个客户。在2022年3月10日以后才会有对应统计数据 */ @SerializedName("upgrade_service_customer_cnt") private Integer upgradeServiceCustomerCnt; /** * 智能回复会话数。客户发过消息并分配给智能助手的咨询会话数。通过API发消息或者开启智能回复功能会将客户分配给智能助手 */ @SerializedName("ai_session_reply_cnt") private Integer aiSessionReplyCnt; /** * 转人工率。一个自然日内,客户给智能助手发消息的会话中,转人工的会话的占比。 */ @SerializedName("ai_transfer_rate") private Float aiTransferRate; /** * 知识命中率。一个自然日内,客户给智能助手发送的消息中,命中知识库的占比。只有在开启了智能回复原生功能并配置了知识库的情况下,才会产生该项统计数据。当api * 托管了会话分配,智能回复原生功能失效。若不返回,代表没有向配置知识库的智能接待助手发送消息,该项无法计算 */ @SerializedName("ai_knowledge_hit_rate") private Float aiKnowledgeHitRate; /** * 被拒收消息的客户数。被接待人员设置了“不再接收消息”的客户数 */ @SerializedName("msg_rejected_customer_cnt") private Integer msgRejectedCustomerCnt; } /** * From json wx cp kf get corp statistic resp. * * @param json the json * @return the wx cp kf get corp statistic resp */ public static WxCpKfGetCorpStatisticResp fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpKfGetCorpStatisticResp.class); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfEventMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfEventMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf event msg. * * @author leiin created on 2022/1/26 6:44 下午 */ @NoArgsConstructor @Data public class WxCpKfEventMsg { @SerializedName("event_type") private String eventType; @SerializedName("open_kfid") private String openKfid; @SerializedName("external_userid") private String externalUserId; @SerializedName("servicer_userid") private String servicerUserId; @SerializedName("old_servicer_userid") private String oldServicerUserId; @SerializedName("new_servicer_userid") private String newServicerUserId; private String scene; @SerializedName("scene_param") private String sceneParam; @SerializedName("welcome_code") private String welcomeCode; @SerializedName("fail_msgid") private String failMsgId; @SerializedName("fail_type") private Integer failType; private Integer status; @SerializedName("change_type") private Integer changeType; @SerializedName("msg_code") private String msgCode; @SerializedName("recall_msgid") private String recallMsgId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfBusinessCardMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfBusinessCardMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf business card msg. * * @author leiin created on 2022/1/26 5:35 下午 */ @NoArgsConstructor @Data public class WxCpKfBusinessCardMsg { @SerializedName("userid") private String userId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfMiniProgramMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfMiniProgramMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf mini program msg. * * @author leiin created on 2022/1/26 6:22 下午 */ @NoArgsConstructor @Data public class WxCpKfMiniProgramMsg { /** * 参数:appid * 是否必须:是 * 类型:string * 说明:小程序appid */ @SerializedName("appid") private String appId; /** * 参数:title * 是否必须:否 * 类型:string * 说明:小程序消息标题,最多64个字节,超过会自动截断 */ @SerializedName("title") private String title; /** * 参数:thumb_media_id * 是否必须:是 * 类型:string * 说明:小程序消息封面的mediaid,封面图建议尺寸为520*416 */ @SerializedName("thumb_media_id") private String thumbMediaId; /** * 参数:pagepath * 是否必须:是 * 类型:string * 说明:点击消息卡片后进入的小程序页面路径。注意路径要以.html为后缀,否则在微信中打开会提示找不到页面 */ @SerializedName("pagepath") private String pagePath; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfMenuMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfMenuMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.util.List; /** * The type Wx cp kf menu msg. * * @author leiin created on 2022/1/26 6:33 下午 */ @NoArgsConstructor @Data public class WxCpKfMenuMsg { /** * 参数:head_content * 是否必须:否 * 类型:string * 说明:起始文本 不多于1024字节 */ @SerializedName("head_content") private String headContent; private List<WxCpKfMenuItem> list; /** * 参数:tail_content * 是否必须:否 * 类型:string * 说明:结束文本 不多于1024字节 */ @SerializedName("tail_content") private String tailContent; /** * The type Wx cp kf menu item. */ @NoArgsConstructor @Data public static class WxCpKfMenuItem { /** * 参数:type * 是否必须:是 * 类型:string * 说明:菜单类型。click-回复菜单 view-超链接菜单 miniprogram-小程序菜单 */ private String type; /** * type为click的菜单项 */ private MenuClick click; /** * type为view的菜单项 */ private MenuView view; /** * type为miniprogram的菜单项 */ @SerializedName("miniprogram") private MiniProgram miniProgram; /** * type为text的菜单项 */ private MenuText text; } /** * The type Menu click. */ @Getter @Setter public static class MenuClick { /** * <pre> * 是否必须:否 * 说明:菜单ID。不少于1字节 不多于128字节 * </pre> */ private String id; /** * <pre> * 是否必须:是 * 说明:菜单显示内容。不少于1字节 不多于128字节 * </pre> */ private String content; } /** * The type Menu view. */ @Getter @Setter public static class MenuView { /** * <pre> * 是否必须:是 * 说明:点击后跳转的链接。不少于1字节 不多于2048字节 * </pre> */ private String url; /** * <pre> * 是否必须:是 * 说明:菜单显示内容。不少于1字节 不多于1024字节 * </pre> */ private String content; } /** * The type Mini program. */ @Getter @Setter public static class MiniProgram { /** * <pre> * 是否必须:是 * 说明:小程序appid。 * </pre> */ @SerializedName("appid") private String appId; /** * <pre> * 点击后进入的小程序页面。 * </pre> */ @SerializedName("pagepath") private String pagePath; /** * <pre> * 菜单显示内容。不多于1024字节 * </pre> */ private String content; } /** * * The type Menu text. * */ @Getter @Setter public static class MenuText { /** * <pre> * 是否必须:是 * 说明:文本内容,支持\n(\和n两个字符)换行。不少于1字节 不多于256字节 * </pre> */ private String content; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfTextMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfTextMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf text msg. * * @author leiin created on 2022/1/26 5:30 下午 */ @NoArgsConstructor @Data public class WxCpKfTextMsg { /** * <pre> * 参数:content * 是否必须:是 * 类型:string * 说明:消息内容,最长不超过2048个字节 * </pre> */ private String content; @SerializedName("menu_id") private String menuId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfChannelsShopProductMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfChannelsShopProductMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf channels shop product msg. * * @author dalin created on 2023/1/10 17:26 * */ @NoArgsConstructor @Data public class WxCpKfChannelsShopProductMsg { /** * 商品ID */ @SerializedName("product_id") private String productId; /** * 商品图片 */ @SerializedName("head_img") private String headImg; /** * 商品标题 */ @SerializedName("title") private String title; /** * 商品价格,以分为单位 */ @SerializedName("sales_price") private String salesPrice; /** * 店铺名称 */ @SerializedName("shop_nickname") private String shopNickname; /** * 店铺头像 */ @SerializedName("shop_head_img") private String shopHeadImg; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfLinkMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfLinkMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf link msg. * * @author leiin created on 2022/1/26 5:33 下午 */ @NoArgsConstructor @Data public class WxCpKfLinkMsg { /** * 参数:title * 是否必须:是 * 类型:string * 说明:标题,不超过128个字节,超过会自动截断 */ @SerializedName("title") private String title; /** * 参数:desc * 是否必须:否 * 类型:string * 说明:描述,不超过512个字节,超过会自动截断 */ @SerializedName("desc") private String desc; /** * 参数:url * 是否必须:是 * 类型:string * 说明:点击后跳转的链接。 最长2048字节,请确保包含了协议头(http/https) */ @SerializedName("url") private String url; /** * 参数:thumb_media_id * 是否必须:是 * 类型:string * 说明:发送消息参数,缩略图的media_id, 可以通过素材管理接口获得。此处thumb_media_id即上传接口返回的media_id */ @SerializedName("thumb_media_id") private String thumb_media_id; /** * 返回消息参数 */ @SerializedName("pic_url") private String picUrl; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfLocationMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfLocationMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf location msg. * * @author leiin created on 2022/1/26 5:32 下午 */ @NoArgsConstructor @Data public class WxCpKfLocationMsg { /** * 参数:name * 是否必须:否 * 类型:string * 说明:位置名 */ private String name; /** * 参数:address * 是否必须:否 * 类型:string * 说明:地址详情说明 */ private String address; /** * 参数:latitude * 是否必须:是 * 类型:float * 说明:纬度,浮点数,范围为90 ~ -90 */ private Float latitude; /** * 参数:longitude * 是否必须:是 * 类型:float * 说明:经度,浮点数,范围为180 ~ -180 */ private Float longitude; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfChannelsShopOrderMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfChannelsShopOrderMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf channels shop order msg. * * @author dalin created on 2023/1/10 17:28 * */ @NoArgsConstructor @Data public class WxCpKfChannelsShopOrderMsg { /** * 订单号 */ @SerializedName("order_id") private String orderId; /** * 商品标题 */ @SerializedName("product_titles") private String productTitles; /** * 订单价格描述 */ @SerializedName("price_wording") private String priceWording; /** * 订单状态 */ @SerializedName("state") private String state; /** * 订单缩略图 */ @SerializedName("image_url") private String imageUrl; /** * 店铺名称 */ @SerializedName("shop_nickname") private String shopNickname; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfResourceMsg.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/kf/msg/WxCpKfResourceMsg.java
package me.chanjar.weixin.cp.bean.kf.msg; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; /** * The type Wx cp kf resource msg. * * @author leiin created on 2022/1/26 5:31 下午 */ @NoArgsConstructor @Data public class WxCpKfResourceMsg { @SerializedName("media_id") private String mediaId; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpApprovalInfoQueryFilter.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpApprovalInfoQueryFilter.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import me.chanjar.weixin.common.util.json.WxGsonBuilder; import java.io.Serializable; /** * <pre> * 批量获取审批单号的筛选条件,可对批量拉取的审批申请设置约束条件,支持设置多个条件 * 注意: * 仅“部门”支持同时配置多个筛选条件。 * 不同类型的筛选条件之间为“与”的关系,同类型筛选条件之间为“或”的关系 * </pre> * * @author element */ @Data public class WxCpApprovalInfoQueryFilter implements Serializable { private static final long serialVersionUID = 3318064927980231802L; private KEY key; private Object value; /** * To json string. * * @return the string */ public String toJson() { return WxGsonBuilder.create().toJson(this); } /** * The enum Key. */ @Getter public enum KEY { /** * template_id - 模板类型/模板id; */ @SerializedName("template_id") TEMPLATE_ID("template_id"), /** * creator - 申请人; */ @SerializedName("creator") CREATOR("creator"), /** * department - 审批单提单者所在部门; */ @SerializedName("department") DEPARTMENT("department"), /** * sp_status - 审批状态。 */ @SerializedName("sp_status") SP_STATUS("sp_status"), /** * record_type - 审批单类型属性,1-请假;2-打卡补卡;3-出差;4-外出;5-加班; 6- 调班;7-会议室预定;8-退款审批;9-红包报销审批。 */ @SerializedName("record_type") record_type("record_type"); private final String value; KEY(String value) { this.value = value; } } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpCheckinMonthData.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpCheckinMonthData.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; import java.util.List; /** * 企业微信打卡月报数据 * * @author longliveh */ @Data public class WxCpCheckinMonthData implements Serializable { private static final long serialVersionUID = -3062328201807894236L; /** * baseInfo 基础信息 */ @SerializedName("base_info") private BaseInfo baseInfo; /** * The type Base info. */ @Data public static class BaseInfo implements Serializable { private static final long serialVersionUID = -5368331890851903885L; /** * record_type 记录类型:1-固定上下班;2-外出(此报表中不会出现外出打卡数据);3-按班次上下班;4-自由签到;5-加班;7-无规则 */ @SerializedName("record_type") private Integer recordType; /** * name 打卡人员姓名 */ @SerializedName("name") private String name; /** * name_ex 打卡人员别名 */ @SerializedName("name_ex") private String nameEx; /** * departs_name 打卡人员所在部门,会显示所有所在部门 */ @SerializedName("departs_name") private String departsName; /** * acctid 打卡人员帐号,即userid */ @SerializedName("acctid") private String acctId; /** * rule_info 打卡人员所属规则信息 */ @SerializedName("rule_info") private RuleInfo ruleInfo; /** * The type Rule info. */ @Data public static class RuleInfo implements Serializable { private static final long serialVersionUID = 9152263355916880710L; /** * groupid 所属规则Id */ @SerializedName("groupid") private Integer groupId; /** * groupname 所属规则Id */ @SerializedName("groupname") private String groupName; } } /** * summary_info 打卡人员所属规则信息 */ @SerializedName("summary_info") private SummaryInfo summaryInfo; /** * The type Summary info. */ @Data public static class SummaryInfo implements Serializable { private static final long serialVersionUID = -1956770107240513983L; /** * work_days 应打卡天数 */ @SerializedName("work_days") private Integer workDays; /** * regular_days 正常天数 */ @SerializedName("regular_days") private Integer regularDays; /** * except_days 异常天数 */ @SerializedName("except_days") private Integer exceptDays; /** * regular_work_sec 实际工作时长,为统计周期每日实际工作时长之和 */ @SerializedName("regular_work_sec") private Integer regularWorkSec; /** * standard_work_sec 正常天数 */ @SerializedName("standard_work_sec") private Integer standardWorkSec; } /** * exception_infos 异常状态统计信息 */ @SerializedName("exception_infos") private List<ExceptionInfo> exceptionInfos; /** * The type Exception info. */ @Data public static class ExceptionInfo implements Serializable { private static final long serialVersionUID = -4855850255704089359L; /** * exception 异常类型:1-迟到;2-早退;3-缺卡;4-旷工;5-地点异常;6-设备异常 */ @SerializedName("exception") private Integer exception; /** * count 异常次数,为统计周期内每日此异常次数之和 */ @SerializedName("count") private Integer count; /** * duration 异常时长(迟到/早退/旷工才有值),为统计周期内每日此异常时长之和 */ @SerializedName("duration") private Integer duration; } /** * sp_items 假勤统计信息 */ @SerializedName("sp_items") private List<SpItem> spItems; /** * The type Sp item. */ @Data public static class SpItem implements Serializable { private static final long serialVersionUID = 224472626753597080L; /** * type 假勤类型:1-请假;2-补卡;3-出差;4-外出;100-外勤 */ @SerializedName("type") private Integer type; /** * vacation_id 具体请假类型,当type为1请假时,具体的请假类型id,可通过审批相关接口获取假期详情 */ @SerializedName("vacation_id") private Integer vacationId; /** * count 假勤次数,为统计周期内每日此假勤发生次数之和 */ @SerializedName("count") private Integer count; /** * duration 假勤时长,为统计周期内每日此假勤发生时长之和,时长单位为天直接除以86400即为天数,单位为小时直接除以3600即为小时数 */ @SerializedName("duration") private Integer duration; /** * time_type 时长单位:0-按天 1-按小时 */ @SerializedName("time_type") private Integer timeType; /** * name 统计项名称 */ @SerializedName("name") private String name; } /** * overwork_info 加班情况 */ @SerializedName("overwork_info") private OverWorkInfo overworkInfo; /** * The type Over work info. */ @Data public static class OverWorkInfo implements Serializable { private static final long serialVersionUID = -9149524232645899305L; /** * workday_over_sec 工作日加班时长 */ @SerializedName("workday_over_sec") private Integer workdayOverSec; /** * holidays_over_sec 节假日加班时长 */ @SerializedName("holidays_over_sec") private Integer holidaysOverSec; /** * restdays_over_sec 休息日加班时长 */ @SerializedName("restdays_over_sec") private Integer restdaysOverSec; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpCheckinOption.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpCheckinOption.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; /** * 企业微信打卡规则. * * @author Element created on 2019-04-06 13:22 */ @Data public class WxCpCheckinOption implements Serializable { private static final long serialVersionUID = -1964233697990417482L; @SerializedName("userid") private String userId; @SerializedName("group") private WxCpCheckinGroupBase group; }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpUserVacationQuota.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpUserVacationQuota.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 成员假期余额信息. * * @author Wang_Wong */ @Data public class WxCpUserVacationQuota extends WxCpBaseResp implements Serializable { private static final long serialVersionUID = 7387181805254287157L; @SerializedName("lists") private List<VacationQuota> lists; /** * The type Vacation quota. */ @Getter @Setter public static class VacationQuota implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("id") private Integer id; @SerializedName("assignduration") private Integer assignDuration; @SerializedName("usedduration") private Integer usedDuration; @SerializedName("leftduration") private Integer leftDuration; @SerializedName("vacationname") private String vacationName; } /** * From json wx cp user vacation quota. * * @param json the json * @return the wx cp user vacation quota */ public static WxCpUserVacationQuota fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpUserVacationQuota.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplate.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplate.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; import me.chanjar.weixin.cp.bean.oa.templatedata.TemplateContent; import me.chanjar.weixin.cp.bean.oa.templatedata.TemplateTitle; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 新增/更新审批模板的请求对象 * * @author yiyingcanfeng */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @Accessors(chain = true) public class WxCpOaApprovalTemplate implements Serializable { private static final long serialVersionUID = 8332120725354015143L; /** * 仅更新审批模版时需要提供 */ @SerializedName("template_id") private String templateId; @SerializedName("template_name") private List<TemplateTitle> templateName; @SerializedName("template_content") private TemplateContent templateContent; public static WxCpOaApprovalTemplate fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpOaApprovalTemplate.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/SummaryInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/SummaryInfo.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.experimental.Accessors; import java.io.Serializable; import java.util.List; /** * 摘要行信息,用于定义某一行摘要显示的内容. * * @author <a href="https://github.com/binarywang">Binary Wang</a> created on 2020-07-19 */ @Data @Accessors(chain = true) public class SummaryInfo implements Serializable { private static final long serialVersionUID = 8262265774851382414L; /** * 摘要行信息,用于定义某一行摘要显示的内容 */ @SerializedName("summary_info") private List<SummaryInfoData> summaryInfoData; /** * The type Summary info data. */ @Data @Accessors(chain = true) public static class SummaryInfoData implements Serializable { private static final long serialVersionUID = 5314161929610113856L; /** * 摘要行显示文字,用于记录列表和消息通知的显示,不要超过20个字符 */ private String text; /** * 摘要行显示语言 */ private String lang; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApplyEventRequest.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApplyEventRequest.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.experimental.Accessors; import me.chanjar.weixin.cp.bean.oa.applydata.ApplyDataContent; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 提交审批申请 请求对象类. * * @author <a href="https://github.com/binarywang">Binary Wang</a> created on 2020-07-18 */ @Data @Accessors(chain = true) public class WxCpOaApplyEventRequest implements Serializable { private static final long serialVersionUID = 3362660678938569341L; /** * 申请人userid,此审批申请将以此员工身份提交,申请人需在应用可见范围内 */ @SerializedName("creator_userid") private String creatorUserId; /** * 模板id。可在“获取审批申请详情”、“审批状态变化回调通知”中获得,也可在审批模板的模板编辑页面链接中获得。暂不支持通过接口提交[打卡补卡][调班]模板审批单。 */ @SerializedName("template_id") private String templateId; /** * 审批人模式:0-通过接口指定审批人、抄送人(此时approver、notifyer等参数可用); 1-使用此模板在管理后台设置的审批流程,支持条件审批。默认为0 */ @SerializedName("use_template_approver") private Integer useTemplateApprover; /** * 提单者提单部门id,不填默认为主部门 */ @SerializedName("choose_department") private Integer chooseDepartment; /** * 审批流程信息(新版流程列表),用于指定审批申请的审批流程,支持单人审批、多人会签、多人或签,可能有多个审批节点,仅use_template_approver为0时生效。 */ @SerializedName("process") private Process process; /** * 审批流程信息(旧版),用于指定审批申请的审批流程,支持单人审批、多人会签、多人或签,可能有多个审批节点,仅use_template_approver为0时生效。 */ @SerializedName("approver") private List<Approver> approvers; /** * 抄送人节点userid列表,仅use_template_approver为0时生效。 */ @SerializedName("notifyer") private String[] notifiers; /** * 抄送方式:1-提单时抄送(默认值); 2-单据通过后抄送;3-提单和单据通过后抄送。仅use_template_approver为0时生效。 */ @SerializedName("notify_type") private Integer notifyType; /** * 审批申请数据,可定义审批申请中各个控件的值,其中必填项必须有值,选填项可为空,数据结构同“获取审批申请详情”接口返回值中同名参数“apply_data” */ @SerializedName("apply_data") private ApplyData applyData; /** * 摘要信息,用于显示在审批通知卡片、审批列表的摘要信息,最多3行 */ @SerializedName("summary_list") private List<SummaryInfo> summaryList; /** * To json string. * * @return the string */ public String toJson() { return WxCpGsonBuilder.create().toJson(this); } /** * The type Approver. */ @Data @Accessors(chain = true) public static class Approver implements Serializable { private static final long serialVersionUID = 7625206971546930988L; /** * 节点审批方式:1-或签;2-会签,仅在节点为多人审批时有效 */ private Integer attr; /** * 审批节点审批人userid列表,若为多人会签、多人或签,需填写每个人的userid */ @SerializedName("userid") private String[] userIds; } /** * The type Apply data. */ @Data @Accessors(chain = true) public static class ApplyData implements Serializable { private static final long serialVersionUID = -2462732405265306981L; /** * 审批申请数据,可定义审批申请中各个控件的值,其中必填项必须有值,选填项可为空, * 数据结构同“获取审批申请详情”接口返回值中同名参数“apply_data” */ @SerializedName("contents") private List<ApplyDataContent> contents; } /** * 审批流程信息(新版). */ @Data @Accessors(chain = true) public static class Process implements Serializable { private static final long serialVersionUID = 4758206091546930988L; /** * 审批流程节点列表,当use_template_approver为0时必填 */ @SerializedName("node_list") private List<ProcessNode> nodeList; } /** * 审批流程节点. */ @Data @Accessors(chain = true) public static class ProcessNode implements Serializable { private static final long serialVersionUID = 1758206091546930988L; /** * 节点类型:1-审批人,2-抄送人,3-抄送人 */ @SerializedName("type") private Integer type; /** * 多人审批方式:1-全签,2-或签,3-依次审批 */ @SerializedName("apv_rel") private Integer apvRel; /** * 审批节点审批人userid列表,若为多人会签、多人或签,需填写每个人的userid */ @SerializedName("userid") private String[] userIds; } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false
binarywang/WxJava
https://github.com/binarywang/WxJava/blob/84b5c4d2d0774f800237634e5d0336f53c004fe3/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpCorpConfInfo.java
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpCorpConfInfo.java
package me.chanjar.weixin.cp.bean.oa; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.Getter; import lombok.Setter; import me.chanjar.weixin.cp.bean.WxCpBaseResp; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; import java.io.Serializable; import java.util.List; /** * 企业假期管理配置信息. * * @author Wang_Wong */ @Data public class WxCpCorpConfInfo extends WxCpBaseResp implements Serializable { private static final long serialVersionUID = 7387181805254287157L; @SerializedName("lists") private List<CorpConf> lists; /** * The type Corp conf. */ @Getter @Setter public static class CorpConf implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("id") private Integer id; @SerializedName("name") private String name; @SerializedName("time_attr") private Integer timeAttr; @SerializedName("duration_type") private Integer durationType; @SerializedName("quota_attr") private QuotaAttr quotaAttr; @SerializedName("perday_duration") private Integer perdayDuration; } /** * The type Quota attr. */ @Getter @Setter public static class QuotaAttr implements Serializable { private static final long serialVersionUID = -5696099236344075582L; @SerializedName("type") private Integer type; @SerializedName("autoreset_time") private Integer autoresetTime; @SerializedName("autoreset_duration") private Integer autoresetDuration; } /** * From json wx cp corp conf info. * * @param json the json * @return the wx cp corp conf info */ public static WxCpCorpConfInfo fromJson(String json) { return WxCpGsonBuilder.create().fromJson(json, WxCpCorpConfInfo.class); } public String toJson() { return WxCpGsonBuilder.create().toJson(this); } }
java
Apache-2.0
84b5c4d2d0774f800237634e5d0336f53c004fe3
2026-01-04T14:46:39.499027Z
false