🎨 #2209【企业微信】获取客户群详情接口增加群昵称字段
This commit is contained in:
@@ -3,7 +3,23 @@ package me.chanjar.weixin.cp.api;
|
|||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
||||||
import me.chanjar.weixin.cp.bean.external.*;
|
import me.chanjar.weixin.cp.bean.external.WxCpContactWayInfo;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpContactWayResult;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpMsgTemplate;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpMsgTemplateAddResult;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUpdateRemarkRequest;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatInfo;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatList;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatStatistic;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatTransferResp;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalTagGroupInfo;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalTagGroupList;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalUnassignList;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalUserBehaviorStatistic;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserTransferCustomerReq;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserTransferCustomerResp;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserTransferResultResp;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpWelcomeMsg;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo;
|
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -362,7 +378,7 @@ public interface WxCpExternalContactService {
|
|||||||
* @return group chat
|
* @return group chat
|
||||||
* @throws WxErrorException the wx error exception
|
* @throws WxErrorException the wx error exception
|
||||||
*/
|
*/
|
||||||
WxCpUserExternalGroupChatInfo getGroupChat(String chatId) throws WxErrorException;
|
WxCpUserExternalGroupChatInfo getGroupChat(String chatId, Integer needName) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -12,7 +12,25 @@ import me.chanjar.weixin.common.util.json.GsonParser;
|
|||||||
import me.chanjar.weixin.cp.api.WxCpExternalContactService;
|
import me.chanjar.weixin.cp.api.WxCpExternalContactService;
|
||||||
import me.chanjar.weixin.cp.api.WxCpService;
|
import me.chanjar.weixin.cp.api.WxCpService;
|
||||||
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
||||||
import me.chanjar.weixin.cp.bean.external.*;
|
import me.chanjar.weixin.cp.bean.external.WxCpContactWayInfo;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpContactWayResult;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpMsgTemplate;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpMsgTemplateAddResult;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUpdateRemarkRequest;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalContactList;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatInfo;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatList;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatStatistic;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalGroupChatTransferResp;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalTagGroupInfo;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalTagGroupList;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalUnassignList;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserExternalUserBehaviorStatistic;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserTransferCustomerReq;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserTransferCustomerResp;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserTransferResultResp;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpUserWithExternalPermission;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.WxCpWelcomeMsg;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo;
|
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
@@ -267,9 +285,10 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxCpUserExternalGroupChatInfo getGroupChat(String chatId) throws WxErrorException {
|
public WxCpUserExternalGroupChatInfo getGroupChat(String chatId, Integer needName) throws WxErrorException {
|
||||||
JsonObject json = new JsonObject();
|
JsonObject json = new JsonObject();
|
||||||
json.addProperty("chat_id", chatId);
|
json.addProperty("chat_id", chatId);
|
||||||
|
json.addProperty("need_name", needName);
|
||||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_INFO);
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GROUP_CHAT_INFO);
|
||||||
final String result = this.mainService.post(url, json.toString());
|
final String result = this.mainService.post(url, json.toString());
|
||||||
return WxCpUserExternalGroupChatInfo.fromJson(result);
|
return WxCpUserExternalGroupChatInfo.fromJson(result);
|
||||||
|
|||||||
@@ -83,6 +83,20 @@ public class WxCpUserExternalGroupChatInfo extends WxCpBaseResp {
|
|||||||
@SerializedName("join_scene")
|
@SerializedName("join_scene")
|
||||||
private int joinScene;
|
private int joinScene;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在群里的昵称
|
||||||
|
*/
|
||||||
|
@SerializedName("group_nickname")
|
||||||
|
private String groupNickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名字。仅当 need_name = 1 时返回
|
||||||
|
* 如果是微信用户,则返回其在微信中设置的名字
|
||||||
|
* 如果是企业微信联系人,则返回其设置对外展示的别名或实名
|
||||||
|
*/
|
||||||
|
@SerializedName("name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邀请者。目前仅当是由本企业内部成员邀请入群时会返回该值
|
* 邀请者。目前仅当是由本企业内部成员邀请入群时会返回该值
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user