Unverified Commit 633c5b6a authored by Yang Libin's avatar Yang Libin Committed by GitHub

refactor: add constant package and update constructors (#42)

* feat: update util package * feat: add error code list * feat: add constants and update constructors * chore: change path
parent 622e5bf1
package io.github.doocs.im.constant;
/**
* 请求处理的结果
*
* @author bingo
* @since 2021/10/30 20:09
*/
public class ActionStatus {
/**
* 成功
*/
public static final String OK = "OK";
/**
* 失败
*/
public static final String FAIL = "FAIL";
private ActionStatus() {
}
}
package io.github.doocs.im.constant;
/**
* 加好友方式
*
* @author bingo
* @since 2021/10/30 15:50
*/
public class AddType {
/**
* 单向加好友
*/
public static final String SINGLE = "Add_Type_Single";
/**
* 双向加好友
*/
public static final String BOTH = "Add_Type_Both";
private AddType() {
}
}
package io.github.doocs.im.constant;
/**
* 申请加群处理方式
*
* @author bingo
* @since 2021/10/30 17:54
*/
public class ApplyJoinOption {
/**
* 自由加入
*/
public static final String FREE_ACCESS = "FreeAccess";
/**
* 需要验证
*/
public static final String NEED_PERMISSION = "NeedPermission";
/**
* 禁止加群
*/
public static final String DISABLE_APPLY = "DisableApply";
private ApplyJoinOption() {
}
}
package io.github.doocs.im.constant;
/**
* 会话辅助标志位
*
* @author bingo
* @since 2021/10/30 17:35
*/
public class AssistFlags {
/**
* 是否支持置顶会话
*/
public static final int BIT_0 = 0;
/**
* 是否返回空会话
*/
public static final int BIT_1 = 1;
/**
* 是否支持置顶会话分页
*/
public static final int BIT_2 = 2;
private AssistFlags() {
}
}
package io.github.doocs.im.constant;
/**
* 校验黑名单
*
* @author bingo
* @since 2021/10/30 17:02
*/
public class BlackCheckResultType {
/**
* 单向校验黑名单关系
*/
public static final String SINGLE = "BlackCheckResult_Type_Single";
/**
* 双向校验黑名单关系
*/
public static final String BOTH = "BlackCheckResult_Type_Both";
private BlackCheckResultType() {
}
}
package io.github.doocs.im.constant;
/**
* 校验黑名单关系结果
*
* @author bingo
* @since 2021/10/30 16:20
*/
public class BlackCheckResultTypeRelation {
/**
* 单、双向校验黑名单关系
* <p>
* From_Account 的黑名单中有 To_Account,但无法确定 To_Account 的黑名单中是否有 From_Account
*/
public static final String A_WITH_B = "BlackCheckResult_Type_AWithB";
/**
* 双向校验黑名单关系
* <p>
* From_Account 的黑名单中没有 To_Account,但 To_Account 的黑名单中有 From_Account
*/
public static final String B_WITH_A = "BlackCheckResult_Type_BWithA";
/**
* 单、双向校验黑名单关系
* <p>
* From_Account 的黑名单中没有 To_Account,但无法确定 To_Account 的黑名单中是否有 From_Account
*/
public static final String NO = "BlackCheckResult_Type_NO";
/**
* 双向校验黑名单关系
* <p>
* From_Account 的黑名单中有 To_Account,To_Account 的黑名单中也有 From_Account
*/
public static final String BOTH_WAY = "BlackCheckResult_Type_BothWay";
private BlackCheckResultTypeRelation() {
}
}
package io.github.doocs.im.constant;
/**
* 消息类型
*
* @author bingo
* @since 2021/10/30 19:42
*/
public class ChatType {
/**
* 单发消息
*/
public static final String C2C = "C2C";
/**
* 群组消息
*/
public static final String GROUP = "Group";
private ChatType() {
}
}
package io.github.doocs.im.constant;
/**
* 校验好友
*
* @author bingo
* @since 2021/10/30 16:36
*/
public class CheckResultType {
/**
* 单向校验好友关系
*/
public static final String SINGLE = "CheckResult_Type_Single";
/**
* 双向校验好友关系
*/
public static final String BOTH = "CheckResult_Type_Both";
private CheckResultType() {
}
}
package io.github.doocs.im.constant;
/**
* 校验好友关系结果
*
* @author bingo
* @since 2021/10/30 16:17
*/
public class CheckResultTypeRelation {
/**
* 单、双向校验好友关系
* <p>
* From_Account 的好友表中没有 To_Account,但无法确定 To_Account 的好友表中是否有 From_Account
*/
public static final String NO_RELATION = "CheckResult_Type_NoRelation";
/**
* 单、双向校验好友关系
* <p>
* From_Account 的好友表中有 To_Account,但无法确定 To_Account 的好友表中是否有 From_Account
*/
public static final String A_WITH_B = "CheckResult_Type_AWithB";
/**
* 双向校验好友关系
* <p>
* From_Account 的好友表中没有 To_Account,但 To_Account 的好友表中有 From_Account
*/
public static final String B_WITH_A = "CheckResult_Type_BWithA";
/**
* 双向校验好友关系
* <p>
* From_Account 的好友表中有 To_Account,To_Account 的好友表中也有 From_Account
*/
public static final String BOTH_WAY = "CheckResult_Type_BothWay";
private CheckResultTypeRelation() {
}
}
package io.github.doocs.im.constant;
/**
* 是否清理漫游消息
*
* @author bingo
* @since 2021/10/30 17:42
*/
public class ClearRamble {
/**
* 清理
*/
public static final int YES = 1;
/**
* 不清理
*/
public static final int NO = 0;
private ClearRamble() {
}
}
package io.github.doocs.im.constant;
/**
* 公共错误码
*
* @author bingo
* @since 2021/10/30 9:54
*/
public enum CommonErrorCode {
/**
* REST API 公共错误码:https://cloud.tencent.com/document/product/269/1519
*/
SUCCESS(0, "成功"),
MSG_TEXT_SECURITY_STRIKE(80001, "消息文本安全打击"),
HTTP_PARSE_ERROR(60002, "HTTP 解析错误 ,请检查 HTTP 请求 URL 格式"),
HTTP_JSON_PARSE_ERROR(60002, "HTTP 请求 JSON 解析错误,请检查 JSON 格式"),
WRONG_ACCOUNT_OR_SIGNATURE(60004, "请求 URL 或 JSON 包体中帐号或签名错误"),
WRONG_ACCOUNT_OR_SIGNATURE_2(60005, "请求 URL 或 JSON 包体中帐号或签名错误"),
INVALID_SDK_APP_ID(60006, "SDKAppID 失效,请核对 SDKAppID 有效性"),
EXCEED_FREQUENCY_LIMIT_REST_API(60007, "REST 接口调用频率超过限制,请降低请求频率"),
SERVICE_TIMEOUT_OR_WRONG_HTTP_REQUEST_FORMAT(60008, "服务请求超时或 HTTP 请求格式错误,请检查并重试"),
REQUEST_RESOURCE_ERROR(60009, "请求资源错误,请检查请求 URL"),
NEED_ADMIN_AUTHORITY(60010, "请求需要 App 管理员权限"),
EXCEED_FREQUENCY_LIMIT_SDK_APP_ID(60011, "SDKAppID 请求频率超限,请降低请求频率"),
NEED_SDK_APP_ID(60012, "REST 接口需要带 SDKAppID,请检查请求 URL 中的 SDKAppID"),
HTTP_RESPONSE_JSON_PARSE_ERROR(60013, "HTTP 响应包 JSON 解析错误"),
DISPLACE_ACCOUNT_TIMEOUT(60014, "置换帐号超时"),
WRONG_ACCOUNT_TYPE(60015, "请求包体帐号类型错误,请确认帐号为字符串格式"),
SDK_APP_ID_DISABLED(60016, "SDKAppID 被禁用"),
REQUEST_DISABLED(60017, "请求被禁用"),
REQUEST_TOO_FREQUENT(60018, "请求过于频繁,请稍后重试"),
REQUEST_TOO_FREQUENT_2(60019, "请求过于频繁,请稍后重试"),
EXPIRED_PRO_PACKAGE(60020, "您的专业版套餐包已到期并停用,请登录 即时通信 IM 购买页面 重新购买套餐包。购买后,将在5分钟后生效"),
ILLEGAL_IP_REST_API(60021, "RestAPI 调用来源 IP 非法"),
;
CommonErrorCode(Integer code, String info) {
this.code = code;
this.info = info;
}
private Integer code;
private String info;
public Integer getCode() {
return code;
}
public String getInfo() {
return info;
}
}
package io.github.doocs.im.constant;
/**
* 删除模式
*
* @author bingo
* @since 2021/10/30 16:08
*/
public class DeleteType {
public static final String SINGLE = "Delete_Type_Single";
public static final String BOTH = "Delete_Type_Both";
private DeleteType() {
}
}
package io.github.doocs.im.constant;
/**
* 消息回调禁止开关,只对单条消息有效
*
* @author bingo
* @since 2021/10/30 19:12
*/
public class ForbidCallbackControl {
/**
* 禁止发消息前回调
*/
public static final String BEFORE = "ForbidBeforeSendMsgCallback";
/**
* 禁止发消息后回调
*/
public static final String AFTER = "ForbidAfterSendMsgCallback";
private ForbidCallbackControl() {
}
}
package io.github.doocs.im.constant;
/**
* 管理员强制加好友标记
*
* @author bingo
* @since 2021/10/30 15:54
*/
public class ForceAddFlags {
/**
* 强制加好友
*/
public static final Integer FORCE = 1;
/**
* 常规加好友
*/
public static final Integer NORMAL = 2;
private ForceAddFlags() {
}
}
package io.github.doocs.im.constant;
/**
* 群组形态
*
* @author bingo
* @since 2021/10/30 17:48
*/
public class GroupType {
/**
* 公开群
*/
public static final String PUBLIC = "Public";
/**
* 私密群
*/
public static final String PRIVATE = "Private";
/**
* 聊天室
*/
public static final String CHAT_ROOM = "ChatRoom";
/**
* 音视频聊天室
*/
public static final String AV_CHAT_ROOM = "AVChatRoom";
/**
* 在线成员广播大群
*/
public static final String BC_CHAT_ROOM = "BChatRoom";
private GroupType() {
}
}
package io.github.doocs.im.constant;
/**
* 是否需要返回详细的登录平台信息
*
* @author bingo
* @since 2021/10/30 20:13
*/
public class IsNeedDetail {
/**
* 不需要
*/
public static final int NO = 0;
/**
* 需要
*/
public static final int YES = 1;
private IsNeedDetail() {
}
}
package io.github.doocs.im.constant;
/**
* 群成员角色
*
* @author bingo
* @since 2021/10/30 18:44
*/
public class MemberRole {
/**
* 群主
*/
public static final String OWNER = "Owner";
/**
* 群管理员
*/
public static final String ADMIN = "Admin";
/**
* 普通群成员
*/
public static final String MEMBER = "Member";
private MemberRole() {
}
}
package io.github.doocs.im.constant;
/**
* 消息接收选项
*
* @author bingo
* @since 2021/10/30 19:50
*/
public class MsgFlag {
/**
* 接收并提示
*/
public static final String ACCEPT_AND_NOTIFY = "AcceptAndNotify";
/**
* 接收不提示
*/
public static final String ACCEPT_NOT_NOTIFY = "AcceptNotNotify";
/**
* 屏蔽群消息
*/
public static final String DISCARD = "Discard";
private MsgFlag() {
}
}
......@@ -46,4 +46,8 @@ public class MsgType {
* 视频消息
*/
public static final String TIM_VIDEO_FILE_ELEM = "TIMVideoFileElem";
private MsgType() {
}
}
package io.github.doocs.im.constant;
/**
* 是否需要拉取分组下的user列表
*
* @author bingo
* @since 2021/10/30 17:28
*/
public class NeedFriendType {
/**
* 拉取
*/
public static final String YES = "Need_Friend_Type_Yes";
/**
* 不拉取
*/
public static final String NO = null;
private NeedFriendType() {
}
}
package io.github.doocs.im.constant;
/**
* 禁言时间
*
* @author bingo
* @since 2021/10/30 19:33
*/
public class NoSpeakingTime {
/**
* 取消禁言
*/
public static final long NEVER = 0;
/**
* 永久禁言
*/
public static final long FOREVER = 0xFFFFFFFF;
private NoSpeakingTime() {
}
}
package io.github.doocs.im.constant;
/**
* 消息发送对象标识
*
* @author bingo
* @since 2021/10/30 19:14
*/
public class OnlineOnlyFlag {
/**
* 仅发送在线成员
*/
public static final int YES = 1;
/**
* 发送所有成员
*/
public static final int NO = 0;
private OnlineOnlyFlag() {
}
}
package io.github.doocs.im.constant;
/**
* 推送标识
*
* @author bingo
* @since 2021/10/30 20:02
*/
public class PushFlag {
/**
* 推送
*/
public static final int YES = 1;
/**
* 不离线推送
*/
public static final int NO = 0;
private PushFlag() {
}
}
package io.github.doocs.im.constant;
/**
* 会话类型
*
* @author bingo
* @since 2021/10/30 17:41
*/
public class RecentContactType {
/**
* C2C会话
*/
public static final int C2C = 1;
/**
* G2C会话
*/
public static final int G2C = 2;
private RecentContactType() {
}
}
package io.github.doocs.im.constant;
/**
* 是否将消息同步到其他端
*
* @author bingo
* @since 2021/10/30 20:16
*/
public class SyncOtherMachine {
/**
* 同步
*/
public static final int YES = 1;
/**
* 不同步
*/
public static final int NO = 2;
private SyncOtherMachine() {
}
}
package io.github.doocs.im.constant;
/**
* 标配资料字段
*
* @author bingo
* @since 2021/10/30 16:43
*/
public class TagProfile {
/**
* 昵称
*/
public static final String IM_NICK = "Tag_Profile_IM_Nick";
/**
* 性别
*/
public static final String IM_GENDER = "Tag_Profile_IM_Gender";
/**
* 生日
*/
public static final String IM_BIRTHDAY = "Tag_Profile_IM_BirthDay";
/**
* 所在地
*/
public static final String IM_LOCATION = "Tag_Profile_IM_Location";
/**
* 个性签名
*/
public static final String IM_SELF_SIGNATURE = "Tag_Profile_IM_SelfSignature";
/**
* 加好友验证方式
*/
public static final String IM_ALLOW_TYPE = "Tag_Profile_IM_AllowType";
/**
* 语言
*/
public static final String IM_LANGUAGE = "Tag_Profile_IM_Language";
/**
* 头像URL
*/
public static final String IM_IMAGE = "Tag_Profile_IM_Image";
/**
* 消息设置
*/
public static final String IM_MSG_SETTINGS = "Tag_Profile_IM_MsgSettings";
/**
* 管理员禁止加好友标识
*/
public static final String IM_ADMIN_FORBID_TYPE = "Tag_Profile_IM_AdminForbidType";
/**
* 等级
*/
public static final String IM_LEVEL = "Tag_Profile_IM_Level";
/**
* 角色
*/
public static final String IM_ROLE = "Tag_Profile_IM_Role";
private TagProfile() {
}
}
package io.github.doocs.im.constant;
/**
* 是否获取用户加入的AVChatRoom
*
* @author bingo
* @since 2021/10/30 18:59
*/
public class WithHugeGroups {
/**
* 不获取(默认)
*/
public static final int NO = 0;
/**
* 获取
*/
public static final int YES = 1;
private WithHugeGroups() {
}
}
package io.github.doocs.im.constant;
/**
* 是否获取用户已加入但未激活的群信息
*
* @author bingo
* @since 2021/10/30 19:02
*/
public class WithNoActiveGroups {
/**
* 不获取(默认)
*/
public static final int NO = 0;
/**
* 获取
*/
public static final int YES = 1;
private WithNoActiveGroups() {
}
}
......@@ -47,9 +47,9 @@ public class Message {
return JsonUtil.str2Obj(result, ImportMsgResult.class);
}
public AdminRoamMsgResult getRoamMsg(AdminRoamMsgRequest adminRoamMsgRequest) throws IOException {
public AdminRoamMsgResult getRoamMsg(AdminGetRoamMsgRequest adminGetRoamMsgRequest) throws IOException {
String url = imClient.getUrl(SERVICE_NAME, ADMIN_GET_ROAM_MSG_COMMAND);
String result = HttpUtil.post(url, JsonUtil.obj2Str(adminRoamMsgRequest), null);
String result = HttpUtil.post(url, JsonUtil.obj2Str(adminGetRoamMsgRequest), null);
return JsonUtil.str2Obj(result, AdminRoamMsgResult.class);
}
......
......@@ -12,6 +12,10 @@ public class AccountCheckItem {
@JsonProperty("UserID")
private String userId;
public AccountCheckItem(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
......
......@@ -14,6 +14,10 @@ public class AccountCheckRequest extends GenericRequest {
@JsonProperty("CheckItem")
private List<AccountCheckItem> checkItemList;
public AccountCheckRequest(List<AccountCheckItem> checkItemList) {
this.checkItemList = checkItemList;
}
public List<AccountCheckItem> getCheckItemList() {
return checkItemList;
}
......
......@@ -12,6 +12,10 @@ public class AccountDeleteItem {
@JsonProperty("UserID")
private String userId;
public AccountDeleteItem(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
......
......@@ -14,6 +14,10 @@ public class AccountDeleteRequest extends GenericRequest {
@JsonProperty("DeleteItem")
private List<AccountDeleteItem> deleteItemList;
public AccountDeleteRequest(List<AccountDeleteItem> deleteItemList) {
this.deleteItemList = deleteItemList;
}
public List<AccountDeleteItem> getDeleteItemList() {
return deleteItemList;
}
......
......@@ -18,8 +18,8 @@ public class AccountImportRequest extends GenericRequest {
@JsonProperty("FaceUrl")
private String faceUrl;
public AccountImportRequest() {
public AccountImportRequest(String identifier) {
this(identifier, null, null);
}
public AccountImportRequest(String identifier, String nick, String faceUrl) {
......
......@@ -24,7 +24,8 @@ public class AddFriendItem {
@JsonProperty("AddWording")
private String addWording;
public AddFriendItem() {
public AddFriendItem(String toAccount, String addSource) {
this(toAccount, null, null, addSource, null);
}
public AddFriendItem(String toAccount, String remark, String groupName, String addSource, String addWording) {
......
......@@ -20,7 +20,8 @@ public class AddGroupMemberRequest extends GenericRequest {
@JsonProperty("MemberList")
private List<MemberRequestItem> memberList;
public AddGroupMemberRequest() {
public AddGroupMemberRequest(String groupId, List<MemberRequestItem> memberList) {
this(groupId, null, memberList);
}
public AddGroupMemberRequest(String groupId, Integer silence, List<MemberRequestItem> memberList) {
......
......@@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @since 2021/7/31 14:27
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AdminRoamMsgRequest extends GenericRequest {
public class AdminGetRoamMsgRequest extends GenericRequest {
@JsonProperty("From_Account")
private String fromAccount;
......@@ -27,6 +27,19 @@ public class AdminRoamMsgRequest extends GenericRequest {
@JsonProperty("LastMsgKey")
private String lastMsgKey;
public AdminGetRoamMsgRequest(String fromAccount, String toAccount, Integer maxCnt, Integer minTime, Integer maxTime) {
this(fromAccount, toAccount, maxCnt, minTime, maxTime, null);
}
public AdminGetRoamMsgRequest(String fromAccount, String toAccount, Integer maxCnt, Integer minTime, Integer maxTime, String lastMsgKey) {
this.fromAccount = fromAccount;
this.toAccount = toAccount;
this.maxCnt = maxCnt;
this.minTime = minTime;
this.maxTime = maxTime;
this.lastMsgKey = lastMsgKey;
}
public String getFromAccount() {
return fromAccount;
}
......
......@@ -18,6 +18,12 @@ public class AdminMsgWithdrawRequest extends GenericRequest {
@JsonProperty("MsgKey")
private String msgKey;
public AdminMsgWithdrawRequest(String fromAccount, String toAccount, String msgKey) {
this.fromAccount = fromAccount;
this.toAccount = toAccount;
this.msgKey = msgKey;
}
public String getFromAccount() {
return fromAccount;
}
......
......@@ -18,6 +18,16 @@ public class AdminSetMsgReadRequest extends GenericRequest {
@JsonProperty("MsgReadTime")
private Integer msgReadTime;
public AdminSetMsgReadRequest(String reportAccount, String peerAccount) {
this(reportAccount, peerAccount, null);
}
public AdminSetMsgReadRequest(String reportAccount, String peerAccount, Integer msgReadTime) {
this.reportAccount = reportAccount;
this.peerAccount = peerAccount;
this.msgReadTime = msgReadTime;
}
public String getReportAccount() {
return reportAccount;
}
......
......@@ -25,7 +25,13 @@ public class AndroidInfo {
private String googleChannelId;
@JsonProperty("VIVOClassification")
private String vivoChannelId;
private Integer vivoClassification;
@JsonProperty("HuaWeiImportance")
private String huaweiImportance;
@JsonProperty("ExtAsHuaweiIntentParam")
private Integer extAsHuaweiIntentParam;
public String getSound() {
return sound;
......@@ -67,11 +73,27 @@ public class AndroidInfo {
this.googleChannelId = googleChannelId;
}
public String getVivoChannelId() {
return vivoChannelId;
public Integer getVivoClassification() {
return vivoClassification;
}
public void setVivoClassification(Integer vivoClassification) {
this.vivoClassification = vivoClassification;
}
public String getHuaweiImportance() {
return huaweiImportance;
}
public void setHuaweiImportance(String huaweiImportance) {
this.huaweiImportance = huaweiImportance;
}
public Integer getExtAsHuaweiIntentParam() {
return extAsHuaweiIntentParam;
}
public void setVivoChannelId(String vivoChannelId) {
this.vivoChannelId = vivoChannelId;
public void setExtAsHuaweiIntentParam(Integer extAsHuaweiIntentParam) {
this.extAsHuaweiIntentParam = extAsHuaweiIntentParam;
}
}
......@@ -39,10 +39,13 @@ public class BatchSendMsgRequest {
@JsonProperty("OfflinePushInfo")
private OfflinePushInfo offlinePushInfo;
public BatchSendMsgRequest() {
public BatchSendMsgRequest(List<String> toAccount, Integer msgRandom, List<TIMMsgElement> msgBody) {
this(null, null, toAccount, null, msgRandom, msgBody, null, null, null);
}
public BatchSendMsgRequest(Integer syncOtherMachine, String fromAccount, List<String> toAccount, Integer msgSeq, Integer msgRandom, List<TIMMsgElement> msgBody, String cloudCustomData, List<String> sendMsgControl, OfflinePushInfo offlinePushInfo) {
public BatchSendMsgRequest(Integer syncOtherMachine, String fromAccount, List<String> toAccount,
Integer msgSeq, Integer msgRandom, List<TIMMsgElement> msgBody, String cloudCustomData,
List<String> sendMsgControl, OfflinePushInfo offlinePushInfo) {
this.syncOtherMachine = syncOtherMachine;
this.fromAccount = fromAccount;
this.toAccount = toAccount;
......
......@@ -17,9 +17,6 @@ public class BlackListAddRequest extends GenericRequest {
@JsonProperty("To_Account")
private List<String> toAccount;
public BlackListAddRequest() {
}
public BlackListAddRequest(String fromAccount, List<String> toAccount) {
this.fromAccount = fromAccount;
this.toAccount = toAccount;
......
......@@ -20,9 +20,6 @@ public class BlackListCheckRequest extends GenericRequest {
@JsonProperty("CheckType")
private String checkType;
public BlackListCheckRequest() {
}
public BlackListCheckRequest(String fromAccount, List<String> toAccount, String checkType) {
this.fromAccount = fromAccount;
this.toAccount = toAccount;
......
......@@ -17,9 +17,6 @@ public class BlackListDeleteRequest extends GenericRequest {
@JsonProperty("To_Account")
private List<String> toAccount;
public BlackListDeleteRequest() {
}
public BlackListDeleteRequest(String fromAccount, List<String> toAccount) {
this.fromAccount = fromAccount;
this.toAccount = toAccount;
......
......@@ -21,9 +21,6 @@ public class BlackListGetRequest extends GenericRequest {
@JsonProperty("LastSequence")
private Integer lastSequence;
public BlackListGetRequest() {
}
public BlackListGetRequest(String fromAccount, Integer startIndex, Integer maxLimited, Integer lastSequence) {
this.fromAccount = fromAccount;
this.startIndex = startIndex;
......
......@@ -15,9 +15,6 @@ public class ChangeGroupOwnerRequest extends GenericRequest {
@JsonProperty("NewOwner_Account")
private String newOwnerAccount;
public ChangeGroupOwnerRequest() {
}
public ChangeGroupOwnerRequest(String groupId, String newOwnerAccount) {
this.groupId = groupId;
this.newOwnerAccount = newOwnerAccount;
......
......@@ -48,6 +48,28 @@ public class CreateGroupRequest extends GenericRequest {
@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;
}
......
......@@ -38,12 +38,4 @@ public class CustomItem {
public void setValue(Object value) {
this.value = value;
}
@Override
public String toString() {
return "CustomItem{" +
"tag='" + tag + '\'' +
", value=" + value +
'}';
}
}
......@@ -17,15 +17,20 @@ public class DeleteGroupMemberRequest extends GenericRequest {
@JsonProperty("Silence")
private Integer silence;
@JsonProperty("Reason")
private String reason;
@JsonProperty("MemberToDel_Account")
private List<String> memberToDelAccount;
public DeleteGroupMemberRequest() {
public DeleteGroupMemberRequest(String groupId, List<String> memberToDelAccount) {
this(groupId, null, null, memberToDelAccount);
}
public DeleteGroupMemberRequest(String groupId, Integer silence, List<String> memberToDelAccount) {
public DeleteGroupMemberRequest(String groupId, Integer silence, String reason, List<String> memberToDelAccount) {
this.groupId = groupId;
this.silence = silence;
this.reason = reason;
this.memberToDelAccount = memberToDelAccount;
}
......@@ -45,6 +50,14 @@ public class DeleteGroupMemberRequest extends GenericRequest {
this.silence = silence;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public List<String> getMemberToDelAccount() {
return memberToDelAccount;
}
......
......@@ -15,9 +15,6 @@ public class DeleteGroupMsgBySenderRequest extends GenericRequest {
@JsonProperty("Sender_Account")
private String senderAccount;
public DeleteGroupMsgBySenderRequest() {
}
public DeleteGroupMsgBySenderRequest(String groupId, String senderAccount) {
this.groupId = groupId;
this.senderAccount = senderAccount;
......
......@@ -21,6 +21,17 @@ public class DeleteRecentContactRequest extends GenericRequest {
@JsonProperty("ClearRamble")
private Integer clearRamble;
public DeleteRecentContactRequest(String fromAccount, Integer type, String toAccount) {
this(fromAccount, type, toAccount, null);
}
public DeleteRecentContactRequest(String fromAccount, Integer type, String toAccount, Integer clearRamble) {
this.fromAccount = fromAccount;
this.type = type;
this.toAccount = toAccount;
this.clearRamble = clearRamble;
}
public String getFromAccount() {
return fromAccount;
}
......
......@@ -12,9 +12,6 @@ public class DestroyGroupRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
public DestroyGroupRequest() {
}
public DestroyGroupRequest(String groupId) {
this.groupId = groupId;
}
......
......@@ -20,9 +20,6 @@ public class ForbidSendMsgRequest extends GenericRequest {
@JsonProperty("ShutUpTime")
private Integer shutUpTime;
public ForbidSendMsgRequest() {
}
public ForbidSendMsgRequest(String groupId, List<String> membersAccount, Integer shutUpTime) {
this.groupId = groupId;
this.membersAccount = membersAccount;
......
......@@ -23,7 +23,8 @@ public class FriendAddRequest extends GenericRequest {
@JsonProperty("ForceAddFlags")
private Integer forceAddFlags;
public FriendAddRequest() {
public FriendAddRequest(String fromAccount, List<AddFriendItem> addFriendItemList) {
this(fromAccount, addFriendItemList, null, null);
}
public FriendAddRequest(String fromAccount, List<AddFriendItem> addFriendItemList, String addType, Integer forceAddFlags) {
......
......@@ -20,9 +20,6 @@ public class FriendCheckRequest extends GenericRequest {
@JsonProperty("CheckType")
private String checkType;
public FriendCheckRequest() {
}
public FriendCheckRequest(String fromAccount, List<String> toAccount, String checkType) {
this.fromAccount = fromAccount;
this.toAccount = toAccount;
......
......@@ -15,7 +15,8 @@ public class FriendDeleteAllRequest extends GenericRequest {
@JsonProperty("DeleteType")
private String deleteType;
public FriendDeleteAllRequest() {
public FriendDeleteAllRequest(String fromAccount) {
this(fromAccount, null);
}
public FriendDeleteAllRequest(String fromAccount, String deleteType) {
......
......@@ -20,7 +20,8 @@ public class FriendDeleteRequest extends GenericRequest {
@JsonProperty("DeleteType")
private String deleteType;
public FriendDeleteRequest() {
public FriendDeleteRequest(String fromAccount, List<String> toAccount) {
this(fromAccount, toAccount, null);
}
public FriendDeleteRequest(String fromAccount, List<String> toAccount, String deleteType) {
......
......@@ -20,9 +20,6 @@ public class FriendGetListRequest extends GenericRequest {
@JsonProperty("TagList")
private List<String> tagList;
public FriendGetListRequest() {
}
public FriendGetListRequest(String fromAccount, List<String> toAccount, List<String> tagList) {
this.fromAccount = fromAccount;
this.toAccount = toAccount;
......
......@@ -21,7 +21,8 @@ public class FriendGetRequest extends GenericRequest {
@JsonProperty("CustomSequence")
private Integer customSequence;
public FriendGetRequest() {
public FriendGetRequest(String fromAccount, Integer startIndex) {
this(fromAccount, startIndex, null, null);
}
public FriendGetRequest(String fromAccount, Integer startIndex, Integer standardSequence, Integer customSequence) {
......
......@@ -17,9 +17,6 @@ public class FriendImportRequest extends GenericRequest {
@JsonProperty("AddFriendItem")
private List<ImportFriendItem> importFriendItemList;
public FriendImportRequest() {
}
public FriendImportRequest(String fromAccount, List<ImportFriendItem> importFriendItemList) {
this.fromAccount = fromAccount;
this.importFriendItemList = importFriendItemList;
......
......@@ -17,9 +17,6 @@ public class FriendUpdateRequest extends GenericRequest {
@JsonProperty("UpdateItem")
private List<UpdateItem> updateItemList;
public FriendUpdateRequest() {
}
public FriendUpdateRequest(String fromAccount, List<UpdateItem> updateItemList) {
this.fromAccount = fromAccount;
this.updateItemList = updateItemList;
......
......@@ -14,6 +14,13 @@ public class GetAppInfoRequest extends GenericRequest {
@JsonProperty("RequestField")
private List<String> requestField;
public GetAppInfoRequest() {
}
public GetAppInfoRequest(List<String> requestField) {
this.requestField = requestField;
}
public List<String> getRequestField() {
return requestField;
}
......
......@@ -18,6 +18,15 @@ public class GetAppidGroupListRequest extends GenericRequest {
@JsonProperty("GroupType")
private String groupType;
public GetAppidGroupListRequest() {
}
public GetAppidGroupListRequest(Integer limit, Integer next, String groupType) {
this.limit = limit;
this.next = next;
this.groupType = groupType;
}
public Integer getLimit() {
return limit;
}
......
......@@ -17,6 +17,15 @@ public class GetC2CUnreadMsgRequest extends GenericRequest {
@JsonProperty("Peer_Account")
private List<String> peerAccount;
public GetC2CUnreadMsgRequest(String toAccount) {
this(toAccount, null);
}
public GetC2CUnreadMsgRequest(String toAccount, List<String> peerAccount) {
this.toAccount = toAccount;
this.peerAccount = peerAccount;
}
public String getToAccount() {
return toAccount;
}
......
......@@ -17,6 +17,15 @@ public class GetGroupInfoRequest extends GenericRequest {
@JsonProperty("ResponseFilter")
private ResponseFilter responseFilter;
public GetGroupInfoRequest(List<String> groupIdList) {
this(groupIdList, null);
}
public GetGroupInfoRequest(List<String> groupIdList, ResponseFilter responseFilter) {
this.groupIdList = groupIdList;
this.responseFilter = responseFilter;
}
public List<String> getGroupIdList() {
return groupIdList;
}
......
......@@ -29,10 +29,12 @@ public class GetGroupMemberInfoRequest extends GenericRequest {
@JsonProperty("Offset")
private Integer offset;
public GetGroupMemberInfoRequest() {
public GetGroupMemberInfoRequest(String groupId) {
this(groupId, null, null, null, null, null);
}
public GetGroupMemberInfoRequest(String groupId, List<String> memberInfoFilter, List<String> memberRoleFilter, List<String> appDefinedDataFilterGroupMember, Integer limit, Integer offset) {
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;
......
......@@ -12,9 +12,6 @@ public class GetGroupShuttedUinRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
public GetGroupShuttedUinRequest() {
}
public GetGroupShuttedUinRequest(String groupId) {
this.groupId = groupId;
}
......
......@@ -15,6 +15,11 @@ public class GetHistoryRequest extends GenericRequest {
@JsonProperty("MsgTime")
private String msgTime;
public GetHistoryRequest(String chatType, String msgTime) {
this.chatType = chatType;
this.msgTime = msgTime;
}
public String getChatType() {
return chatType;
}
......
......@@ -12,13 +12,39 @@ public class GetJoinedGroupListRequest extends GenericRequest {
@JsonProperty("Member_Account")
private String memberAccount;
public GetJoinedGroupListRequest() {
}
@JsonProperty("WithHugeGroups")
private Integer withHugeGroups;
@JsonProperty("WithNoActiveGroups")
private Integer withNoActiveGroups;
@JsonProperty("Limit")
private Integer limit;
@JsonProperty("Offset")
private Integer offset;
@JsonProperty("GroupType")
private String groupType;
@JsonProperty("ResponseFilter")
private ResponseFilter responseFilter;
public GetJoinedGroupListRequest(String memberAccount) {
this.memberAccount = memberAccount;
}
public GetJoinedGroupListRequest(String memberAccount, Integer withHugeGroups, Integer withNoActiveGroups,
Integer limit, Integer offset, String groupType, ResponseFilter responseFilter) {
this.memberAccount = memberAccount;
this.withHugeGroups = withHugeGroups;
this.withNoActiveGroups = withNoActiveGroups;
this.limit = limit;
this.offset = offset;
this.groupType = groupType;
this.responseFilter = responseFilter;
}
public String getMemberAccount() {
return memberAccount;
}
......@@ -26,4 +52,52 @@ public class GetJoinedGroupListRequest extends GenericRequest {
public void setMemberAccount(String memberAccount) {
this.memberAccount = memberAccount;
}
public Integer getWithHugeGroups() {
return withHugeGroups;
}
public void setWithHugeGroups(Integer withHugeGroups) {
this.withHugeGroups = withHugeGroups;
}
public Integer getWithNoActiveGroups() {
return withNoActiveGroups;
}
public void setWithNoActiveGroups(Integer withNoActiveGroups) {
this.withNoActiveGroups = withNoActiveGroups;
}
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;
}
public String getGroupType() {
return groupType;
}
public void setGroupType(String groupType) {
this.groupType = groupType;
}
public ResponseFilter getResponseFilter() {
return responseFilter;
}
public void setResponseFilter(ResponseFilter responseFilter) {
this.responseFilter = responseFilter;
}
}
......@@ -12,9 +12,6 @@ public class GetNoSpeakingRequest extends GenericRequest {
@JsonProperty("Get_Account")
private String getAccount;
public GetNoSpeakingRequest() {
}
public GetNoSpeakingRequest(String getAccount) {
this.getAccount = getAccount;
}
......
......@@ -12,9 +12,6 @@ public class GetOnlineMemberNumRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
public GetOnlineMemberNumRequest() {
}
public GetOnlineMemberNumRequest(String groupId) {
this.groupId = groupId;
}
......
......@@ -27,6 +27,15 @@ public class GetRecentContactListRequest extends GenericRequest {
@JsonProperty("AssistFlags")
private Integer assistFlags;
public GetRecentContactListRequest(String fromAccount, Integer timestamp, Integer startIndex, Integer topTimestamp, Integer topStartIndex, Integer assistFlags) {
this.fromAccount = fromAccount;
this.timestamp = timestamp;
this.startIndex = startIndex;
this.topTimestamp = topTimestamp;
this.topStartIndex = topStartIndex;
this.assistFlags = assistFlags;
}
public String getFromAccount() {
return fromAccount;
}
......
......@@ -17,9 +17,6 @@ public class GetRoleInGroupRequest extends GenericRequest {
@JsonProperty("User_Account")
private List<String> userAccount;
public GetRoleInGroupRequest() {
}
public GetRoleInGroupRequest(String groupId, List<String> userAccount) {
this.groupId = groupId;
this.userAccount = userAccount;
......
......@@ -20,7 +20,8 @@ public class GroupAddRequest extends GenericRequest {
@JsonProperty("To_Account")
private List<String> toAccount;
public GroupAddRequest() {
public GroupAddRequest(String fromAccount, List<String> groupName) {
this(fromAccount, groupName, null);
}
public GroupAddRequest(String fromAccount, List<String> groupName, List<String> toAccount) {
......
......@@ -17,9 +17,6 @@ public class GroupDeleteRequest extends GenericRequest {
@JsonProperty("GroupName")
private List<String> groupName;
public GroupDeleteRequest() {
}
public GroupDeleteRequest(String fromAccount, List<String> groupName) {
this.fromAccount = fromAccount;
this.groupName = groupName;
......
......@@ -23,7 +23,8 @@ public class GroupGetRequest extends GenericRequest {
@JsonProperty("GroupName")
private List<String> groupName;
public GroupGetRequest() {
public GroupGetRequest(String fromAccount, Integer lastSequence) {
this(fromAccount, null, lastSequence, null);
}
public GroupGetRequest(String fromAccount, String needFriend, Integer lastSequence, List<String> groupName) {
......
......@@ -18,7 +18,8 @@ public class GroupMsgGetSimpleRequest extends GenericRequest {
@JsonProperty("ReqMsgNumber")
private Integer reqMsgNumber;
public GroupMsgGetSimpleRequest() {
public GroupMsgGetSimpleRequest(String groupId, Integer reqMsgSeq) {
this(groupId, reqMsgSeq, null);
}
public GroupMsgGetSimpleRequest(String groupId, Integer reqMsgSeq, Integer reqMsgNumber) {
......@@ -50,13 +51,4 @@ public class GroupMsgGetSimpleRequest extends GenericRequest {
public void setReqMsgNumber(Integer reqMsgNumber) {
this.reqMsgNumber = reqMsgNumber;
}
@Override
public String toString() {
return "GroupMsgGetSimpleRequest{" +
"groupId='" + groupId + '\'' +
", reqMsgSeq=" + reqMsgSeq +
", reqMsgNumber=" + reqMsgNumber +
'}';
}
}
......@@ -11,7 +11,7 @@ import java.util.List;
* @since 2021/8/4 15:23
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ImportGroupMsgListItem {
public class GroupMsgItem {
@JsonProperty("From_Account")
private String fromAccount;
......@@ -24,10 +24,11 @@ public class ImportGroupMsgListItem {
@JsonProperty("MsgBody")
private List<TIMMsgElement> msgBody;
public ImportGroupMsgListItem() {
public GroupMsgItem(String fromAccount, Integer sendTime) {
this(fromAccount, sendTime, null, null);
}
public ImportGroupMsgListItem(String fromAccount, Integer sendTime, Integer random, List<TIMMsgElement> msgBody) {
public GroupMsgItem(String fromAccount, Integer sendTime, Integer random, List<TIMMsgElement> msgBody) {
this.fromAccount = fromAccount;
this.sendTime = sendTime;
this.random = random;
......
......@@ -17,9 +17,6 @@ public class GroupMsgRecallRequest extends GenericRequest {
@JsonProperty("MsgSeqList")
private List<MsgSeqItem> msgSeqList;
public GroupMsgRecallRequest() {
}
public GroupMsgRecallRequest(String groupId, List<MsgSeqItem> msgSeqList) {
this.groupId = groupId;
this.msgSeqList = msgSeqList;
......
......@@ -15,6 +15,10 @@ public class IMAddTagRequest extends GenericRequest {
@JsonProperty("UserTags")
private List<UserTagItem> userTags;
public IMAddTagRequest(List<UserTagItem> userTags) {
this.userTags = userTags;
}
public List<UserTagItem> getUserTags() {
return userTags;
}
......
package io.github.doocs.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author bingo
......@@ -8,5 +11,18 @@ import com.fasterxml.jackson.annotation.JsonInclude;
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class IMGetAttrNameRequest extends GenericRequest {
@JsonProperty("To_Account")
private List<String> toAccount;
public IMGetAttrNameRequest(List<String> toAccount) {
this.toAccount = toAccount;
}
public List<String> getToAccount() {
return toAccount;
}
public void setToAccount(List<String> toAccount) {
this.toAccount = toAccount;
}
}
package io.github.doocs.im.model.request;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* @author bingo
......@@ -11,14 +8,5 @@ import java.util.List;
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class IMGetAttrRequest extends GenericRequest {
@JsonProperty("To_Account")
private List<String> toAccount;
public List<String> getToAccount() {
return toAccount;
}
public void setToAccount(List<String> toAccount) {
this.toAccount = toAccount;
}
}
......@@ -14,6 +14,10 @@ public class IMGetTagRequest extends GenericRequest {
@JsonProperty("To_Account")
private List<String> toAccount;
public IMGetTagRequest(List<String> toAccount) {
this.toAccount = toAccount;
}
public List<String> getToAccount() {
return toAccount;
}
......
......@@ -31,7 +31,8 @@ public class IMPushRequest extends GenericRequest {
@JsonProperty("OfflinePushInfo")
private OfflinePushInfo offlinePushInfo;
public IMPushRequest() {
public IMPushRequest(Integer msgRandom, List<TIMMsgElement> msgBody) {
this(null, msgRandom, msgBody, null, null, null);
}
public IMPushRequest(Map<String, Object> condition, Integer msgRandom, List<TIMMsgElement> msgBody, Integer msgLifeTime, String fromAccount, OfflinePushInfo offlinePushInfo) {
......
......@@ -14,6 +14,10 @@ public class IMRemoveAllTagsRequest extends GenericRequest {
@JsonProperty("To_Account")
private List<String> toAccount;
public IMRemoveAllTagsRequest(List<String> toAccount) {
this.toAccount = toAccount;
}
public List<String> getToAccount() {
return toAccount;
}
......
......@@ -15,6 +15,10 @@ public class IMRemoveAttrRequest extends GenericRequest {
@JsonProperty("UserAttrs")
private List<UserAttrItem> userAttrs;
public IMRemoveAttrRequest(List<UserAttrItem> userAttrs) {
this.userAttrs = userAttrs;
}
public List<UserAttrItem> getUserAttrs() {
return userAttrs;
}
......
......@@ -15,6 +15,10 @@ public class IMRemoveTagRequest extends GenericRequest {
@JsonProperty("UserTags")
private List<UserTagItem> userTags;
public IMRemoveTagRequest(List<UserTagItem> userTags) {
this.userTags = userTags;
}
public List<UserTagItem> getUserTags() {
return userTags;
}
......
......@@ -14,6 +14,10 @@ public class IMSetAttrNameRequest extends GenericRequest {
@JsonProperty("AttrNames")
private Map<String, String> attrNames;
public IMSetAttrNameRequest(Map<String, String> attrNames) {
this.attrNames = attrNames;
}
public Map<String, String> getAttrNames() {
return attrNames;
}
......
......@@ -15,6 +15,10 @@ public class IMSetAttrRequest extends GenericRequest {
@JsonProperty("UserAttrs")
List<UserAttrItem> userAttrs;
public IMSetAttrRequest(List<UserAttrItem> userAttrs) {
this.userAttrs = userAttrs;
}
public List<UserAttrItem> getUserAttrs() {
return userAttrs;
}
......
......@@ -35,10 +35,12 @@ public class ImportFriendItem {
@JsonProperty("CustomItem")
private List<CustomItem> customItemList;
public ImportFriendItem() {
public ImportFriendItem(String toAccount) {
this(toAccount, null, null, null, null, null, null, null);
}
public ImportFriendItem(String toAccount, String remark, Integer remarkTime, List<String> groupName, String addSource, String addWording, Integer addTime, List<CustomItem> customItemList) {
public ImportFriendItem(String toAccount, String remark, Integer remarkTime, List<String> groupName,
String addSource, String addWording, Integer addTime, List<CustomItem> customItemList) {
this.toAccount = toAccount;
this.remark = remark;
this.remarkTime = remarkTime;
......
......@@ -17,9 +17,6 @@ public class ImportGroupMemberRequest extends GenericRequest {
@JsonProperty("MemberList")
private List<MemberItem> memberList;
public ImportGroupMemberRequest() {
}
public ImportGroupMemberRequest(String groupId, List<MemberItem> memberList) {
this.groupId = groupId;
this.memberList = memberList;
......
......@@ -14,8 +14,21 @@ public class ImportGroupMsgRequest extends GenericRequest {
@JsonProperty("GroupId")
private String groupId;
@JsonProperty("RecentContactFlag")
private Integer recentContactFlag;
@JsonProperty("MsgList")
private List<ImportGroupMsgListItem> msgList;
private List<GroupMsgItem> msgList;
public ImportGroupMsgRequest(String groupId, List<GroupMsgItem> msgList) {
this(groupId, null, msgList);
}
public ImportGroupMsgRequest(String groupId, Integer recentContactFlag, List<GroupMsgItem> msgList) {
this.groupId = groupId;
this.recentContactFlag = recentContactFlag;
this.msgList = msgList;
}
public String getGroupId() {
return groupId;
......@@ -25,11 +38,19 @@ public class ImportGroupMsgRequest extends GenericRequest {
this.groupId = groupId;
}
public List<ImportGroupMsgListItem> getMsgList() {
public Integer getRecentContactFlag() {
return recentContactFlag;
}
public void setRecentContactFlag(Integer recentContactFlag) {
this.recentContactFlag = recentContactFlag;
}
public List<GroupMsgItem> getMsgList() {
return msgList;
}
public void setMsgList(List<ImportGroupMsgListItem> msgList) {
public void setMsgList(List<GroupMsgItem> msgList) {
this.msgList = msgList;
}
}
......@@ -45,7 +45,9 @@ public class ImportGroupRequest extends GenericRequest {
@JsonProperty("AppDefinedData")
private List<Map<String, Object>> appDefinedData;
public ImportGroupRequest() {
public ImportGroupRequest(String type, String name) {
this.type = type;
this.name = name;
}
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) {
......
......@@ -36,10 +36,14 @@ public class ImportMsgRequest extends GenericRequest {
@JsonProperty("CloudCustomData")
private String cloudCustomData;
public ImportMsgRequest() {
public ImportMsgRequest(Integer syncFromOldSystem, String fromAccount, String toAccount,
Integer msgRandom, Integer msgTimeStamp, List<TIMMsgElement> msgBody) {
this(syncFromOldSystem, fromAccount, toAccount, null, msgRandom, msgTimeStamp, msgBody, null);
}
public ImportMsgRequest(Integer syncFromOldSystem, String fromAccount, String toAccount, Integer msgSeq, Integer msgRandom, Integer msgTimeStamp, List<TIMMsgElement> msgBody, String cloudCustomData) {
public ImportMsgRequest(Integer syncFromOldSystem, String fromAccount, String toAccount,
Integer msgSeq, Integer msgRandom, Integer msgTimeStamp,
List<TIMMsgElement> msgBody, String cloudCustomData) {
this.syncFromOldSystem = syncFromOldSystem;
this.fromAccount = fromAccount;
this.toAccount = toAccount;
......
......@@ -12,6 +12,10 @@ public class KickRequest extends GenericRequest {
@JsonProperty("Identifier")
private String identifier;
public KickRequest(String identifier) {
this.identifier = identifier;
}
public String getIdentifier() {
return identifier;
}
......
......@@ -21,7 +21,8 @@ public class MemberItem {
@JsonProperty("UnreadMsgNum")
private Integer unreadMsgNum;
public MemberItem() {
public MemberItem(String memberAccount) {
this.memberAccount = memberAccount;
}
public MemberItem(String memberAccount, String role, Integer joinTime, Integer unreadMsgNum) {
......
......@@ -12,9 +12,6 @@ public class MemberRequestItem {
@JsonProperty("Member_Account")
private String memberAccount;
public MemberRequestItem() {
}
public MemberRequestItem(String memberAccount) {
this.memberAccount = memberAccount;
}
......
......@@ -39,7 +39,8 @@ public class ModifyGroupBaseInfoRequest extends GenericRequest {
@JsonProperty("AppDefinedData")
private List<Map<String, Object>> appDefinedData;
public ModifyGroupBaseInfoRequest() {
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) {
......
......@@ -33,7 +33,8 @@ public class ModifyGroupMemberInfoRequest extends GenericRequest {
@JsonProperty("ShutUpTime")
private Integer shutUpTime;
public ModifyGroupMemberInfoRequest() {
public ModifyGroupMemberInfoRequest(String groupId, String memberAccount) {
this(groupId, memberAccount, null, null, null, null, null);
}
public ModifyGroupMemberInfoRequest(String groupId, String memberAccount, String role, String msgFlag, String nameCard, List<Map<String, Object>> appMemberDefinedData, Integer shutUpTime) {
......
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.message.TIMMsgElement;
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<TIMMsgElement> msgBody;
public MsgGroupItem() {
}
public MsgGroupItem(String fromAccount, Integer sendTime, Integer random, List<TIMMsgElement> 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<TIMMsgElement> getMsgBody() {
return msgBody;
}
public void setMsgBody(List<TIMMsgElement> msgBody) {
this.msgBody = msgBody;
}
}
This diff is collapsed.
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