Unverified Commit 8fb27159 authored by Yang Libin's avatar Yang Libin Committed by GitHub

fix: request and response entities (#45)

parent 456d3cca
package io.github.doocs.im.constant;
/**
* 登录的平台类型
*
* @author bingo
* @since 2021/10/31 20:06
*/
public class Platform {
public static final String IPHONE = "iPhone";
public static final String ANDROID = "Android";
public static final String WEB = "Web";
public static final String PC = "PC";
public static final String IPAD = "iPad";
public static final String MAC = "Mac";
}
package io.github.doocs.im.constant;
/**
* 用户状态
*
* @author bingo
* @since 2021/10/31 20:04
*/
public class QueryResultStatus {
/**
* 前台运行状态
*/
public static final String ONLINE = "Online";
/**
* 后台运行状态
*/
public static final String PUSH_ONLINE = "PushOnline";
/**
* 未登录状态
*/
public static final String OFFLINE = "Offline";
}
......@@ -20,7 +20,7 @@ public class Account {
private static final String ACCOUNT_DELETE_COMMAND = "account_delete";
private static final String ACCOUNT_CHECK_COMMAND = "account_check";
private static final String KICK_COMMAND = "kick";
private static final String QUERY_STATE_COMMAND = "querystate";
private static final String QUERY_ONLINE_STATUS_COMMAND = "query_online_status";
private final IMClient imClient;
......@@ -53,8 +53,8 @@ public class Account {
return HttpUtil.post(url, kickRequest, KickResult.class);
}
public QueryStateResult queryState(QueryStateRequest queryStateRequest) throws IOException {
String url = imClient.getUrl(SERVICE_NAME_OPEN_IM, QUERY_STATE_COMMAND);
return HttpUtil.post(url, queryStateRequest, QueryStateResult.class);
public QueryOnlineStatusResult queryOnlineStatus(QueryOnlineStatus queryOnlineStatus) throws IOException {
String url = imClient.getUrl(SERVICE_NAME_OPEN_IM, QUERY_ONLINE_STATUS_COMMAND);
return HttpUtil.post(url, queryOnlineStatus, QueryOnlineStatusResult.class);
}
}
......@@ -58,7 +58,7 @@ public class Message {
return HttpUtil.post(url, adminSetMsgReadRequest, AdminSetMsgReadResult.class);
}
public C2cUnreadMsgNumResult getC2cUnreadMsgRequest(GetC2cUnreadMsgRequest getC2cUnreadMsgRequest) throws IOException {
public C2cUnreadMsgNumResult getC2cUnreadMsgNum(GetC2cUnreadMsgRequest getC2cUnreadMsgRequest) throws IOException {
String url = imClient.getUrl(SERVICE_NAME, GET_C2C_UNREAD_MSG_NUM_COMMAND);
return HttpUtil.post(url, getC2cUnreadMsgRequest, C2cUnreadMsgNumResult.class);
}
......
package io.github.doocs.im.model.group;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author bingo
* @since 2021/10/31 20:57
*/
public class AppDefinedDataItem {
@JsonProperty("Key")
private String key;
@JsonProperty("Value")
private Object value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@Override
public String toString() {
return "AppDefinedDataItem{" +
"key='" + key + '\'' +
", value=" + value +
'}';
}
}
package io.github.doocs.im.model.group;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author bingo
* @since 2021/10/31 21:18
*/
public class AppMemberDefinedDataItem {
@JsonProperty("Key")
private String key;
@JsonProperty("Value")
private Object value;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
@Override
public String toString() {
return "AppDefinedDataItem{" +
"key='" + key + '\'' +
", value=" + value +
'}';
}
}
package io.github.doocs.im.model.group;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author bingo
* @since 2021/10/31 21:02
*/
public class GroupInfo {
@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("AppDefinedData")
private List<AppDefinedDataItem> appDefinedData;
@JsonProperty("MemberList")
private List<MemberProfile> memberList;
@JsonProperty("AppMemberDefinedData")
private List<AppMemberDefinedDataItem> appMemberDefinedData;
public GroupInfo() {
}
public GroupInfo(String ownerAccount, String type, String groupId, String name, String introduction, String notification, String faceUrl, Integer maxMemberCount, String applyJoinOption, List<AppDefinedDataItem> appDefinedData, List<MemberProfile> memberList, List<AppMemberDefinedDataItem> appMemberDefinedData) {
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.appDefinedData = appDefinedData;
this.memberList = memberList;
this.appMemberDefinedData = appMemberDefinedData;
}
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 List<AppDefinedDataItem> getAppDefinedData() {
return appDefinedData;
}
public void setAppDefinedData(List<AppDefinedDataItem> appDefinedData) {
this.appDefinedData = appDefinedData;
}
public List<MemberProfile> getMemberList() {
return memberList;
}
public void setMemberList(List<MemberProfile> memberList) {
this.memberList = memberList;
}
public List<AppMemberDefinedDataItem> getAppMemberDefinedData() {
return appMemberDefinedData;
}
public void setAppMemberDefinedData(List<AppMemberDefinedDataItem> appMemberDefinedData) {
this.appMemberDefinedData = appMemberDefinedData;
}
@Override
public String toString() {
return "GroupInfo{" +
"ownerAccount='" + ownerAccount + '\'' +
", type='" + type + '\'' +
", groupId='" + groupId + '\'' +
", name='" + name + '\'' +
", introduction='" + introduction + '\'' +
", notification='" + notification + '\'' +
", faceUrl='" + faceUrl + '\'' +
", maxMemberCount=" + maxMemberCount +
", applyJoinOption='" + applyJoinOption + '\'' +
", appDefinedData=" + appDefinedData +
", memberList=" + memberList +
", appMemberDefinedData=" + appMemberDefinedData +
'}';
}
}
package io.github.doocs.im.model.request;
package io.github.doocs.im.model.group;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author bingo
* @since 2021/8/1 11:20
......@@ -27,20 +29,28 @@ public class MemberProfile {
@JsonProperty("LastSendMsgTime")
private Integer lastSendMsgTime;
@JsonProperty("ShutUpUntil")
private Integer shutUpUntil;
@JsonProperty("NameCard")
private String nameCard;
@JsonProperty("AppMemberDefinedData")
private List<AppMemberDefinedDataItem> appMemberDefinedData;
public MemberProfile() {
}
public MemberProfile(String memberAccount, String role, Integer joinTime, Integer msgSeq, String msgFlag, Integer lastSendMsgTime, String nameCard) {
public MemberProfile(String memberAccount, String role, Integer joinTime, Integer msgSeq, String msgFlag, Integer lastSendMsgTime, Integer shutUpUntil, String nameCard, List<AppMemberDefinedDataItem> appMemberDefinedData) {
this.memberAccount = memberAccount;
this.role = role;
this.joinTime = joinTime;
this.msgSeq = msgSeq;
this.msgFlag = msgFlag;
this.lastSendMsgTime = lastSendMsgTime;
this.shutUpUntil = shutUpUntil;
this.nameCard = nameCard;
this.appMemberDefinedData = appMemberDefinedData;
}
public String getMemberAccount() {
......@@ -91,6 +101,14 @@ public class MemberProfile {
this.lastSendMsgTime = lastSendMsgTime;
}
public Integer getShutUpUntil() {
return shutUpUntil;
}
public void setShutUpUntil(Integer shutUpUntil) {
this.shutUpUntil = shutUpUntil;
}
public String getNameCard() {
return nameCard;
}
......@@ -98,4 +116,27 @@ public class MemberProfile {
public void setNameCard(String nameCard) {
this.nameCard = nameCard;
}
public List<AppMemberDefinedDataItem> getAppMemberDefinedData() {
return appMemberDefinedData;
}
public void setAppMemberDefinedData(List<AppMemberDefinedDataItem> appMemberDefinedData) {
this.appMemberDefinedData = appMemberDefinedData;
}
@Override
public String toString() {
return "MemberProfile{" +
"memberAccount='" + memberAccount + '\'' +
", role='" + role + '\'' +
", joinTime=" + joinTime +
", msgSeq=" + msgSeq +
", msgFlag='" + msgFlag + '\'' +
", lastSendMsgTime=" + lastSendMsgTime +
", shutUpUntil=" + shutUpUntil +
", nameCard='" + nameCard + '\'' +
", appMemberDefinedData=" + appMemberDefinedData +
'}';
}
}
package io.github.doocs.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;
import io.github.doocs.im.model.group.GroupInfo;
/**
* @author bingo
* @since 2021/8/1 11:12
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CreateGroupRequest 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("AppDefinedData")
private List<Map<String, Object>> appDefinedData;
@JsonProperty("MemberList")
private List<MemberProfile> memberList;
@JsonProperty("AppMemberDefinedData")
private List<Map<String, Object>> appMemberDefinedData;
public CreateGroupRequest(String type, String name) {
this(null, type, null, name, null, null, null, null, null, null, null, null);
}
public CreateGroupRequest(String ownerAccount, String type, String groupId, String name, String introduction,
String notification, String faceUrl, Integer maxMemberCount, String applyJoinOption,
List<Map<String, Object>> appDefinedData, List<MemberProfile> memberList,
List<Map<String, Object>> appMemberDefinedData) {
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.appDefinedData = appDefinedData;
this.memberList = memberList;
this.appMemberDefinedData = appMemberDefinedData;
}
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 List<Map<String, Object>> getAppDefinedData() {
return appDefinedData;
}
public void setAppDefinedData(List<Map<String, Object>> appDefinedData) {
this.appDefinedData = appDefinedData;
}
public List<MemberProfile> getMemberList() {
return memberList;
}
public void setMemberList(List<MemberProfile> memberList) {
this.memberList = memberList;
}
public List<Map<String, Object>> getAppMemberDefinedData() {
return appMemberDefinedData;
}
public class CreateGroupRequest extends GroupInfo {
public void setAppMemberDefinedData(List<Map<String, Object>> appMemberDefinedData) {
this.appMemberDefinedData = appMemberDefinedData;
}
}
......@@ -2,9 +2,9 @@ package io.github.doocs.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.doocs.im.model.group.AppDefinedDataItem;
import java.util.List;
import java.util.Map;
/**
* @author hyh
......@@ -37,13 +37,13 @@ public class ModifyGroupBaseInfoRequest extends GenericRequest {
private String shutUpAllMember;
@JsonProperty("AppDefinedData")
private List<Map<String, Object>> appDefinedData;
private List<AppDefinedDataItem> appDefinedData;
public ModifyGroupBaseInfoRequest(String groupId) {
this.groupId = groupId;
}
public ModifyGroupBaseInfoRequest(String groupId, String name, String introduction, String notification, String faceUrl, Integer maxMemberNum, String applyJoinOption, String shutUpAllMember, List<Map<String, Object>> appDefinedData) {
public ModifyGroupBaseInfoRequest(String groupId, String name, String introduction, String notification, String faceUrl, Integer maxMemberNum, String applyJoinOption, String shutUpAllMember, List<AppDefinedDataItem> appDefinedData) {
this.groupId = groupId;
this.name = name;
this.introduction = introduction;
......@@ -119,11 +119,11 @@ public class ModifyGroupBaseInfoRequest extends GenericRequest {
this.shutUpAllMember = shutUpAllMember;
}
public List<Map<String, Object>> getAppDefinedData() {
public List<AppDefinedDataItem> getAppDefinedData() {
return appDefinedData;
}
public void setAppDefinedData(List<Map<String, Object>> appDefinedData) {
public void setAppDefinedData(List<AppDefinedDataItem> appDefinedData) {
this.appDefinedData = appDefinedData;
}
}
......@@ -10,18 +10,18 @@ import java.util.List;
* @since 2021/7/30 17:35
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class QueryStateRequest extends GenericRequest {
public class QueryOnlineStatus extends GenericRequest {
@JsonProperty("IsNeedDetail")
private Integer isNeedDetail;
@JsonProperty("To_Account")
private List<String> toAccount;
public QueryStateRequest(List<String> toAccount) {
public QueryOnlineStatus(List<String> toAccount) {
this(null, toAccount);
}
public QueryStateRequest(Integer isNeedDetail, List<String> toAccount) {
public QueryOnlineStatus(Integer isNeedDetail, List<String> toAccount) {
this.isNeedDetail = isNeedDetail;
this.toAccount = toAccount;
}
......
......@@ -11,7 +11,7 @@ public class BatchSendMsgErrorItem {
private String toAccount;
@JsonProperty("ErrorCode")
private String errorCode;
private Integer errorCode;
public String getToAccount() {
return toAccount;
......@@ -21,11 +21,11 @@ public class BatchSendMsgErrorItem {
this.toAccount = toAccount;
}
public String getErrorCode() {
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
......@@ -33,7 +33,7 @@ public class BatchSendMsgErrorItem {
public String toString() {
return "BatchSendMsgErrorItem{" +
"toAccount='" + toAccount + '\'' +
", errorCode='" + errorCode + '\'' +
", errorCode=" + errorCode +
'}';
}
}
......@@ -50,4 +50,14 @@ public class BlackListCheckItem {
public void setResultInfo(String resultInfo) {
this.resultInfo = resultInfo;
}
@Override
public String toString() {
return "BlackListCheckItem{" +
"toAccount='" + toAccount + '\'' +
", relation='" + relation + '\'' +
", resultCode=" + resultCode +
", resultInfo='" + resultInfo + '\'' +
'}';
}
}
......@@ -28,4 +28,12 @@ public class BlackListItem {
public void setAddBlackTimeStamp(Integer addBlackTimeStamp) {
this.addBlackTimeStamp = addBlackTimeStamp;
}
@Override
public String toString() {
return "BlackListItem{" +
"toAccount='" + toAccount + '\'' +
", addBlackTimeStamp=" + addBlackTimeStamp +
'}';
}
}
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author bingo
* @since 2021/10/31 20:21
*/
public class C2cUnreadMsgErrorListItem {
@JsonProperty("Peer_Account")
private String peerAccount;
@JsonProperty("ErrorCode")
private Integer errorCode;
public String getPeerAccount() {
return peerAccount;
}
public void setPeerAccount(String peerAccount) {
this.peerAccount = peerAccount;
}
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
@Override
public String toString() {
return "C2cUnreadMsgErrorListItem{" +
"peerAccount='" + peerAccount + '\'' +
", errorCode=" + errorCode +
'}';
}
}
......@@ -11,7 +11,7 @@ public class C2cUnreadMsgNumListItem {
private String peerAccount;
@JsonProperty("C2CUnreadMsgNum")
private String unreadMsgNum;
private Integer unreadMsgNum;
public String getPeerAccount() {
return peerAccount;
......@@ -21,11 +21,11 @@ public class C2cUnreadMsgNumListItem {
this.peerAccount = peerAccount;
}
public String getUnreadMsgNum() {
public Integer getUnreadMsgNum() {
return unreadMsgNum;
}
public void setUnreadMsgNum(String unreadMsgNum) {
public void setUnreadMsgNum(Integer unreadMsgNum) {
this.unreadMsgNum = unreadMsgNum;
}
......@@ -33,7 +33,7 @@ public class C2cUnreadMsgNumListItem {
public String toString() {
return "C2cUnreadMsgNumListItem{" +
"peerAccount='" + peerAccount + '\'' +
", unreadMsgNum='" + unreadMsgNum + '\'' +
", unreadMsgNum=" + unreadMsgNum +
'}';
}
}
......@@ -9,9 +9,23 @@ import java.util.List;
* @since 2021/07/28 20:34
*/
public class C2cUnreadMsgNumResult extends GenericResult {
@JsonProperty("AllC2CUnreadMsgNum")
private Integer allC2cUnreadMsgNum;
@JsonProperty("C2CUnreadMsgNumList")
private List<C2cUnreadMsgNumListItem> unreadMsgNumList;
@JsonProperty("ErrorList")
private List<C2cUnreadMsgErrorListItem> errorList;
public Integer getAllC2cUnreadMsgNum() {
return allC2cUnreadMsgNum;
}
public void setAllC2cUnreadMsgNum(Integer allC2cUnreadMsgNum) {
this.allC2cUnreadMsgNum = allC2cUnreadMsgNum;
}
public List<C2cUnreadMsgNumListItem> getUnreadMsgNumList() {
return unreadMsgNumList;
}
......@@ -20,10 +34,20 @@ public class C2cUnreadMsgNumResult extends GenericResult {
this.unreadMsgNumList = unreadMsgNumList;
}
public List<C2cUnreadMsgErrorListItem> getErrorList() {
return errorList;
}
public void setErrorList(List<C2cUnreadMsgErrorListItem> errorList) {
this.errorList = errorList;
}
@Override
public String toString() {
return "C2cUnreadMsgNumResult{" +
"unreadMsgNumList=" + unreadMsgNumList +
"allC2cUnreadMsgNum=" + allC2cUnreadMsgNum +
", unreadMsgNumList=" + unreadMsgNumList +
", errorList=" + errorList +
'}';
}
}
......@@ -14,13 +14,13 @@ public class FileResultItem {
private String expireTime;
@JsonProperty("FileSize")
private String fileSize;
private Integer fileSize;
@JsonProperty("FileMD5")
private String fileMd5;
@JsonProperty("GzipSize")
private String gzipSize;
private Integer gzipSize;
@JsonProperty("GzipMD5")
private String gzipMd5;
......@@ -41,11 +41,11 @@ public class FileResultItem {
this.expireTime = expireTime;
}
public String getFileSize() {
public Integer getFileSize() {
return fileSize;
}
public void setFileSize(String fileSize) {
public void setFileSize(Integer fileSize) {
this.fileSize = fileSize;
}
......@@ -57,11 +57,11 @@ public class FileResultItem {
this.fileMd5 = fileMd5;
}
public String getGzipSize() {
public Integer getGzipSize() {
return gzipSize;
}
public void setGzipSize(String gzipSize) {
public void setGzipSize(Integer gzipSize) {
this.gzipSize = gzipSize;
}
......
......@@ -12,9 +12,6 @@ public class FriendAddResult extends GenericResult {
@JsonProperty("ResultItem")
private List<ResultItem> resultItemList;
@JsonProperty("ActionStatus")
private String actionStatus;
@JsonProperty("ErrorDisplay")
private String errorDisplay;
......@@ -26,16 +23,6 @@ public class FriendAddResult extends GenericResult {
this.resultItemList = resultItemList;
}
@Override
public String getActionStatus() {
return actionStatus;
}
@Override
public void setActionStatus(String actionStatus) {
this.actionStatus = actionStatus;
}
public String getErrorDisplay() {
return errorDisplay;
}
......@@ -48,7 +35,6 @@ public class FriendAddResult extends GenericResult {
public String toString() {
return "FriendAddResult{" +
"resultItemList=" + resultItemList +
", actionStatus='" + actionStatus + '\'' +
", errorDisplay='" + errorDisplay + '\'' +
'}';
}
......
......@@ -30,4 +30,12 @@ public class FriendDeleteResult extends GenericResult {
public void setResultItemList(List<ResultItem> resultItemList) {
this.resultItemList = resultItemList;
}
@Override
public String toString() {
return "FriendDeleteResult{" +
"errorDisplay='" + errorDisplay + '\'' +
", resultItemList=" + resultItemList +
'}';
}
}
......@@ -15,6 +15,9 @@ public class FriendGetListResult extends GroupGetResult {
@JsonProperty("Fail_Account")
private List<String> failAccount;
@JsonProperty("ErrorDisplay")
private String errorDisplay;
public List<FriendGetListInfoItem> getInfoItemList() {
return infoItemList;
}
......@@ -32,10 +35,21 @@ public class FriendGetListResult extends GroupGetResult {
}
@Override
public String getErrorDisplay() {
return errorDisplay;
}
@Override
public void setErrorDisplay(String errorDisplay) {
this.errorDisplay = errorDisplay;
}
@Override
public String toString() {
return "FriendGetListResult{" +
"infoItemList=" + infoItemList +
", failAccount=" + failAccount +
", errorDisplay='" + errorDisplay + '\'' +
'}';
}
}
......@@ -28,7 +28,7 @@ public class FriendGetResult extends GenericResult {
private Integer nextStartIndex;
@JsonProperty("ErrorDisplay")
private Integer errorDisplay;
private String errorDisplay;
public List<UserDataItem> getUserDataItemList() {
return userDataItemList;
......@@ -78,11 +78,24 @@ public class FriendGetResult extends GenericResult {
this.nextStartIndex = nextStartIndex;
}
public Integer getErrorDisplay() {
public String getErrorDisplay() {
return errorDisplay;
}
public void setErrorDisplay(Integer errorDisplay) {
public void setErrorDisplay(String errorDisplay) {
this.errorDisplay = errorDisplay;
}
@Override
public String toString() {
return "FriendGetResult{" +
"userDataItemList=" + userDataItemList +
", standardSequence=" + standardSequence +
", customSequence=" + customSequence +
", friendNum=" + friendNum +
", completeFlag=" + completeFlag +
", nextStartIndex=" + nextStartIndex +
", errorDisplay='" + errorDisplay + '\'' +
'}';
}
}
......@@ -15,6 +15,9 @@ public class FriendImportResult extends GenericResult {
@JsonProperty("ErrorDisplay")
private String errorDisplay;
@JsonProperty("Fail_Account")
private List<String> failAccount;
public List<ResultItem> getResultItemList() {
return resultItemList;
}
......@@ -31,11 +34,20 @@ public class FriendImportResult extends GenericResult {
this.errorDisplay = errorDisplay;
}
public List<String> getFailAccount() {
return failAccount;
}
public void setFailAccount(List<String> failAccount) {
this.failAccount = failAccount;
}
@Override
public String toString() {
return "FriendImportResult{" +
"resultItemList=" + resultItemList +
", errorDisplay='" + errorDisplay + '\'' +
", failAccount=" + failAccount +
'}';
}
}
......@@ -41,4 +41,13 @@ public class FriendUpdateResult extends GenericResult {
public void setFailAccount(List<String> failAccount) {
this.failAccount = failAccount;
}
@Override
public String toString() {
return "FriendUpdateResult{" +
"resultItemList=" + resultItemList +
", errorDisplay='" + errorDisplay + '\'' +
", failAccount=" + failAccount +
'}';
}
}
......@@ -15,6 +15,9 @@ public class GetAppidGroupListResult extends GenericResult {
@JsonProperty("GroupIdList")
private List<GroupIdItem> groupIdList;
@JsonProperty("Next")
private Integer next;
public Integer getTotalCount() {
return totalCount;
}
......@@ -31,11 +34,20 @@ public class GetAppidGroupListResult extends GenericResult {
this.groupIdList = groupIdList;
}
public Integer getNext() {
return next;
}
public void setNext(Integer next) {
this.next = next;
}
@Override
public String toString() {
return "GetAppidGroupListResult{" +
"totalCount=" + totalCount +
", groupIdList=" + groupIdList +
", next=" + next +
'}';
}
}
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.doocs.im.model.group.GroupInfo;
import java.util.List;
......@@ -10,13 +11,13 @@ import java.util.List;
*/
public class GetGroupInfoResult extends GenericResult {
@JsonProperty("GroupInfo")
private List<GroupInfoResultItem> groupInfo;
private List<GroupInfo> groupInfo;
public List<GroupInfoResultItem> getGroupInfo() {
public List<GroupInfo> getGroupInfo() {
return groupInfo;
}
public void setGroupInfo(List<GroupInfoResultItem> groupInfo) {
public void setGroupInfo(List<GroupInfo> groupInfo) {
this.groupInfo = groupInfo;
}
......
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.github.doocs.im.model.group.MemberProfile;
import java.util.List;
......@@ -13,7 +14,7 @@ public class GetGroupMemberInfoResult extends GenericResult {
private Integer memberNum;
@JsonProperty("MemberList")
private List<MemberInfoItem> memberList;
private List<MemberProfile> memberList;
public Integer getMemberNum() {
return memberNum;
......@@ -23,11 +24,11 @@ public class GetGroupMemberInfoResult extends GenericResult {
this.memberNum = memberNum;
}
public List<MemberInfoItem> getMemberList() {
public List<MemberProfile> getMemberList() {
return memberList;
}
public void setMemberList(List<MemberInfoItem> memberList) {
public void setMemberList(List<MemberProfile> memberList) {
this.memberList = memberList;
}
......
......@@ -8,32 +8,10 @@ import java.util.List;
* @author bingo
* @since 2021/7/31 20:31
*/
public class GetIpListResult {
@JsonProperty("ErrorCode")
private Integer errorCode;
@JsonProperty("errorInfo")
private String errorInfo;
public class GetIpListResult extends GenericResult {
@JsonProperty("IPList")
private List<String> ipList;
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public String getErrorInfo() {
return errorInfo;
}
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public List<String> getIpList() {
return ipList;
}
......@@ -45,9 +23,7 @@ public class GetIpListResult {
@Override
public String toString() {
return "GetIpListResult{" +
"errorCode=" + errorCode +
", errorInfo='" + errorInfo + '\'' +
", ipList=" + ipList +
"ipList=" + ipList +
'}';
}
}
......@@ -13,7 +13,7 @@ public class GetJoinGroupListResult extends GenericResult {
private Integer totalCount;
@JsonProperty("GroupIdList")
private List<GroupIdListIResultItem> groupIdList;
private List<GroupIdListResultItem> groupIdList;
@Override
public String toString() {
......
......@@ -6,19 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @author xy
* @since 2021/07/31 11:51:01
*/
public class GetNoSpeakingResult {
/**
* 失败原因
*/
@JsonProperty("ErrorInfo")
private String errorInfo;
/**
* 错误码,0为成功,其他为失败,错误码表:https://cloud.tencent.com/document/product/269/1671
*/
@JsonProperty("ErrorCode")
private Integer errorCode;
public class GetNoSpeakingResult extends GenericResult {
/**
* 单聊消息禁言时长,单位为秒
*/
......@@ -32,22 +20,6 @@ public class GetNoSpeakingResult {
private Long groupMsgNoSpeakingTime;
public String getErrorInfo() {
return errorInfo;
}
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public Long getC2CMsgNoSpeakingTime() {
return c2CMsgNoSpeakingTime;
}
......@@ -66,16 +38,9 @@ public class GetNoSpeakingResult {
@Override
public String toString() {
return "GetNoSpeakingResult{"
+ "errorInfo='"
+ errorInfo
+ '\''
+ ", errorCode="
+ errorCode
+ ", c2CMsgNoSpeakingTime="
+ c2CMsgNoSpeakingTime
+ ", groupMsgNoSpeakingTime="
+ groupMsgNoSpeakingTime
+ '}';
return "GetNoSpeakingResult{" +
"c2CMsgNoSpeakingTime=" + c2CMsgNoSpeakingTime +
", groupMsgNoSpeakingTime=" + groupMsgNoSpeakingTime +
'}';
}
}
......@@ -2,6 +2,8 @@ package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author hyh
* @since 2021/07/30 17:43
......@@ -13,6 +15,9 @@ public class GroupGetResultItem {
@JsonProperty("FriendNumber")
private Integer friendNumber;
@JsonProperty("To_Account")
private List<String> toAccount;
public String getGroupName() {
return groupName;
}
......@@ -28,4 +33,21 @@ public class GroupGetResultItem {
public void setFriendNumber(Integer friendNumber) {
this.friendNumber = friendNumber;
}
public List<String> getToAccount() {
return toAccount;
}
public void setToAccount(List<String> toAccount) {
this.toAccount = toAccount;
}
@Override
public String toString() {
return "GroupGetResultItem{" +
"groupName='" + groupName + '\'' +
", friendNumber=" + friendNumber +
", toAccount=" + toAccount +
'}';
}
}
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author bingo
* @since 2021/8/4 10:48
*/
public class GroupIdListIResultItem {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("Type")
private String type;
@JsonProperty("Name")
private String name;
@JsonProperty("Introduction")
private String introduction;
@JsonProperty("Notification")
private String notification;
@JsonProperty("FaceUrl")
private String faceUrl;
@JsonProperty("Owner_Account")
private String ownerAccount;
@JsonProperty("CreateTime")
private Integer createTime;
@JsonProperty("InfoSeq")
private Integer infoSeq;
@JsonProperty("LastInfoTime")
private Integer lastInfoTime;
@JsonProperty("LastMsgTime")
private Integer lastMsgTime;
@JsonProperty("NextMsgSeq")
private Integer nextMsgSeq;
@JsonProperty("MemberNum")
private Integer memberNum;
@JsonProperty("MaxMemberNum")
private Integer maxMemberNum;
@JsonProperty("ApplyJoinOption")
private String applyJoinOption;
@Override
public String toString() {
return "GroupIdListIResultItem{" +
"groupId='" + groupId + '\'' +
", type='" + type + '\'' +
", name='" + name + '\'' +
", introduction='" + introduction + '\'' +
", notification='" + notification + '\'' +
", faceUrl='" + faceUrl + '\'' +
", ownerAccount='" + ownerAccount + '\'' +
", createTime=" + createTime +
", infoSeq=" + infoSeq +
", lastInfoTime=" + lastInfoTime +
", lastMsgTime=" + lastMsgTime +
", nextMsgSeq=" + nextMsgSeq +
", memberNum=" + memberNum +
", maxMemberNum=" + maxMemberNum +
", applyJoinOption='" + applyJoinOption + '\'' +
'}';
}
}
......@@ -3,13 +3,10 @@ package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* 群基础资料
* https://cloud.tencent.com/document/product/269/1502#.E7.BE.A4.E7.BB.84.E6.95.B0.E6.8D.AE.E7.BB.93.E6.9E.84.E4.BB.8B.E7.BB.8D
*
* @author bingo
* @since 2021/8/1 11:39
* @since 2021/8/4 10:48
*/
public class GroupInfoResultItem {
public class GroupIdListResultItem {
@JsonProperty("GroupId")
private String groupId;
......@@ -177,7 +174,7 @@ public class GroupInfoResultItem {
@Override
public String toString() {
return "GroupInfoResultItem{" +
return "GroupIdListIResultItem{" +
"groupId='" + groupId + '\'' +
", type='" + type + '\'' +
", name='" + name + '\'' +
......
......@@ -12,6 +12,14 @@ public class GroupMsgRecallResult extends GenericResult {
@JsonProperty("RecallRetList")
private List<RecallRetItem> recallRetList;
public List<RecallRetItem> getRecallRetList() {
return recallRetList;
}
public void setRecallRetList(List<RecallRetItem> recallRetList) {
this.recallRetList = recallRetList;
}
@Override
public String toString() {
return "GroupMsgRecallResult{" +
......
......@@ -12,6 +12,14 @@ public class ImportGroupMemberResult extends GenericResult {
@JsonProperty("MemberList")
private List<MemberListResultItem> memberList;
public List<MemberListResultItem> getMemberList() {
return memberList;
}
public void setMemberList(List<MemberListResultItem> memberList) {
this.memberList = memberList;
}
@Override
public String toString() {
return "ImportGroupMemberResult{" +
......
......@@ -12,6 +12,14 @@ public class ImportGroupMsgResult extends GenericResult {
@JsonProperty("ImportMsgResult")
private List<ImportMsgResultItem> importMsgResult;
public List<ImportMsgResultItem> getImportMsgResult() {
return importMsgResult;
}
public void setImportMsgResult(List<ImportMsgResultItem> importMsgResult) {
this.importMsgResult = importMsgResult;
}
@Override
public String toString() {
return "ImportGroupMsgResult{" +
......
......@@ -16,6 +16,30 @@ public class ImportMsgResultItem {
@JsonProperty("Result")
private Integer result;
public Integer getMsgSeq() {
return msgSeq;
}
public void setMsgSeq(Integer msgSeq) {
this.msgSeq = msgSeq;
}
public Integer getMsgTime() {
return msgTime;
}
public void setMsgTime(Integer msgTime) {
this.msgTime = msgTime;
}
public Integer getResult() {
return result;
}
public void setResult(Integer result) {
this.result = result;
}
@Override
public String toString() {
return "ImportMsgResultItem{" +
......
package io.github.doocs.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 +
'}';
}
}
......@@ -13,6 +13,22 @@ public class MemberListResultItem {
@JsonProperty("Result")
private Integer result;
public String getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(String memberAccount) {
this.memberAccount = memberAccount;
}
public Integer getResult() {
return result;
}
public void setResult(Integer result) {
this.result = result;
}
@Override
public String toString() {
return "MemberListResultItem{" +
......
......@@ -123,4 +123,19 @@ public class MsgListItem {
public void setCloudCustomData(String cloudCustomData) {
this.cloudCustomData = cloudCustomData;
}
@Override
public String toString() {
return "MsgListItem{" +
"fromAccount='" + fromAccount + '\'' +
", toAccount='" + toAccount + '\'' +
", msgSeq=" + msgSeq +
", msgRandom=" + msgRandom +
", msgTimeStamp=" + msgTimeStamp +
", msgFlagBits=" + msgFlagBits +
", msgKey='" + msgKey + '\'' +
", msgBody=" + msgBody +
", cloudCustomData='" + cloudCustomData + '\'' +
'}';
}
}
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author bingo
* @since 2021/7/28 11:07
*/
public class QueryOnlineStatusResult extends GenericResult {
@JsonProperty("QueryResult")
private List<QueryResultItem> queryResult;
@JsonProperty("ErrorList")
private List<QueryResultErrorItem> errorList;
public List<QueryResultItem> getQueryResult() {
return queryResult;
}
public void setQueryResult(List<QueryResultItem> queryResult) {
this.queryResult = queryResult;
}
public List<QueryResultErrorItem> getErrorList() {
return errorList;
}
public void setErrorList(List<QueryResultErrorItem> errorList) {
this.errorList = errorList;
}
@Override
public String toString() {
return "QueryOnlineStatusResult{" +
"queryResult=" + queryResult +
", errorList=" + errorList +
'}';
}
}
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author bingo
* @since 2021/10/31 19:57
*/
public class QueryResultDetailItem {
@JsonProperty("Platform")
private String platform;
@JsonProperty("Status")
private String status;
public String getPlatform() {
return platform;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return "QueryResultDetailItem{" +
"platform='" + platform + '\'' +
", status='" + status + '\'' +
'}';
}
}
......@@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @author bingo
* @since 2021/7/28 11:11
*/
public class QueryStateErrorItem {
public class QueryResultErrorItem {
@JsonProperty("To_Account")
private String toAccount;
......@@ -31,7 +31,7 @@ public class QueryStateErrorItem {
@Override
public String toString() {
return "QueryStateErrorItem{" +
return "QueryResultErrorItem{" +
"toAccount='" + toAccount + '\'' +
", errorCode=" + errorCode +
'}';
......
......@@ -2,17 +2,22 @@ package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author bingo
* @since 2021/7/28 11:10
*/
public class QueryStateResultItem {
public class QueryResultItem {
@JsonProperty("To_Account")
private String toAccount;
@JsonProperty("Status")
private String status;
@JsonProperty("Detail")
private List<QueryResultDetailItem> detail;
public String getToAccount() {
return toAccount;
}
......@@ -29,11 +34,20 @@ public class QueryStateResultItem {
this.status = status;
}
public List<QueryResultDetailItem> getDetail() {
return detail;
}
public void setDetail(List<QueryResultDetailItem> detail) {
this.detail = detail;
}
@Override
public String toString() {
return "QueryStateResultItem{" +
return "QueryResultItem{" +
"toAccount='" + toAccount + '\'' +
", status='" + status + '\'' +
", detail=" + detail +
'}';
}
}
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author bingo
* @since 2021/7/28 11:07
*/
public class QueryStateResult extends GenericResult {
@JsonProperty("QueryStateResult")
private List<QueryStateResultItem> queryStateResult;
@JsonProperty("QueryStateErrorList")
private List<QueryStateErrorItem> queryStateErrorList;
public List<QueryStateResultItem> getQueryStateResult() {
return queryStateResult;
}
public void setQueryStateResult(List<QueryStateResultItem> queryStateResult) {
this.queryStateResult = queryStateResult;
}
public List<QueryStateErrorItem> getQueryStateErrorList() {
return queryStateErrorList;
}
public void setQueryStateErrorList(List<QueryStateErrorItem> queryStateErrorList) {
this.queryStateErrorList = queryStateErrorList;
}
@Override
public String toString() {
return "QueryStateResult{" +
"queryStateResult=" + queryStateResult +
", queryStateErrorList=" + queryStateErrorList +
'}';
}
}
......@@ -17,7 +17,7 @@ public class RecentContactSessionItem {
private String groupId;
@JsonProperty("MsgTime")
private String msgTime;
private Integer msgTime;
@JsonProperty("TopFlag")
private Integer topFlag;
......@@ -46,11 +46,11 @@ public class RecentContactSessionItem {
this.groupId = groupId;
}
public String getMsgTime() {
public Integer getMsgTime() {
return msgTime;
}
public void setMsgTime(String msgTime) {
public void setMsgTime(Integer msgTime) {
this.msgTime = msgTime;
}
......
package io.github.doocs.im.model.response;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* @author xy
* @since 2021/07/31 11:51:01
*/
public class SetNoSpeakingResult {
/**
* 失败原因
*/
@JsonProperty("ErrorInfo")
private String errorInfo;
/**
* 错误码,0为成功,其他为失败,错误码表:https://cloud.tencent.com/document/product/269/1671
*/
@JsonProperty("ErrorCode")
private Integer errorCode;
public String getErrorInfo() {
return errorInfo;
}
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public Integer getErrorCode() {
return errorCode;
}
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
public class SetNoSpeakingResult extends GenericResult {
@Override
public String toString() {
return "SetNoSpeakingResult{" +
"errorInfo='" + errorInfo + '\'' +
", errorCode=" + errorCode +
'}';
}
}
......@@ -85,9 +85,9 @@ public class AccountTest {
@Test
public void testQueryState() throws IOException {
List<String> toAccount = Collections.singletonList("bingo");
QueryStateRequest request = new QueryStateRequest(toAccount);
QueryOnlineStatus request = new QueryOnlineStatus(toAccount);
request.setIsNeedDetail(IsNeedDetail.YES);
QueryStateResult result = client.account.queryState(request);
QueryOnlineStatusResult result = client.account.queryOnlineStatus(request);
System.out.println(result);
Assert.assertEquals("OK", result.getActionStatus());
}
......
......@@ -50,7 +50,9 @@ public class GroupTest {
@Test
public void testCreateGroup() throws IOException {
CreateGroupRequest request = new CreateGroupRequest(GroupType.PUBLIC, "TestGroup");
CreateGroupRequest request = new CreateGroupRequest();
request.setType(GroupType.PUBLIC);
request.setName("TestGroup");
request.setOwnerAccount("bingo");
request.setGroupId("MyFirstGroup");
request.setIntroduction("This is group Introduction");
......
......@@ -99,7 +99,7 @@ public class MessageTest {
public void testGetC2CUnreadMsgNum() throws IOException {
GetC2cUnreadMsgRequest request = new GetC2cUnreadMsgRequest("test2");
request.setPeerAccount(Arrays.asList("test1", "bingo"));
C2cUnreadMsgNumResult result = client.message.getC2cUnreadMsgRequest(request);
C2cUnreadMsgNumResult result = client.message.getC2cUnreadMsgNum(request);
System.out.println(result);
Assert.assertEquals("OK", result.getActionStatus());
}
......
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