diff --git a/broker/src/main/java/io/moquette/imhandler/UserSearchHandler.java b/broker/src/main/java/io/moquette/imhandler/UserSearchHandler.java index 1cb30da1..e0310637 100644 --- a/broker/src/main/java/io/moquette/imhandler/UserSearchHandler.java +++ b/broker/src/main/java/io/moquette/imhandler/UserSearchHandler.java @@ -21,7 +21,7 @@ import java.util.List; public class UserSearchHandler extends IMHandler { @Override public ErrorCode action(ByteBuf ackPayload, String clientID, String fromUser, ProtoConstants.RequestSourceType requestSourceType, WFCMessage.SearchUserRequest request, Qos1PublishHandler.IMCallback callback) { - List users = m_messagesStore.searchUser(request.getKeyword(), request.getFuzzy(), request.getPage()); + List users = m_messagesStore.searchUser(request.getKeyword(), request.getFuzzy(), request.getType(), request.getPage()); WFCMessage.SearchUserResult.Builder builder = WFCMessage.SearchUserResult.newBuilder(); builder.addAllEntry(users); byte[] data = builder.build().toByteArray(); diff --git a/broker/src/main/java/io/moquette/persistence/DatabaseStore.java b/broker/src/main/java/io/moquette/persistence/DatabaseStore.java index ae51aad1..01e85728 100644 --- a/broker/src/main/java/io/moquette/persistence/DatabaseStore.java +++ b/broker/src/main/java/io/moquette/persistence/DatabaseStore.java @@ -36,6 +36,8 @@ import java.util.function.Function; import static cn.wildfirechat.common.IMExceptionEvent.EventType.RDBS_Exception; import static cn.wildfirechat.proto.ProtoConstants.PersistFlag.Transparent; +import static cn.wildfirechat.proto.ProtoConstants.UserSearchUserType.UserSearchUserType_ONLY_ROBOT; +import static cn.wildfirechat.proto.ProtoConstants.UserSearchUserType.UserSearchUserType_ONLY_USER; import static io.moquette.BrokerConstants.GROUP_INFO_MARK_DELETION; import static io.moquette.server.Constants.MAX_MESSAGE_QUEUE; import static cn.wildfirechat.proto.ProtoConstants.SearchUserType.*; @@ -169,7 +171,7 @@ public class DatabaseStore { return null; } - List searchUserByNameMobileUserId(String keyword, int searchType) { + List searchUserByNameMobileUserId(String keyword, int searchType, int userType) { ArrayList out = new ArrayList<>(); Connection connection = null; PreparedStatement statement = null; @@ -203,7 +205,15 @@ public class DatabaseStore { sql += " where (`_name` = ? or `_mobile` = ? or `_uid` = ?) "; } - sql += " and `_type` <> 2 and `_deleted` = 0"; //can search normal user(0) and robot(1) and admin(100), can not search things + if(userType == UserSearchUserType_ONLY_USER) { + sql += " and _type <> 2 "; //can not search device + sql += " and _type <> 1 "; + } else if(userType == UserSearchUserType_ONLY_ROBOT) { + sql += " and _type = 1 "; + } else { + sql += " and _type <> 2 "; //can not search device + } + sql += " and _deleted = 0 "; if(searchType == SearchUserType_Name || searchType == SearchUserType_Mobile || searchType == SearchUserType_UserId) { sql += " limit 1"; @@ -408,7 +418,7 @@ public class DatabaseStore { return out; } - List searchUserByDisplayName(String keyword, int page, List nameOrIdMatched) { + List searchUserByDisplayName(String keyword, int userType, int page, List nameOrIdMatched) { Connection connection = null; PreparedStatement statement = null; ResultSet rs = null; @@ -419,7 +429,18 @@ public class DatabaseStore { connection = DBUtil.getConnection(); String sql = "select u._uid, u._name, u._display_name, u._portrait, u._mobile, u._gender, u._email, u._address, u._company, u._social, u._extra, u._dt, u._type " + " from t_user u left join (select _uid, _value from t_user_setting where _scope = 27) s on u._uid = s._uid " + - " where u._display_name like ? ESCAPE '!' and u._type <> 2 and u._deleted = 0 "; + " where u._display_name like ? ESCAPE '!' "; + + if(userType == UserSearchUserType_ONLY_USER) { + sql += " and u._type <> 2 "; + sql += " and u._type <> 1 "; + } else if(userType == UserSearchUserType_ONLY_ROBOT) { + sql += " and u._type = 1 "; + } else { + sql += " and u._type <> 2 "; + } + sql += " and u._deleted = 0 "; + if(nameOrIdMatched.size() == 1) { sql += " and u._uid <> ? and u._name <> ?"; } else if(nameOrIdMatched.size() == 2) { @@ -523,15 +544,15 @@ public class DatabaseStore { return out; } - List searchUserFromDB(String keyword, int searchType, int page) { - List nameOrIdMatched = searchUserByNameMobileUserId(keyword, searchType); + List searchUserFromDB(String keyword, int searchType, int userType, int page) { + List nameOrIdMatched = searchUserByNameMobileUserId(keyword, searchType, userType); List out = new ArrayList<>(); if(page == 0) { out.addAll(nameOrIdMatched); } if(searchType == SearchUserType_General || searchType == SearchUserType_Name_Mobile_DisplayName) { - List general = searchUserByDisplayName(keyword, page, nameOrIdMatched); + List general = searchUserByDisplayName(keyword, userType, page, nameOrIdMatched); general.removeAll(nameOrIdMatched); out.addAll(general); } diff --git a/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java b/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java index b5468025..93ec9906 100755 --- a/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java +++ b/broker/src/main/java/io/moquette/persistence/MemoryMessagesStore.java @@ -3109,7 +3109,7 @@ public class MemoryMessagesStore implements IMessagesStore { } @Override - public List searchUser(String keyword, int searchType, int page) { + public List searchUser(String keyword, int searchType, int userType, int page) { if (mDisableSearch) { return new ArrayList<>(); } @@ -3130,7 +3130,7 @@ public class MemoryMessagesStore implements IMessagesStore { return new ArrayList<>(); } - return databaseStore.searchUserFromDB(keyword, searchType, page); + return databaseStore.searchUserFromDB(keyword, searchType, userType, page); } @Override diff --git a/broker/src/main/java/io/moquette/spi/IMessagesStore.java b/broker/src/main/java/io/moquette/spi/IMessagesStore.java index 0bc62aac..4a451404 100755 --- a/broker/src/main/java/io/moquette/spi/IMessagesStore.java +++ b/broker/src/main/java/io/moquette/spi/IMessagesStore.java @@ -154,7 +154,7 @@ public interface IMessagesStore { WFCMessage.User getUserInfoByName(String name); WFCMessage.User getUserInfoByMobile(String mobile); List getUserInfosByEmail(String email); - List searchUser(String keyword, int searchType, int page); + List searchUser(String keyword, int searchType, int userType, int page); List getUserInfoList(int count, int offset); diff --git a/common/src/main/java/cn/wildfirechat/pojos/mesh/PojoSearchUserReq.java b/common/src/main/java/cn/wildfirechat/pojos/mesh/PojoSearchUserReq.java index aaec73e8..8b7492c5 100644 --- a/common/src/main/java/cn/wildfirechat/pojos/mesh/PojoSearchUserReq.java +++ b/common/src/main/java/cn/wildfirechat/pojos/mesh/PojoSearchUserReq.java @@ -3,6 +3,7 @@ package cn.wildfirechat.pojos.mesh; public class PojoSearchUserReq { public String keyword; public int searchType; + public int userType; public int page; public String domainId; @@ -22,6 +23,14 @@ public class PojoSearchUserReq { this.searchType = searchType; } + public int getUserType() { + return userType; + } + + public void setUserType(int userType) { + this.userType = userType; + } + public int getPage() { return page; } diff --git a/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java b/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java index 2fff6520..c98bce9f 100644 --- a/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java +++ b/common/src/main/java/cn/wildfirechat/proto/ProtoConstants.java @@ -238,6 +238,12 @@ public class ProtoConstants { int SearchUserType_Name_Mobile_DisplayName = 100; } + public interface UserSearchUserType { + int UserSearchUserType_ALL = 0; + int UserSearchUserType_ONLY_USER = 1; + int UserSearchUserType_ONLY_ROBOT = 2; + } + public interface DisableSearchMask { int DisableSearchDisplayNameMask = 1; int DisableSearchNameMask = 2; diff --git a/common/src/main/java/cn/wildfirechat/proto/WFCMessage.java b/common/src/main/java/cn/wildfirechat/proto/WFCMessage.java index 13dceec6..f4c6ddfc 100644 --- a/common/src/main/java/cn/wildfirechat/proto/WFCMessage.java +++ b/common/src/main/java/cn/wildfirechat/proto/WFCMessage.java @@ -54041,6 +54041,31 @@ public final class WFCMessage { * optional int32 page = 3; */ int getPage(); + + // optional string domain_id = 4; + /** + * optional string domain_id = 4; + */ + boolean hasDomainId(); + /** + * optional string domain_id = 4; + */ + java.lang.String getDomainId(); + /** + * optional string domain_id = 4; + */ + com.google.protobuf.ByteString + getDomainIdBytes(); + + // optional int32 type = 5; + /** + * optional int32 type = 5; + */ + boolean hasType(); + /** + * optional int32 type = 5; + */ + int getType(); } /** * Protobuf type {@code SearchUserRequest} @@ -54108,6 +54133,16 @@ public final class WFCMessage { page_ = input.readInt32(); break; } + case 34: { + bitField0_ |= 0x00000008; + domainId_ = input.readBytes(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + type_ = input.readInt32(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -54223,10 +54258,71 @@ public final class WFCMessage { return page_; } + // optional string domain_id = 4; + public static final int DOMAIN_ID_FIELD_NUMBER = 4; + private java.lang.Object domainId_; + /** + * optional string domain_id = 4; + */ + public boolean hasDomainId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string domain_id = 4; + */ + public java.lang.String getDomainId() { + java.lang.Object ref = domainId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + domainId_ = s; + } + return s; + } + } + /** + * optional string domain_id = 4; + */ + public com.google.protobuf.ByteString + getDomainIdBytes() { + java.lang.Object ref = domainId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + domainId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // optional int32 type = 5; + public static final int TYPE_FIELD_NUMBER = 5; + private int type_; + /** + * optional int32 type = 5; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 type = 5; + */ + public int getType() { + return type_; + } + private void initFields() { keyword_ = ""; fuzzy_ = 0; page_ = 0; + domainId_ = ""; + type_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -54253,6 +54349,12 @@ public final class WFCMessage { if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt32(3, page_); } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, getDomainIdBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeInt32(5, type_); + } getUnknownFields().writeTo(output); } @@ -54274,6 +54376,14 @@ public final class WFCMessage { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, page_); } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, getDomainIdBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, type_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -54396,6 +54506,10 @@ public final class WFCMessage { bitField0_ = (bitField0_ & ~0x00000002); page_ = 0; bitField0_ = (bitField0_ & ~0x00000004); + domainId_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + type_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); return this; } @@ -54436,6 +54550,14 @@ public final class WFCMessage { to_bitField0_ |= 0x00000004; } result.page_ = page_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.domainId_ = domainId_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.type_ = type_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -54463,6 +54585,14 @@ public final class WFCMessage { if (other.hasPage()) { setPage(other.getPage()); } + if (other.hasDomainId()) { + bitField0_ |= 0x00000008; + domainId_ = other.domainId_; + onChanged(); + } + if (other.hasType()) { + setType(other.getType()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -54634,6 +54764,113 @@ public final class WFCMessage { return this; } + // optional string domain_id = 4; + private java.lang.Object domainId_ = ""; + /** + * optional string domain_id = 4; + */ + public boolean hasDomainId() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string domain_id = 4; + */ + public java.lang.String getDomainId() { + java.lang.Object ref = domainId_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + domainId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string domain_id = 4; + */ + public com.google.protobuf.ByteString + getDomainIdBytes() { + java.lang.Object ref = domainId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + domainId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string domain_id = 4; + */ + public Builder setDomainId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + domainId_ = value; + onChanged(); + return this; + } + /** + * optional string domain_id = 4; + */ + public Builder clearDomainId() { + bitField0_ = (bitField0_ & ~0x00000008); + domainId_ = getDefaultInstance().getDomainId(); + onChanged(); + return this; + } + /** + * optional string domain_id = 4; + */ + public Builder setDomainIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + domainId_ = value; + onChanged(); + return this; + } + + // optional int32 type = 5; + private int type_ ; + /** + * optional int32 type = 5; + */ + public boolean hasType() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional int32 type = 5; + */ + public int getType() { + return type_; + } + /** + * optional int32 type = 5; + */ + public Builder setType(int value) { + bitField0_ |= 0x00000010; + type_ = value; + onChanged(); + return this; + } + /** + * optional int32 type = 5; + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000010); + type_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:SearchUserRequest) } @@ -67604,44 +67841,45 @@ public final class WFCMessage { "ead\030\004 \001(\003\022\021\n\tnode_addr\030\005 \001(\t\022\021\n\tnode_por" + "t\030\006 \001(\005\022\023\n\013server_time\030\007 \001(\003\"P\n\rIMHttpWr", "apper\022\r\n\005token\030\001 \002(\t\022\021\n\tclient_id\030\002 \002(\t\022" + - "\017\n\007request\030\003 \002(\t\022\014\n\004data\030\004 \001(\014\"A\n\021Search" + + "\017\n\007request\030\003 \002(\t\022\014\n\004data\030\004 \001(\014\"b\n\021Search" + "UserRequest\022\017\n\007keyword\030\001 \002(\t\022\r\n\005fuzzy\030\002 " + - "\001(\005\022\014\n\004page\030\003 \001(\005\"(\n\020SearchUserResult\022\024\n" + - "\005entry\030\001 \003(\0132\005.User\"@\n\026GetChatroomInfoRe" + - "quest\022\023\n\013chatroom_id\030\001 \002(\t\022\021\n\tupdate_dt\030" + - "\002 \001(\003\"\227\001\n\014ChatroomInfo\022\r\n\005title\030\001 \002(\t\022\014\n" + - "\004desc\030\002 \001(\t\022\020\n\010portrait\030\003 \001(\t\022\024\n\014member_" + - "count\030\004 \001(\005\022\021\n\tcreate_dt\030\005 \001(\003\022\021\n\tupdate" + - "_dt\030\006 \001(\003\022\r\n\005extra\030\007 \001(\t\022\r\n\005state\030\010 \001(\005\"", - "F\n\034GetChatroomMemberInfoRequest\022\023\n\013chatr" + - "oom_id\030\001 \002(\t\022\021\n\tmax_count\030\002 \001(\005\";\n\022Chatr" + - "oomMemberInfo\022\024\n\014member_count\030\001 \001(\005\022\017\n\007m" + - "embers\030\002 \003(\t\"\026\n\010INT64Buf\022\n\n\002id\030\001 \002(\003\"4\n\023" + - "NotifyRecallMessage\022\n\n\002id\030\001 \002(\003\022\021\n\tfrom_" + - "user\030\002 \002(\t\"/\n\020BlackUserRequest\022\013\n\003uid\030\001 " + - "\002(\t\022\016\n\006status\030\002 \002(\005\"\323\001\n\014RouteRequest\022\013\n\003" + - "app\030\001 \001(\t\022\020\n\010platform\030\002 \001(\005\022\021\n\tpush_type" + - "\030\003 \001(\005\022\023\n\013device_name\030\004 \001(\t\022\026\n\016device_ve" + - "rsion\030\005 \001(\t\022\022\n\nphone_name\030\006 \001(\t\022\020\n\010langu", - "age\030\007 \001(\t\022\024\n\014carrier_name\030\010 \001(\t\022\023\n\013app_v" + - "ersion\030\t \001(\t\022\023\n\013sdk_version\030\n \001(\t\"D\n\rRou" + - "teResponse\022\014\n\004host\030\001 \002(\t\022\021\n\tlong_port\030\002 " + - "\002(\005\022\022\n\nshort_port\030\003 \002(\005\"G\n\017GetTokenReque" + - "st\022\017\n\007user_id\030\001 \002(\t\022\021\n\tclient_id\030\002 \002(\t\022\020" + - "\n\010platform\030\003 \001(\005\"r\n\022LoadRemoteMessages\022#" + - "\n\014conversation\030\001 \002(\0132\r.Conversation\022\022\n\nb" + - "efore_uid\030\002 \002(\003\022\r\n\005count\030\003 \002(\005\022\024\n\014conten" + - "t_type\030\004 \003(\005\"a\n\020MultiCastMessage\022\021\n\tfrom" + - "_user\030\001 \002(\t\022 \n\007content\030\002 \002(\0132\017.MessageCo", - "ntent\022\n\n\002to\030\003 \003(\t\022\014\n\004line\030\004 \002(\005\"E\n\035Recal" + - "lMultiCastMessageRequest\022\022\n\nmessage_id\030\001" + - " \002(\003\022\020\n\010receiver\030\002 \003(\t\"@\n\017AuthCodeReques" + - "t\022\021\n\ttarget_id\030\001 \002(\t\022\014\n\004type\030\002 \002(\005\022\014\n\004ho" + - "st\030\003 \002(\t\"o\n\030ApplicationConfigRequest\022\r\n\005" + - "appId\030\001 \002(\t\022\017\n\007appType\030\002 \002(\005\022\021\n\ttimestam" + - "p\030\003 \002(\003\022\r\n\005nonce\030\004 \002(\t\022\021\n\tsignature\030\005 \002(" + - "\tB/\n\025cn.wildfirechat.protoB\nWFCMessageZ\n" + - "./go;proto" + "\001(\005\022\014\n\004page\030\003 \001(\005\022\021\n\tdomain_id\030\004 \001(\t\022\014\n\004" + + "type\030\005 \001(\005\"(\n\020SearchUserResult\022\024\n\005entry\030" + + "\001 \003(\0132\005.User\"@\n\026GetChatroomInfoRequest\022\023" + + "\n\013chatroom_id\030\001 \002(\t\022\021\n\tupdate_dt\030\002 \001(\003\"\227" + + "\001\n\014ChatroomInfo\022\r\n\005title\030\001 \002(\t\022\014\n\004desc\030\002" + + " \001(\t\022\020\n\010portrait\030\003 \001(\t\022\024\n\014member_count\030\004" + + " \001(\005\022\021\n\tcreate_dt\030\005 \001(\003\022\021\n\tupdate_dt\030\006 \001", + "(\003\022\r\n\005extra\030\007 \001(\t\022\r\n\005state\030\010 \001(\005\"F\n\034GetC" + + "hatroomMemberInfoRequest\022\023\n\013chatroom_id\030" + + "\001 \002(\t\022\021\n\tmax_count\030\002 \001(\005\";\n\022ChatroomMemb" + + "erInfo\022\024\n\014member_count\030\001 \001(\005\022\017\n\007members\030" + + "\002 \003(\t\"\026\n\010INT64Buf\022\n\n\002id\030\001 \002(\003\"4\n\023NotifyR" + + "ecallMessage\022\n\n\002id\030\001 \002(\003\022\021\n\tfrom_user\030\002 " + + "\002(\t\"/\n\020BlackUserRequest\022\013\n\003uid\030\001 \002(\t\022\016\n\006" + + "status\030\002 \002(\005\"\323\001\n\014RouteRequest\022\013\n\003app\030\001 \001" + + "(\t\022\020\n\010platform\030\002 \001(\005\022\021\n\tpush_type\030\003 \001(\005\022" + + "\023\n\013device_name\030\004 \001(\t\022\026\n\016device_version\030\005", + " \001(\t\022\022\n\nphone_name\030\006 \001(\t\022\020\n\010language\030\007 \001" + + "(\t\022\024\n\014carrier_name\030\010 \001(\t\022\023\n\013app_version\030" + + "\t \001(\t\022\023\n\013sdk_version\030\n \001(\t\"D\n\rRouteRespo" + + "nse\022\014\n\004host\030\001 \002(\t\022\021\n\tlong_port\030\002 \002(\005\022\022\n\n" + + "short_port\030\003 \002(\005\"G\n\017GetTokenRequest\022\017\n\007u" + + "ser_id\030\001 \002(\t\022\021\n\tclient_id\030\002 \002(\t\022\020\n\010platf" + + "orm\030\003 \001(\005\"r\n\022LoadRemoteMessages\022#\n\014conve" + + "rsation\030\001 \002(\0132\r.Conversation\022\022\n\nbefore_u" + + "id\030\002 \002(\003\022\r\n\005count\030\003 \002(\005\022\024\n\014content_type\030" + + "\004 \003(\005\"a\n\020MultiCastMessage\022\021\n\tfrom_user\030\001", + " \002(\t\022 \n\007content\030\002 \002(\0132\017.MessageContent\022\n" + + "\n\002to\030\003 \003(\t\022\014\n\004line\030\004 \002(\005\"E\n\035RecallMultiC" + + "astMessageRequest\022\022\n\nmessage_id\030\001 \002(\003\022\020\n" + + "\010receiver\030\002 \003(\t\"@\n\017AuthCodeRequest\022\021\n\tta" + + "rget_id\030\001 \002(\t\022\014\n\004type\030\002 \002(\005\022\014\n\004host\030\003 \002(" + + "\t\"o\n\030ApplicationConfigRequest\022\r\n\005appId\030\001" + + " \002(\t\022\017\n\007appType\030\002 \002(\005\022\021\n\ttimestamp\030\003 \002(\003" + + "\022\r\n\005nonce\030\004 \002(\t\022\021\n\tsignature\030\005 \002(\tB/\n\025cn" + + ".wildfirechat.protoB\nWFCMessageZ\n./go;pr" + + "oto" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -68007,7 +68245,7 @@ public final class WFCMessage { internal_static_SearchUserRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_SearchUserRequest_descriptor, - new java.lang.String[] { "Keyword", "Fuzzy", "Page", }); + new java.lang.String[] { "Keyword", "Fuzzy", "Page", "DomainId", "Type", }); internal_static_SearchUserResult_descriptor = getDescriptor().getMessageTypes().get(60); internal_static_SearchUserResult_fieldAccessorTable = new diff --git a/sdk/src/main/java/cn/wildfirechat/sdk/MeshAdmin.java b/sdk/src/main/java/cn/wildfirechat/sdk/MeshAdmin.java index 6725856d..9177302e 100644 --- a/sdk/src/main/java/cn/wildfirechat/sdk/MeshAdmin.java +++ b/sdk/src/main/java/cn/wildfirechat/sdk/MeshAdmin.java @@ -39,12 +39,13 @@ public class MeshAdmin { return AdminHttpUtils.httpJsonPost(path, getUserInfo, OutputUserInfoList.class); } - public static IMResult searchUser(String keyword, int searchType, int page) throws Exception { + public static IMResult searchUser(String keyword, int searchType, int userType, int page) throws Exception { String path = APIPath.Search_User; PojoSearchUserReq req = new PojoSearchUserReq(); req.keyword = keyword; req.searchType = searchType; req.page = page; + req.userType = userType; return AdminHttpUtils.httpJsonPost(path, req, PojoSearchUserRes.class); }