Unverified Commit 2795597f authored by 怡蘅's avatar 怡蘅 Committed by GitHub

feat: implement part of group api (#20)

parent 43c66407
......@@ -64,8 +64,8 @@
- [x] 获取 App 中的所有群组
- [x] 创建群组
- [x] 获取群详细资料
- [ ] 获取群成员详细资料
- [ ] 修改群基础资料
- [x] 获取群成员详细资料
- [x] 修改群基础资料
- [x] 增加群成员
- [ ] 删除群成员
- [ ] 修改群成员资料
......
......@@ -64,6 +64,19 @@ public class Group {
return JsonUtil.str2Obj(result, GetGroupInfoResult.class);
}
public GetGroupMemberInfoResult getGroupMemberInfo(GetGroupMemberInfoRequest getGroupMemberInfoRequest) throws IOException {
String url = imClient.getUrl(SERVICE_NAME, GET_GROUP_MEMBER_INFO_COMMAND);
String result = HttpUtil.post(url, JsonUtil.obj2Str(getGroupMemberInfoRequest), null);
return JsonUtil.str2Obj(result, GetGroupMemberInfoResult.class);
}
public ModifyGroupBaseInfoResult modifyGroupBaseInfo(ModifyGroupBaseInfoRequest modifyGroupBaseInfoRequest) throws IOException {
String url = imClient.getUrl(SERVICE_NAME, MODIFY_GROUP_BASE_INFO_COMMAND);
String result = HttpUtil.post(url, JsonUtil.obj2Str(modifyGroupBaseInfoRequest), null);
return JsonUtil.str2Obj(result, ModifyGroupBaseInfoResult.class);
}
public AddGroupMemberResult addGroupMember(AddGroupMemberRequest addGroupMemberRequest) throws IOException {
String url = imClient.getUrl(SERVICE_NAME, ADD_GROUP_MEMBER_COMMAND);
String result = HttpUtil.post(url, JsonUtil.obj2Str(addGroupMemberRequest), null);
......
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author hyh
* @since 2021/08/02 17:12
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ChangeGroupOwnerRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("NewOwner_Account")
private String newOwnerAccount;
public ChangeGroupOwnerRequest() {
}
public ChangeGroupOwnerRequest(String groupId, String newOwnerAccount) {
this.groupId = groupId;
this.newOwnerAccount = newOwnerAccount;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getNewOwnerAccount() {
return newOwnerAccount;
}
public void setNewOwnerAccount(String newOwnerAccount) {
this.newOwnerAccount = newOwnerAccount;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 16:19
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DeleteGroupMemberRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("Silence")
private Integer silence;
@JsonProperty("MemberToDel_Account")
private List<String> memberToDelAccount;
public DeleteGroupMemberRequest() {
}
public DeleteGroupMemberRequest(String groupId, Integer silence, List<String> memberToDelAccount) {
this.groupId = groupId;
this.silence = silence;
this.memberToDelAccount = memberToDelAccount;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public Integer getSilence() {
return silence;
}
public void setSilence(Integer silence) {
this.silence = silence;
}
public List<String> getMemberToDelAccount() {
return memberToDelAccount;
}
public void setMemberToDelAccount(List<String> memberToDelAccount) {
this.memberToDelAccount = memberToDelAccount;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author hyh
* @since 2021/08/02 16:36
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DestroyGroupRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
public DestroyGroupRequest() {
}
public DestroyGroupRequest(String groupId) {
this.groupId = groupId;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 16:41
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ForbidSendMsgRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("Members_Account")
private List<String> membersAccount;
@JsonProperty("ShutUpTime")
private Integer shutUpTime;
public ForbidSendMsgRequest() {
}
public ForbidSendMsgRequest(String groupId, List<String> membersAccount, Integer shutUpTime) {
this.groupId = groupId;
this.membersAccount = membersAccount;
this.shutUpTime = shutUpTime;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public List<String> getMembersAccount() {
return membersAccount;
}
public void setMembersAccount(List<String> membersAccount) {
this.membersAccount = membersAccount;
}
public Integer getShutUpTime() {
return shutUpTime;
}
public void setShutUpTime(Integer shutUpTime) {
this.shutUpTime = shutUpTime;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 16:04
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetGroupMemberInfoRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("MemberInfoFilter")
private List<String> memberInfoFilter;
@JsonProperty("MemberRoleFilter")
private List<String> memberRoleFilter;
@JsonProperty("AppDefinedDataFilter_GroupMember")
private List<String> appDefinedDataFilterGroupMember;
@JsonProperty("Limit")
private Integer limit;
@JsonProperty("Offset")
private Integer offset;
public GetGroupMemberInfoRequest() {
}
public GetGroupMemberInfoRequest(String groupId, List<String> memberInfoFilter, List<String> memberRoleFilter, List<String> appDefinedDataFilterGroupMember, Integer limit, Integer offset) {
this.groupId = groupId;
this.memberInfoFilter = memberInfoFilter;
this.memberRoleFilter = memberRoleFilter;
this.appDefinedDataFilterGroupMember = appDefinedDataFilterGroupMember;
this.limit = limit;
this.offset = offset;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public List<String> getMemberInfoFilter() {
return memberInfoFilter;
}
public void setMemberInfoFilter(List<String> memberInfoFilter) {
this.memberInfoFilter = memberInfoFilter;
}
public List<String> getMemberRoleFilter() {
return memberRoleFilter;
}
public void setMemberRoleFilter(List<String> memberRoleFilter) {
this.memberRoleFilter = memberRoleFilter;
}
public List<String> getAppDefinedDataFilterGroupMember() {
return appDefinedDataFilterGroupMember;
}
public void setAppDefinedDataFilterGroupMember(List<String> appDefinedDataFilterGroupMember) {
this.appDefinedDataFilterGroupMember = appDefinedDataFilterGroupMember;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public Integer getOffset() {
return offset;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author hyh
* @since 2021/08/02 16:43
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetGroupShuttedUinRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
public GetGroupShuttedUinRequest() {
}
public GetGroupShuttedUinRequest(String groupId) {
this.groupId = groupId;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author hyh
* @since 2021/08/02 16:39
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetJoinedGroupListRequest extends GenericRequest {
@JsonProperty("Member_Account")
private String memberAccount;
public GetJoinedGroupListRequest() {
}
public GetJoinedGroupListRequest(String memberAccount) {
this.memberAccount = memberAccount;
}
public String getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(String memberAccount) {
this.memberAccount = memberAccount;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 16:40
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetRoleInGroupRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("User_Account")
private List<String> userAccount;
public GetRoleInGroupRequest() {
}
public GetRoleInGroupRequest(String groupId, List<String> userAccount) {
this.groupId = groupId;
this.userAccount = userAccount;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public List<String> getUserAccount() {
return userAccount;
}
public void setUserAccount(List<String> userAccount) {
this.userAccount = userAccount;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 17:13
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GroupMsgRecallRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("MsgSeqList")
private List<MsgSeqItem> msgSeqList;
public GroupMsgRecallRequest() {
}
public GroupMsgRecallRequest(String groupId, List<MsgSeqItem> msgSeqList) {
this.groupId = groupId;
this.msgSeqList = msgSeqList;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public List<MsgSeqItem> getMsgSeqList() {
return msgSeqList;
}
public void setMsgSeqList(List<MsgSeqItem> msgSeqList) {
this.msgSeqList = msgSeqList;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 19:13
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ImportGroupMemberRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("MemberList")
private List<MemberItem> memberList;
public ImportGroupMemberRequest() {
}
public ImportGroupMemberRequest(String groupId, List<MemberItem> memberList) {
this.groupId = groupId;
this.memberList = memberList;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public List<MemberItem> getMemberList() {
return memberList;
}
public void setMemberList(List<MemberItem> memberList) {
this.memberList = memberList;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.qcloud.im.model.response.MsgListItem;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 17:45
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ImportGroupMsgRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("MsgList")
private List<MsgListItem> msgList;
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
/**
* @author hyh
* @since 2021/08/02 17:17
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ImportGroupRequest extends GenericRequest {
@JsonProperty("Owner_Account")
private String ownerAccount;
@JsonProperty("Type")
private String type;
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("Name")
private String name;
@JsonProperty("Introduction")
private String introduction;
@JsonProperty("Notification")
private String notification;
@JsonProperty("FaceUrl")
private String faceUrl;
@JsonProperty("MaxMemberCount")
private Integer maxMemberCount;
@JsonProperty("ApplyJoinOption")
private String applyJoinOption;
@JsonProperty("CreateTime")
private Integer createTime;
@JsonProperty("AppDefinedData")
private List<Map<String, Object>> appDefinedData;
public ImportGroupRequest() {
}
public ImportGroupRequest(String ownerAccount, String type, String groupId, String name, String introduction, String notification, String faceUrl, Integer maxMemberCount, String applyJoinOption, Integer createTime, List<Map<String, Object>> appDefinedData) {
this.ownerAccount = ownerAccount;
this.type = type;
this.groupId = groupId;
this.name = name;
this.introduction = introduction;
this.notification = notification;
this.faceUrl = faceUrl;
this.maxMemberCount = maxMemberCount;
this.applyJoinOption = applyJoinOption;
this.createTime = createTime;
this.appDefinedData = appDefinedData;
}
public String getOwnerAccount() {
return ownerAccount;
}
public void setOwnerAccount(String ownerAccount) {
this.ownerAccount = ownerAccount;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getNotification() {
return notification;
}
public void setNotification(String notification) {
this.notification = notification;
}
public String getFaceUrl() {
return faceUrl;
}
public void setFaceUrl(String faceUrl) {
this.faceUrl = faceUrl;
}
public Integer getMaxMemberCount() {
return maxMemberCount;
}
public void setMaxMemberCount(Integer maxMemberCount) {
this.maxMemberCount = maxMemberCount;
}
public String getApplyJoinOption() {
return applyJoinOption;
}
public void setApplyJoinOption(String applyJoinOption) {
this.applyJoinOption = applyJoinOption;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public List<Map<String, Object>> getAppDefinedData() {
return appDefinedData;
}
public void setAppDefinedData(List<Map<String, Object>> appDefinedData) {
this.appDefinedData = appDefinedData;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author hyh
* @since 2021/08/02 19:15
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MemberItem {
@JsonProperty("Member_Account")
private String memberAccount;
@JsonProperty("Role")
private String role;
@JsonProperty("JoinTime")
private Integer joinTime;
@JsonProperty("UnreadMsgNum")
private Integer unreadMsgNum;
public MemberItem() {
}
public MemberItem(String memberAccount, String role, Integer joinTime, Integer unreadMsgNum) {
this.memberAccount = memberAccount;
this.role = role;
this.joinTime = joinTime;
this.unreadMsgNum = unreadMsgNum;
}
public String getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(String memberAccount) {
this.memberAccount = memberAccount;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public Integer getJoinTime() {
return joinTime;
}
public void setJoinTime(Integer joinTime) {
this.joinTime = joinTime;
}
public Integer getUnreadMsgNum() {
return unreadMsgNum;
}
public void setUnreadMsgNum(Integer unreadMsgNum) {
this.unreadMsgNum = unreadMsgNum;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
/**
* @author hyh
* @since 2021/08/02 16:11
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ModifyGroupBaseInfoRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("Name")
private String name;
@JsonProperty("Introduction")
private String introduction;
@JsonProperty("Notification")
private String notification;
@JsonProperty("FaceUrl")
private String faceUrl;
@JsonProperty("MaxMemberNum")
private Integer maxMemberNum;
@JsonProperty("ApplyJoinOption")
private String applyJoinOption;
@JsonProperty("ShutUpAllMember")
private String shutUpAllMember;
@JsonProperty("AppDefinedData")
private List<Map<String, Object>> appDefinedData;
public ModifyGroupBaseInfoRequest() {
}
public ModifyGroupBaseInfoRequest(String groupId, String name, String introduction, String notification, String faceUrl, Integer maxMemberNum, String applyJoinOption, String shutUpAllMember, List<Map<String, Object>> appDefinedData) {
this.groupId = groupId;
this.name = name;
this.introduction = introduction;
this.notification = notification;
this.faceUrl = faceUrl;
this.maxMemberNum = maxMemberNum;
this.applyJoinOption = applyJoinOption;
this.shutUpAllMember = shutUpAllMember;
this.appDefinedData = appDefinedData;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getNotification() {
return notification;
}
public void setNotification(String notification) {
this.notification = notification;
}
public String getFaceUrl() {
return faceUrl;
}
public void setFaceUrl(String faceUrl) {
this.faceUrl = faceUrl;
}
public Integer getMaxMemberNum() {
return maxMemberNum;
}
public void setMaxMemberNum(Integer maxMemberNum) {
this.maxMemberNum = maxMemberNum;
}
public String getApplyJoinOption() {
return applyJoinOption;
}
public void setApplyJoinOption(String applyJoinOption) {
this.applyJoinOption = applyJoinOption;
}
public String getShutUpAllMember() {
return shutUpAllMember;
}
public void setShutUpAllMember(String shutUpAllMember) {
this.shutUpAllMember = shutUpAllMember;
}
public List<Map<String, Object>> getAppDefinedData() {
return appDefinedData;
}
public void setAppDefinedData(List<Map<String, Object>> appDefinedData) {
this.appDefinedData = appDefinedData;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
/**
* @author hyh
* @since 2021/08/02 16:32
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ModifyGroupMemberInfoRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("Member_Account")
private String memberAccount;
@JsonProperty("Role")
private String role;
@JsonProperty("MsgFlag")
private String msgFlag;
@JsonProperty("NameCard")
private String nameCard;
@JsonProperty("AppMemberDefinedData")
private List<Map<String, Object>> appMemberDefinedData;
@JsonProperty("ShutUpTime")
private Integer shutUpTime;
public ModifyGroupMemberInfoRequest() {
}
public ModifyGroupMemberInfoRequest(String groupId, String memberAccount, String role, String msgFlag, String nameCard, List<Map<String, Object>> appMemberDefinedData, Integer shutUpTime) {
this.groupId = groupId;
this.memberAccount = memberAccount;
this.role = role;
this.msgFlag = msgFlag;
this.nameCard = nameCard;
this.appMemberDefinedData = appMemberDefinedData;
this.shutUpTime = shutUpTime;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(String memberAccount) {
this.memberAccount = memberAccount;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getMsgFlag() {
return msgFlag;
}
public void setMsgFlag(String msgFlag) {
this.msgFlag = msgFlag;
}
public String getNameCard() {
return nameCard;
}
public void setNameCard(String nameCard) {
this.nameCard = nameCard;
}
public List<Map<String, Object>> getAppMemberDefinedData() {
return appMemberDefinedData;
}
public void setAppMemberDefinedData(List<Map<String, Object>> appMemberDefinedData) {
this.appMemberDefinedData = appMemberDefinedData;
}
public Integer getShutUpTime() {
return shutUpTime;
}
public void setShutUpTime(Integer shutUpTime) {
this.shutUpTime = shutUpTime;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.qcloud.im.model.response.MsgBodyItem;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 17:51
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MsgGroupItem {
@JsonProperty("From_Account")
private String fromAccount;
@JsonProperty("SendTime")
private Integer sendTime;
@JsonProperty("Random")
private Integer random;
@JsonProperty("MsgBody")
private List<MsgBodyItem> msgBody;
public MsgGroupItem() {
}
public MsgGroupItem(String fromAccount, Integer sendTime, Integer random, List<MsgBodyItem> msgBody) {
this.fromAccount = fromAccount;
this.sendTime = sendTime;
this.random = random;
this.msgBody = msgBody;
}
public String getFromAccount() {
return fromAccount;
}
public void setFromAccount(String fromAccount) {
this.fromAccount = fromAccount;
}
public Integer getSendTime() {
return sendTime;
}
public void setSendTime(Integer sendTime) {
this.sendTime = sendTime;
}
public Integer getRandom() {
return random;
}
public void setRandom(Integer random) {
this.random = random;
}
public List<MsgBodyItem> getMsgBody() {
return msgBody;
}
public void setMsgBody(List<MsgBodyItem> msgBody) {
this.msgBody = msgBody;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author hyh
* @since 2021/08/02 17:15
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MsgSeqItem {
@JsonProperty("MsgSeq")
private Integer msgSeq;
public MsgSeqItem() {
}
public MsgSeqItem(Integer msgSeq) {
this.msgSeq = msgSeq;
}
public Integer getMsgSeq() {
return msgSeq;
}
public void setMsgSeq(Integer msgSeq) {
this.msgSeq = msgSeq;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.qcloud.im.model.response.MsgBodyItem;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 16:46
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SendGroupMsgRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("Random")
private Integer random;
@JsonProperty("MsgPriority")
private String msgPriority;
@JsonProperty("MsgBody")
private List<MsgBodyItem> msgBody;
@JsonProperty("From_Account")
private String fromAccount;
@JsonProperty("OfflinePushInfo")
private OfflinePushInfo offlinePushInfo;
@JsonProperty("ForbidCallbackControl")
private List<String> forbidCallbackControl;
@JsonProperty("OnlineOnlyFlag")
private Integer onlineOnlyFlag;
@JsonProperty("SendMsgControl")
private List<String> sendMsgControl;
@JsonProperty("cloudCustomData")
private String cloudCustomData;
public SendGroupMsgRequest() {
}
public SendGroupMsgRequest(String groupId, Integer random, String msgPriority, List<MsgBodyItem> msgBody, String fromAccount, OfflinePushInfo offlinePushInfo, List<String> forbidCallbackControl, Integer onlineOnlyFlag, List<String> sendMsgControl, String cloudCustomData) {
this.groupId = groupId;
this.random = random;
this.msgPriority = msgPriority;
this.msgBody = msgBody;
this.fromAccount = fromAccount;
this.offlinePushInfo = offlinePushInfo;
this.forbidCallbackControl = forbidCallbackControl;
this.onlineOnlyFlag = onlineOnlyFlag;
this.sendMsgControl = sendMsgControl;
this.cloudCustomData = cloudCustomData;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public Integer getRandom() {
return random;
}
public void setRandom(Integer random) {
this.random = random;
}
public String getMsgPriority() {
return msgPriority;
}
public void setMsgPriority(String msgPriority) {
this.msgPriority = msgPriority;
}
public List<MsgBodyItem> getMsgBody() {
return msgBody;
}
public void setMsgBody(List<MsgBodyItem> msgBody) {
this.msgBody = msgBody;
}
public String getFromAccount() {
return fromAccount;
}
public void setFromAccount(String fromAccount) {
this.fromAccount = fromAccount;
}
public OfflinePushInfo getOfflinePushInfo() {
return offlinePushInfo;
}
public void setOfflinePushInfo(OfflinePushInfo offlinePushInfo) {
this.offlinePushInfo = offlinePushInfo;
}
public List<String> getForbidCallbackControl() {
return forbidCallbackControl;
}
public void setForbidCallbackControl(List<String> forbidCallbackControl) {
this.forbidCallbackControl = forbidCallbackControl;
}
public Integer getOnlineOnlyFlag() {
return onlineOnlyFlag;
}
public void setOnlineOnlyFlag(Integer onlineOnlyFlag) {
this.onlineOnlyFlag = onlineOnlyFlag;
}
public List<String> getSendMsgControl() {
return sendMsgControl;
}
public void setSendMsgControl(List<String> sendMsgControl) {
this.sendMsgControl = sendMsgControl;
}
public String getCloudCustomData() {
return cloudCustomData;
}
public void setCloudCustomData(String cloudCustomData) {
this.cloudCustomData = cloudCustomData;
}
}
package com.qcloud.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 17:09
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SendGroupSystemNotificationRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("ToMembers_Account")
private List<String> toMembersAccount;
@JsonProperty("Content")
private String content;
public SendGroupSystemNotificationRequest() {
}
public SendGroupSystemNotificationRequest(String groupId, List<String> toMembersAccount, String content) {
this.groupId = groupId;
this.toMembersAccount = toMembersAccount;
this.content = content;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public List<String> getToMembersAccount() {
return toMembersAccount;
}
public void setToMembersAccount(List<String> toMembersAccount) {
this.toMembersAccount = toMembersAccount;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
package com.qcloud.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/08/02 19:18
*/
public class GetGroupMemberInfoResult extends GenericResult {
@JsonProperty("MemberNum")
private Integer memberNum;
@JsonProperty("MemberList")
private List<MemberInfoItem> memberList;
public Integer getMemberNum() {
return memberNum;
}
public void setMemberNum(Integer memberNum) {
this.memberNum = memberNum;
}
public List<MemberInfoItem> getMemberList() {
return memberList;
}
public void setMemberList(List<MemberInfoItem> memberList) {
this.memberList = memberList;
}
@Override
public String toString() {
return "GetGroupMemberInfoResult{" +
"memberNum=" + memberNum +
", memberList=" + memberList +
'}';
}
}
package com.qcloud.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
/**
* @author hyh
* @since 2021/08/02 19:22
*/
public class MemberInfoItem {
@JsonProperty("Member_Account")
private String memberAccount;
@JsonProperty("Role")
private String role;
@JsonProperty("JoinTime")
private Integer joinTime;
@JsonProperty("MsgSeq")
private Integer msgSeq;
@JsonProperty("MsgFlag")
private String msgFlag;
@JsonProperty("LastSendMsgTime")
private Integer lastSendMsgTime;
@JsonProperty("ShutUpUntil")
private Integer shutUpUntil;
@JsonProperty("AppMemberDefinedData")
private List<Map<String, Object>> appMemberDefinedData;
public String getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(String memberAccount) {
this.memberAccount = memberAccount;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public Integer getJoinTime() {
return joinTime;
}
public void setJoinTime(Integer joinTime) {
this.joinTime = joinTime;
}
public Integer getMsgSeq() {
return msgSeq;
}
public void setMsgSeq(Integer msgSeq) {
this.msgSeq = msgSeq;
}
public String getMsgFlag() {
return msgFlag;
}
public void setMsgFlag(String msgFlag) {
this.msgFlag = msgFlag;
}
public Integer getLastSendMsgTime() {
return lastSendMsgTime;
}
public void setLastSendMsgTime(Integer lastSendMsgTime) {
this.lastSendMsgTime = lastSendMsgTime;
}
public Integer getShutUpUntil() {
return shutUpUntil;
}
public void setShutUpUntil(Integer shutUpUntil) {
this.shutUpUntil = shutUpUntil;
}
public List<Map<String, Object>> getAppMemberDefinedData() {
return appMemberDefinedData;
}
public void setAppMemberDefinedData(List<Map<String, Object>> appMemberDefinedData) {
this.appMemberDefinedData = appMemberDefinedData;
}
@Override
public String toString() {
return "MemberInfoItem{" +
"memberAccount='" + memberAccount + '\'' +
", role='" + role + '\'' +
", joinTime=" + joinTime +
", msgSeq=" + msgSeq +
", msgFlag='" + msgFlag + '\'' +
", lastSendMsgTime=" + lastSendMsgTime +
", shutUpUntil=" + shutUpUntil +
", appMemberDefinedData=" + appMemberDefinedData +
'}';
}
}
package com.qcloud.im.model.response;
/**
* @author hyh
* @since 2021/08/02 19:27
*/
public class ModifyGroupBaseInfoResult extends GenericResult {
}
......@@ -73,6 +73,33 @@ public class GroupTest {
}
@Test
public void testGetGroupMemberInfo() throws IOException {
GetGroupMemberInfoRequest request = new GetGroupMemberInfoRequest();
request.setGroupId("MyFirstGroup");
request.setLimit(100);
request.setOffset(0);
GetGroupMemberInfoResult result = client.group.getGroupMemberInfo(request);
System.out.println(result);
Assert.assertEquals(0, (int) result.getErrorCode());
}
@Test
public void testModifyGroupBaseInfo() throws IOException {
ModifyGroupBaseInfoRequest request = new ModifyGroupBaseInfoRequest();
request.setGroupId("MyFirstGroup");
request.setName("groupName");
request.setIntroduction("my first group");
request.setNotification("hello group member");
request.setFaceUrl("http://this.is.face.url");
request.setMaxMemberNum(500);
request.setApplyJoinOption("NeedPermission");
request.setShutUpAllMember("Off");
ModifyGroupBaseInfoResult result = client.group.modifyGroupBaseInfo(request);
System.out.println(result);
Assert.assertEquals(0, (int) result.getErrorCode());
}
@Test
public void testAddGroupMember() throws IOException {
MemberRequestItem memberItem = new MemberRequestItem("test1");
AddGroupMemberRequest request = new AddGroupMemberRequest();
......@@ -124,4 +151,5 @@ public class GroupTest {
System.out.println(result);
Assert.assertEquals(0, (int) result.getErrorCode());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment