diff --git a/.gitignore b/.gitignore index 3d19cc7b8..3390267f4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,19 @@ logs components logs out-test +.github +.idea - +deploy/open_im_demo +deploy/open_im_api +deploy/open_im_msg_gateway +deploy/open_im_msg_transfer +deploy/open_im_push +deploy/open_im_timer_task +deploy/open_im_rpc_user +deploy/open_im_rpc_friend +deploy/open_im_rpc_group +deploy/open_im_rpc_msg +deploy/open_im_rpc_auth +deploy/Open-IM-SDK-Core diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core index a85c10dbf..dd23b4b18 160000 --- a/cmd/Open-IM-SDK-Core +++ b/cmd/Open-IM-SDK-Core @@ -1 +1 @@ -Subproject commit a85c10dbffbb797b5b2091e209ff67a5534b9bfc +Subproject commit dd23b4b185a273d38e73d51990c531e37ab5ba3b diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 8bdcbcf31..eff8710e0 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -3,6 +3,7 @@ package main import ( apiAuth "Open_IM/internal/api/auth" apiChat "Open_IM/internal/api/chat" + "Open_IM/internal/api/conversation" "Open_IM/internal/api/friend" "Open_IM/internal/api/group" "Open_IM/internal/api/manage" @@ -11,93 +12,100 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/utils" "flag" - "github.com/gin-gonic/gin" "strconv" + + "github.com/gin-gonic/gin" //"syscall" ) func main() { - - //logFile, err := os.OpenFile("./fatal.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0660) - // if err != nil { - - // return - // } - //syscall.Dup2(int(logFile.Fd()), int(os.Stderr.Fd())) - - //log.Info("", "", "api server running...") + gin.SetMode(gin.ReleaseMode) r := gin.Default() r.Use(utils.CorsHandler()) // user routing group, which handles user registration and login services userRouterGroup := r.Group("/user") { - userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) - userRouterGroup.POST("/get_user_info", user.GetUserInfo) + userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1 + userRouterGroup.POST("/get_users_info", user.GetUsersInfo) //1 + userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1 } //friend routing group friendRouterGroup := r.Group("/friend") { - friendRouterGroup.POST("/get_friends_info", friend.GetFriendsInfo) - friendRouterGroup.POST("/add_friend", friend.AddFriend) - friendRouterGroup.POST("/get_friend_apply_list", friend.GetFriendApplyList) - friendRouterGroup.POST("/get_self_apply_list", friend.GetSelfApplyList) - friendRouterGroup.POST("/get_friend_list", friend.GetFriendList) - friendRouterGroup.POST("/add_blacklist", friend.AddBlacklist) - friendRouterGroup.POST("/get_blacklist", friend.GetBlacklist) - friendRouterGroup.POST("/remove_blacklist", friend.RemoveBlacklist) - friendRouterGroup.POST("/delete_friend", friend.DeleteFriend) - friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) - friendRouterGroup.POST("/set_friend_comment", friend.SetFriendComment) - friendRouterGroup.POST("/is_friend", friend.IsFriend) - friendRouterGroup.POST("/import_friend", friend.ImportFriend) + // friendRouterGroup.POST("/get_friends_info", friend.GetFriendsInfo) + friendRouterGroup.POST("/add_friend", friend.AddFriend) //1 + friendRouterGroup.POST("/delete_friend", friend.DeleteFriend) //1 + friendRouterGroup.POST("/get_friend_apply_list", friend.GetFriendApplyList) //1 + friendRouterGroup.POST("/get_self_friend_apply_list", friend.GetSelfFriendApplyList) //1 + friendRouterGroup.POST("/get_friend_list", friend.GetFriendList) //1 + friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) //1 + friendRouterGroup.POST("/set_friend_remark", friend.SetFriendRemark) //1 + + friendRouterGroup.POST("/add_black", friend.AddBlack) //1 + friendRouterGroup.POST("/get_black_list", friend.GetBlacklist) //1 + friendRouterGroup.POST("/remove_black", friend.RemoveBlack) //1 + + friendRouterGroup.POST("/import_friend", friend.ImportFriend) //1 + friendRouterGroup.POST("/is_friend", friend.IsFriend) //1 } //group related routing group groupRouterGroup := r.Group("/group") { - groupRouterGroup.POST("/create_group", group.CreateGroup) - groupRouterGroup.POST("/set_group_info", group.SetGroupInfo) - groupRouterGroup.POST("join_group", group.JoinGroup) - groupRouterGroup.POST("/quit_group", group.QuitGroup) - groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse) - groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner) - groupRouterGroup.POST("/get_group_applicationList", group.GetGroupApplicationList) - groupRouterGroup.POST("/get_groups_info", group.GetGroupsInfo) - groupRouterGroup.POST("/kick_group", group.KickGroupMember) - groupRouterGroup.POST("/get_group_member_list", group.GetGroupMemberList) - groupRouterGroup.POST("/get_group_all_member_list", group.GetGroupAllMember) - groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) - groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) - groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) + groupRouterGroup.POST("/create_group", group.CreateGroup) //1 + groupRouterGroup.POST("/set_group_info", group.SetGroupInfo) //1 + groupRouterGroup.POST("join_group", group.JoinGroup) //1 + groupRouterGroup.POST("/quit_group", group.QuitGroup) //1 + groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse) //1 + groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner) //1 + groupRouterGroup.POST("/get_recv_group_applicationList", group.GetRecvGroupApplicationList) //1 + groupRouterGroup.POST("/get_user_req_group_applicationList", group.GetUserReqGroupApplicationList) + groupRouterGroup.POST("/get_groups_info", group.GetGroupsInfo) //1 + groupRouterGroup.POST("/kick_group", group.KickGroupMember) //1 + groupRouterGroup.POST("/get_group_member_list", group.GetGroupMemberList) //no use + groupRouterGroup.POST("/get_group_all_member_list", group.GetGroupAllMemberList) //1 + groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) //1 + groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) //1 + groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) //1 } //certificate authRouterGroup := r.Group("/auth") { - authRouterGroup.POST("/user_register", apiAuth.UserRegister) - authRouterGroup.POST("/user_token", apiAuth.UserToken) + authRouterGroup.POST("/user_register", apiAuth.UserRegister) //1 + authRouterGroup.POST("/user_token", apiAuth.UserToken) //1 } //Third service thirdGroup := r.Group("/third") { thirdGroup.POST("/tencent_cloud_storage_credential", apiThird.TencentCloudStorageCredential) - thirdGroup.POST("/aliyun_cloud_storage_credential", apiThird.AliyunCloudStorageCredential) + thirdGroup.POST("/ali_oss_credential", apiThird.AliOSSCredential) + thirdGroup.POST("/minio_storage_credential", apiThird.MinioStorageCredential) } //Message - chatGroup := r.Group("/chat") + chatGroup := r.Group("/msg") { - chatGroup.POST("/newest_seq", apiChat.UserGetSeq) - chatGroup.POST("/pull_msg", apiChat.UserPullMsg) - chatGroup.POST("/send_msg", apiChat.UserSendMsg) - chatGroup.POST("/pull_msg_by_seq", apiChat.UserPullMsgBySeqList) + chatGroup.POST("/newest_seq", apiChat.GetSeq) + chatGroup.POST("/send_msg", apiChat.SendMsg) + chatGroup.POST("/pull_msg_by_seq", apiChat.PullMsgBySeqList) } //Manager managementGroup := r.Group("/manager") { - managementGroup.POST("/delete_user", manage.DeleteUser) + managementGroup.POST("/delete_user", manage.DeleteUser) //1 managementGroup.POST("/send_msg", manage.ManagementSendMsg) - managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) + managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) //1 + managementGroup.POST("/account_check", manage.AccountCheck) //1 + managementGroup.POST("/get_users_online_status", manage.GetUsersOnlineStatus) //1 } + //Conversation + conversationGroup := r.Group("/conversation") + { + conversationGroup.POST("/set_receive_message_opt", conversation.SetReceiveMessageOpt) //1 + conversationGroup.POST("/get_receive_message_opt", conversation.GetReceiveMessageOpt) //1 + conversationGroup.POST("/get_all_conversation_message_opt", conversation.GetAllConversationMessageOpt) //1 + } + apiThird.MinioInit() log.NewPrivateLog("api") ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") flag.Parse() - r.Run(utils.ServerIP + ":" + strconv.Itoa(*ginPort)) + r.Run(":" + strconv.Itoa(*ginPort)) } diff --git a/cmd/open_im_cms_api/Makefile b/cmd/open_im_cms_api/Makefile new file mode 100644 index 000000000..31304542d --- /dev/null +++ b/cmd/open_im_cms_api/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_cms_api +BIN_DIR=../../bin/ + + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi + diff --git a/cmd/open_im_cms_api/main.go b/cmd/open_im_cms_api/main.go new file mode 100644 index 000000000..df39c4672 --- /dev/null +++ b/cmd/open_im_cms_api/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "Open_IM/internal/cms_api" + "Open_IM/pkg/utils" + + "github.com/gin-gonic/gin" +) + +func main() { + gin.SetMode(gin.ReleaseMode) + router := cms_api.NewGinRouter() + router.Use(utils.CorsHandler()) + router.Run(":" + "8000") +} diff --git a/cmd/open_im_demo/Makefile b/cmd/open_im_demo/Makefile new file mode 100644 index 000000000..45829acd8 --- /dev/null +++ b/cmd/open_im_demo/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_demo +BIN_DIR=../../bin/ + + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi + diff --git a/cmd/open_im_demo/main.go b/cmd/open_im_demo/main.go new file mode 100644 index 000000000..430b0faaf --- /dev/null +++ b/cmd/open_im_demo/main.go @@ -0,0 +1,30 @@ +package main + +import ( + "Open_IM/internal/demo/register" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "flag" + "strconv" + + "github.com/gin-gonic/gin" +) + +func main() { + + r := gin.Default() + r.Use(utils.CorsHandler()) + + authRouterGroup := r.Group("/auth") + { + authRouterGroup.POST("/code", register.SendVerificationCode) + authRouterGroup.POST("/verify", register.Verify) + authRouterGroup.POST("/password", register.SetPassword) + authRouterGroup.POST("/login", register.Login) + authRouterGroup.POST("/reset_password", register.ResetPassword) + } + log.NewPrivateLog("demo") + ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port") + flag.Parse() + r.Run(":" + strconv.Itoa(*ginPort)) +} diff --git a/cmd/open_im_timer_task/main.go b/cmd/open_im_timer_task/main.go index d5cf8150c..954c41ae6 100644 --- a/cmd/open_im_timer_task/main.go +++ b/cmd/open_im_timer_task/main.go @@ -40,19 +40,19 @@ func main() { // } //} for { - uidList, err := im_mysql_model.SelectAllUID() + uidList, err := im_mysql_model.SelectAllUserID() if err != nil { - log.NewError("999999", err.Error()) + //log.NewError("999999", err.Error()) } else { for _, v := range uidList { minSeq, err := commonDB.DB.GetMinSeqFromMongo(v) if err != nil { - log.NewError("999999", "get user minSeq err", err.Error(), v) + //log.NewError("999999", "get user minSeq err", err.Error(), v) continue } else { err := commonDB.DB.SetUserMinSeq(v, minSeq) if err != nil { - log.NewError("999999", "set user minSeq err", err.Error(), v) + //log.NewError("999999", "set user minSeq err", err.Error(), v) } } time.Sleep(time.Duration(100) * time.Millisecond) diff --git a/cmd/rpc/open_im_admin_cms/Makefile b/cmd/rpc/open_im_admin_cms/Makefile new file mode 100644 index 000000000..f6efc1c08 --- /dev/null +++ b/cmd/rpc/open_im_admin_cms/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_admin_cms +BIN_DIR=../../../bin/ + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/rpc/open_im_admin_cms/main.go b/cmd/rpc/open_im_admin_cms/main.go new file mode 100644 index 000000000..eae1a4505 --- /dev/null +++ b/cmd/rpc/open_im_admin_cms/main.go @@ -0,0 +1,14 @@ +package main + +import ( + rpcMessageCMS "Open_IM/internal/rpc/admin_cms" + "flag" +) + +func main() { + rpcPort := flag.Int("port", 11000, "rpc listening port") + flag.Parse() + rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort) + rpcServer.Run() +} + diff --git a/cmd/rpc/open_im_auth/main.go b/cmd/rpc/open_im_auth/main.go index ed4656d35..110ea05c6 100644 --- a/cmd/rpc/open_im_auth/main.go +++ b/cmd/rpc/open_im_auth/main.go @@ -10,4 +10,5 @@ func main() { flag.Parse() rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort) rpcServer.Run() + } diff --git a/cmd/rpc/open_im_message_cms/Makefile b/cmd/rpc/open_im_message_cms/Makefile new file mode 100644 index 000000000..4ac4cba3a --- /dev/null +++ b/cmd/rpc/open_im_message_cms/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_message_cms +BIN_DIR=../../../bin/ + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/rpc/open_im_message_cms/main.go b/cmd/rpc/open_im_message_cms/main.go new file mode 100644 index 000000000..0980d3629 --- /dev/null +++ b/cmd/rpc/open_im_message_cms/main.go @@ -0,0 +1,13 @@ +package main + +import ( + rpcMessageCMS "Open_IM/internal/rpc/message_cms" + "flag" +) + +func main() { + rpcPort := flag.Int("port", 10900, "rpc listening port") + flag.Parse() + rpcServer := rpcMessageCMS.NewMessageCMSServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_msg/main.go b/cmd/rpc/open_im_msg/main.go index 0dffe8aaa..7344facf4 100644 --- a/cmd/rpc/open_im_msg/main.go +++ b/cmd/rpc/open_im_msg/main.go @@ -1,7 +1,7 @@ package main import ( - rpcChat "Open_IM/internal/rpc/chat" + rpcChat "Open_IM/internal/rpc/msg" "flag" ) diff --git a/cmd/rpc/open_im_statistics/Makefile b/cmd/rpc/open_im_statistics/Makefile new file mode 100644 index 000000000..37dbb3efe --- /dev/null +++ b/cmd/rpc/open_im_statistics/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_statistics +BIN_DIR=../../../bin/ + +all: gotool build + +build: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" + +run: + @go run ./ + +gotool: + go fmt ./ + go vet ./ + +install: + make build + mv ${BINARY_NAME} ${BIN_DIR} + +clean: + @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi diff --git a/cmd/rpc/open_im_statistics/main.go b/cmd/rpc/open_im_statistics/main.go new file mode 100644 index 000000000..f1f950288 --- /dev/null +++ b/cmd/rpc/open_im_statistics/main.go @@ -0,0 +1,13 @@ +package main + +import ( + "Open_IM/internal/rpc/statistics" + "flag" +) + +func main() { + rpcPort := flag.Int("port", 10800, "rpc listening port") + flag.Parse() + rpcServer := statistics.NewStatisticsServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/test/main.go b/cmd/test/main.go new file mode 100644 index 000000000..87d5165f7 --- /dev/null +++ b/cmd/test/main.go @@ -0,0 +1,69 @@ +package main + +import ( + "Open_IM/pkg/utils" + "context" + "fmt" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "time" +) + +type MongoMsg struct { + UID string + Msg []string +} + + +func main() { + //"mongodb://%s:%s@%s/%s/?maxPoolSize=%d" + uri := "mongodb://user:pass@sample.host:27017/?maxPoolSize=20&w=majority" + DBAddress := "127.0.0.1:37017" + DBDatabase := "new-test-db" + Collection := "new-test-collection" + DBMaxPoolSize := 100 + uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", + DBAddress,DBDatabase, + DBMaxPoolSize) + + mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) + if err != nil { + panic(err) + } + filter := bson.M{"uid":"my_uid"} + ctx, _ := context.WithTimeout(context.Background(), 30*time.Second) + for i:=0; i < 2; i++{ + + if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOneAndUpdate(ctx, filter, + bson.M{"$push": bson.M{"msg": utils.Int32ToString(int32(i))}}).Err(); err != nil{ + fmt.Println("FindOneAndUpdate failed ", i, ) + var mmsg MongoMsg + mmsg.UID = "my_uid" + mmsg.Msg = append(mmsg.Msg, utils.Int32ToString(int32(i))) + _, err := mongoClient.Database(DBDatabase).Collection(Collection).InsertOne(ctx, &mmsg) + if err != nil { + fmt.Println("insertone failed ", err.Error(), i) + } else{ + fmt.Println("insertone ok ", i) + } + + }else { + fmt.Println("FindOneAndUpdate ok ", i) + } + + } + + var mmsg MongoMsg + + if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOne(ctx, filter).Decode(&mmsg); err != nil { + fmt.Println("findone failed ", err.Error()) + }else{ + fmt.Println("findone ok ", mmsg.UID) + for i, v:=range mmsg.Msg{ + fmt.Println("find value: ", i, v) + } + } + + +} diff --git a/config/config.yaml b/config/config.yaml index 0f73f6f61..aff4fd24d 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,47 +1,48 @@ # The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. -serverversion: 1.0.3 +serverversion: 2.0.0 #---------------Infrastructure configuration---------------------# etcd: - etcdSchema: openIM - etcdAddr: [ 127.0.0.1:2379 ] + etcdSchema: openIM #默认即可 + etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可 mysql: - dbMysqlAddress: [ 127.0.0.1:13306 ] - dbMysqlUserName: root - dbMysqlPassword: openIM - dbMysqlDatabaseName: openIM - dbTableName: eMsg + dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可 + dbMysqlUserName: root #mysql用户名,建议修改 + dbMysqlPassword: openIM # mysql密码,建议修改 + dbMysqlDatabaseName: openIM_v2 #默认即可 + dbTableName: eMsg #默认即可 dbMsgTableNum: 1 dbMaxOpenConns: 20 dbMaxIdleConns: 10 dbMaxLifeTime: 120 mongo: - dbAddress: [ 127.0.0.1:37017 ] + dbUri: ""#当dbUri值不为空则直接使用该值 + dbAddress: [ 127.0.0.1:37017 ] #mongo地址 目前仅支持单机,默认即可 dbDirect: false dbTimeout: 10 - dbDatabase: openIM + dbDatabase: openIM #mongo db 默认即可 dbSource: admin - dbUserName: - dbPassword: + dbUserName: #mongo用户名,建议先不设置 + dbPassword: #mongo密码,建议先不设置 dbMaxPoolSize: 20 - dbRetainChatRecords: 7 + dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改 redis: - dbAddress: 127.0.0.1:16379 + dbAddress: 127.0.0.1:16379 #redis地址 目前仅支持单机,默认即可 dbMaxIdle: 128 dbMaxActive: 0 dbIdleTimeout: 120 - dbPassWord: openIM + dbPassWord: openIM #redis密码 建议修改 kafka: ws2mschat: - addr: [ 127.0.0.1:9092 ] + addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 topic: "ws2ms_chat" ms2pschat: - addr: [ 127.0.0.1:9092 ] + addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 topic: "ms2ps_chat" consumergroupid: msgToMongo: mongo @@ -55,39 +56,80 @@ kafka: # The service ip default is empty, # automatically obtain the machine's valid network card ip as the service ip, # otherwise the configuration ip is preferred +#如果是单机模式,用0.0.0.0或者不填,默认即可 serverip: 0.0.0.0 -api: - openImApiPort: [ 10000 ] -sdk: - openImSdkWsPort: [ 30000 ] +# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问 +endpoints: + api: openim_api + cmsapi: openim_cms_api + push: openim_push + msg_gateway: openim_msg_gateway + rpc_auth: openim_rpc_auth + rpc_friend: openim_rpc_friend + rpc_group: openim_rpc_group + rpc_msg: openim_rpc_msg + rpc_user: openim_rpc_user + rpc_statistic: openim_rpc_statistic + rpc_admin_cms: openim_rpc_admin_cms + rpc_message_cms: openim_rpc_admin_cms -credential: + +api: + openImApiPort: [ 10000 ] #api服务端口,默认即可,需要开放此端口或做nginx转发 +cmsapi: + openImCmsApiPort: [ 8000 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发 +sdk: + openImSdkWsPort: [ 30000 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 + +credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 tencent: appID: 1302656840 region: ap-chengdu bucket: echat-1302656840 secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe - aliyun: - accessKeyId: - accessKeySecret: - roleArn: - regionId: - region: - bucket: + minio: #MinIO 发送图片、视频、文件时需要,请自行申请后替换,必须修改。 客户端初始化时相应改动 + bucket: openim + location: us-east-1 + endpoint: http://127.0.0.1:9000 + accessKeyID: user12345 + secretAccessKey: key12345 + ali: # ali oss + regionID: "oss-cn-beijing" + accessKeyID: "" + accessKeySecret: "" + stsEndpoint: "sts.cn-beijing.aliyun.com" + ossEndpoint: "oss-cn-beijing.aliyuncs.com" + bucket: "bucket1" + finalHost: "http://bucket1.oss-cn-beijing.aliyuncs.com" + stsDurationSeconds: 3600 + OssRoleArn: "acs:ram::xxx:role/xxx" -rpcport: + + +rpcport: #rpc服务端口 默认即可 openImUserPort: [ 10100 ] openImFriendPort: [ 10200 ] - openImOfflineMessagePort: [ 10300] + openImOfflineMessagePort: [ 10300 ] openImOnlineRelayPort: [ 10400 ] - openImGroupPort: [ 10500 ] + openImGroupPort: [ 10500 ] openImAuthPort: [ 10600 ] openImPushPort: [ 10700 ] + openImStatisticsPort: [ 10800 ] + openImMessageCmsPort: [ 10900 ] + openImAdminCmsPort: [ 11000 ] + c2c: + callbackBeforeSendMsg: + switch: false + timeoutStrategy: 1 #1:send + callbackAfterSendMsg: + switch: false + state: + stateChange: + switch: false - -rpcregistername: +rpcregistername: #rpc注册服务名,默认即可 openImUserName: User openImFriendName: Friend openImOfflineMessageName: OfflineMessage @@ -95,78 +137,380 @@ rpcregistername: openImOnlineMessageRelayName: OnlineMessageRelay openImGroupName: Group openImAuthName: Auth + OpenImStatisticsName: Statistics + OpenImMessageCMSName: MessageCMS + openImAdminCMSName: AdminCMS log: storageLocation: ../logs/ rotationTime: 24 - remainRotationCount: 5 - remainLogLevel: 6 + remainRotationCount: 3 #日志数量 + #日志级别 6表示全都打印,测试阶段建议设置为6 + remainLogLevel: 4 elasticSearchSwitch: false elasticSearchAddr: [ 127.0.0.1:9201 ] elasticSearchUser: "" elasticSearchPassword: "" -modulename: +modulename: #日志文件按模块命名,默认即可 longConnSvrName: msg_gateway msgTransferName: msg_transfer pushName: push longconnsvr: - openImWsPort: [ 17778 ] + openImWsPort: [ 17778 ] # ws服务端口,默认即可,要开放此端口或做nginx转发 websocketMaxConnNum: 10000 websocketMaxMsgLen: 4096 websocketTimeOut: 10 push: - tpns: + tpns: #腾讯推送,暂未测试 暂不要使用 ios: accessID: 1600018281 secretKey: 3cd68a77a95b89e5089a1aca523f318f android: accessID: 111 secretKey: 111 - jpns: + jpns: #极光推送 在极光后台申请后,修改以下四项,必须修改 appKey: cf47465a368f24c659608e7e masterSecret: 02204efe3f3832947a236ee5 pushUrl: "https://api.jpush.cn/v3/push" pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" manager: - appManagerUid: ["openIM123456","openIM654321"] - secrets: ["openIM1","openIM2"] + #app管理员userID和对应的secret 建议修改。 用于管理后台登录,也可以用户管理后台对应的api + appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"] + secrets: [ "openIM1","openIM2", "openIM333", "openIMAdmin"] secret: tuoyun - +# 多端互踢策略 +# 1:多平台登录:Android、iOS、Windows、Mac 每种平台只能一个在线,web端可以多个同时在线 multiloginpolicy: 1 #token config tokenpolicy: - accessSecret: "open_im_server" + accessSecret: "open_im_server" #token生成相关,默认即可 # Token effective time day as a unit - accessExpire: 7 + accessExpire: 3650 #token过期时间(天) 默认即可 +messageverify: + friendVerify: false +# c2c: +# callbackBeforeSendMsg: +# switch: false +# timeoutStrategy: 1 #1:send +# callbackAfterSendMsg: +# switch: false +# state: +# stateChange: +# switch: false +#ios系统推送声音以及标记计数 +iospush: + pushSound: "xxx" + badgeCount: true + +callback: + # callback url 需要自行更换callback url + callbackUrl : "http://127.0.0.1:8080/callback" + # 开启关闭操作前后回调的配置 + callbackbeforeSendSingleMsg: + enable: false # 回调是否启用 + callbackTimeOut: 2 # 回调超时时间 + CallbackFailedContinue: true # 回调超时是否继续执行代码 + callbackAfterSendSingleMsg: + enable: false + callbackTimeOut: 2 + callbackBeforeSendGroupMsg: + enable: false + callbackTimeOut: 2 + CallbackFailedContinue: true + callbackAfterSendGroupMsg: + enable: false + callbackTimeOut: 2 + callbackWordFilter: + enable: false + callbackTimeOut: 2 + CallbackFailedContinue: true + + +notification: + groupCreated: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: true + title: "create group title" # xx create the group + desc: "create group desc" + ext: "create group ext" + defaultTips: + tips: "create the group" # xx create the group + + groupInfoSet: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupInfoSet title" + desc: "groupInfoSet desc" + ext: "groupInfoSet ext" + defaultTips: + tips: "modified the group profile" # group info changed by xx + + joinGroupApplication: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: false + title: "joinGroupApplication title" + desc: "joinGroupApplication desc" + ext: "joinGroupApplication ext" + defaultTips: + tips: "apply to join the group" # group info changed by xx + + memberQuit: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberQuit title" + desc: "memberQuit desc" + ext: "memberQuit ext" + defaultTips: + tips: "quit group chat" # group info changed by xx + + groupApplicationAccepted: + conversation: + reliabilityLevel: 2 + unreadCount: true + offlinePush: + switch: false + title: "groupApplicationAccepted title" + desc: "groupApplicationAccepted desc" + ext: "groupApplicationAccepted ext" + defaultTips: + tips: "was allowed to join the group" # group info changed by xx + + groupApplicationRejected: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: false + title: " title" + desc: " desc" + ext: " ext" + defaultTips: + tips: "was rejected into the group" # group info changed by xx + + groupOwnerTransferred: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupOwnerTransferred title" + desc: "groupOwnerTransferred desc" + ext: "groupOwnerTransferred ext" + defaultTips: + tips: "become a new group owner" # group info changed by xx + + memberKicked: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberKicked title" + desc: "memberKicked desc" + ext: "memberKicked ext" + defaultTips: + tips: "was kicked out of the group" # group info changed by xx + + memberInvited: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberInvited title" + desc: "memberInvited desc" + ext: "memberInvited ext" + defaultTips: + tips: "was invited into the group" # group info changed by xx + + memberEnter: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberEnter title" + desc: "memberEnter desc" + ext: "memberEnter ext" + defaultTips: + tips: "entered the group" # group info changed by xx + + #############################friend################################# + + friendApplicationAdded: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Somebody applies to add you as a friend" + desc: "Somebody applies to add you as a friend" + ext: "Somebody applies to add you as a friend" + defaultTips: + tips: "I applies to add you as a friend" # + + friendApplicationApproved: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Someone applies to add your friend application" + desc: "Someone applies to add your friend application" + ext: "Someone applies to add your friend application" + defaultTips: + tips: "I applies to add your friend application" # + + + friendApplicationRejected: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Someone rejected your friend application" + desc: "Someone rejected your friend application" + ext: "Someone rejected your friend application" + defaultTips: + tips: "I rejected your friend application" # + + + + + + friendAdded: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: true + title: "We have become friends" + desc: "We have become friends" + ext: "We have become friends" + defaultTips: + tips: "We have become friends" # + + + + friendDeleted: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "deleted a friend" + desc: "deleted a friend" + ext: "deleted a friend" + defaultTips: + tips: "deleted a friend" # + + + friendRemarkSet: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Your friend's profile has been changed" + desc: "Your friend's profile has been changed" + ext: "Your friend's profile has been changed" + defaultTips: + tips: "Your friend's profile has been changed" # + + + + blackAdded: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "blocked a user" + desc: "blocked a user" + ext: "blocked a user" + defaultTips: + tips: "blocked a user" # + + + blackDeleted: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Remove a blocked user" + desc: "Remove a blocked user" + ext: "Remove a blocked user" + defaultTips: + tips: "Remove a blocked user" + + #####################user######################### + userInfoUpdated: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Remove a blocked user" + desc: "Remove a blocked user" + ext: "Remove a blocked user" + defaultTips: + tips: "remove a blocked user" + + #####################conversation######################### + conversationOptUpdate: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "conversation opt update" + desc: "conversation opt update" + ext: "conversation opt update" + defaultTips: + tips: "conversation opt update" -messagecallback: - callbackSwitch: false - callbackUrl: "http://www.xxx.com/msg/judge" - #TimeOut use second as unit - callbackTimeOut: 10 #---------------demo configuration---------------------# #The following configuration items are applied to openIM Demo configuration +#是否启动demo,如果自身没有账号体系,设置为true demoswitch: true demo: + #demo对外服务端口,默认即可,需要开放此端口或做nginx转发 openImDemoPort: [ 42233 ] - alismsverify: - accessKeyId: LTAI5tJPkn4HuuePdiLdGqe71 - accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV1 - signName: OpenIM Corporation - verificationCodeTemplateCode: SMS_2268101641 - superCode: 666666 - mail: + alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,必须修改 + accessKeyId: LTAI5tJPkn4HuuePdiLdGqe7 + accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV + signName: 托云信息技术 + verificationCodeTemplateCode: SMS_226810164 + superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代 + # second + codeTTL: 300 + mail: #仅支持qq邮箱,具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改 title: "openIM" - senderMail: "1765567899@qq.com" - senderAuthorizationCode: "1gxyausfoevlzbfag" + senderMail: "765567899@qq.com" + senderAuthorizationCode: "gxyausfoevlzbfag" smtpAddr: "smtp.qq.com" - smtpPort: 25 + smtpPort: 25 #需开放此端口 出口方向 + + diff --git a/deploy/.dockerignore b/deploy/.dockerignore new file mode 100644 index 000000000..019893ce7 --- /dev/null +++ b/deploy/.dockerignore @@ -0,0 +1,6 @@ +# 先设为忽略所有内容 +**/** + + +# 然后逐个排除 +!open_im_* \ No newline at end of file diff --git a/deploy/Makefile b/deploy/Makefile new file mode 100644 index 000000000..8250a06a4 --- /dev/null +++ b/deploy/Makefile @@ -0,0 +1,158 @@ + +GREEN_PREFIX="\033[32m" +COLOR_SUFFIX="\033[0m" +SKY_BLUE_PREFIX="\033[36m" + + +# 编译所有需要的组件源码 +win-build-all: + go env -w GOOS=linux + + make build-api && make build-msg-gateway && make build-msg-transfer && make build-push && make build-timer-task + make build-rpc-user && make build-rpc-friend && make build-rpc-group && make build-rpc-msg && make build-rpc-auth + make build-demo + + go env -w GOOS=windows + +# 编译 open_im_api +build-api: + echo -e ${GREEN_PREFIX} "open_im_api building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_api ../cmd/open_im_api/main.go + echo -e ${GREEN_PREFIX} "open_im_api build ok" ${COLOR_SUFFIX} + +# 编译 open_im_msg_gateway +build-msg-gateway: + echo -e ${GREEN_PREFIX} "open_im_msg_gateway building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_msg_gateway ../cmd/open_im_msg_gateway/main.go + echo -e ${GREEN_PREFIX} "open_im_msg_gateway build ok" ${COLOR_SUFFIX} + +# 编译 open_im_msg_transfer +build-msg-transfer: + echo -e ${GREEN_PREFIX} "open_im_msg_transfer building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_msg_transfer ../cmd/open_im_msg_transfer/main.go + echo -e ${GREEN_PREFIX} "open_im_msg_transfer build ok" ${COLOR_SUFFIX} + +# 编译 open_im_push +build-push: + echo -e ${GREEN_PREFIX} "open_im_push building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_push ../cmd/open_im_push/main.go + echo -e ${GREEN_PREFIX} "open_im_push build ok" ${COLOR_SUFFIX} + +# 编译 open_im_timer_task +build-timer-task: + echo -e ${GREEN_PREFIX} "open_im_timer_task building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_timer_task ../cmd/open_im_timer_task/main.go + echo -e ${GREEN_PREFIX} "open_im_timer_task build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-user +build-rpc-user: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_user ../cmd/rpc/open_im_user/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-friend +build-rpc-friend: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_friend ../cmd/rpc/open_im_friend/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-group +build-rpc-group: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_group ../cmd/rpc/open_im_group/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-auth +build-rpc-auth: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_auth ../cmd/rpc/open_im_auth/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-msg +build-rpc-msg: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_msg ../cmd/rpc/open_im_msg/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg build ok" ${COLOR_SUFFIX} + +# 编译 open_im_demo +build-demo: + echo -e ${SKY_BLUE_PREFIX} "open_im_demo building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_demo ../cmd/open_im_demo/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_demo build ok" ${COLOR_SUFFIX} + +# 打包所有组件为镜像 +image-all: + make image-api && make image-msg-gateway && make image-msg-transfer & make image-push && make image-timer-task + make image-rpc-user && make image-rpc-friend && make image-rpc-group && make image-rpc-msg && make image-rpc-auth + make image-demo + +# 打包 open_im_api +image-api: + echo -e ${GREEN_PREFIX} "IMAGE:openim/api building..." ${COLOR_SUFFIX} + docker build -t openim/api:latest -f ./dockerfiles/Dockerfile.api . + echo -e ${GREEN_PREFIX} "IMAGE:openim/api build ok" ${COLOR_SUFFIX} + +# 打包 open_im_msg_gateway +image-msg-gateway: + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway building..." ${COLOR_SUFFIX} + docker build -t openim/msg_gateway:latest -f ./dockerfiles/Dockerfile.msg_gateway . + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway build ok" ${COLOR_SUFFIX} + +# 打包 open_im_msg_transfer +image-msg-transfer: + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer building..." ${COLOR_SUFFIX} + docker build -t openim/msg_transfer:latest -f ./dockerfiles/Dockerfile.msg_transfer . + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer build ok" ${COLOR_SUFFIX} + +# 打包 open_im_push +image-push: + echo -e ${GREEN_PREFIX} "IMAGE:openim/push building..." ${COLOR_SUFFIX} + docker build -t openim/push:latest -f ./dockerfiles/Dockerfile.push . + echo -e ${GREEN_PREFIX} "IMAGE:openim/push build ok" ${COLOR_SUFFIX} + +# 打包 open_im_timer_task +image-timer-task: + echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task building..." ${COLOR_SUFFIX} + docker build -t openim/timer_task:latest -f ./dockerfiles/Dockerfile.timer_task . + echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-user +image-rpc-user: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_user:latest -f ./dockerfiles/Dockerfile.rpc_user . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-friend +image-rpc-friend: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_friend:latest -f ./dockerfiles/Dockerfile.rpc_friend . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-group +image-rpc-group: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_group:latest -f ./dockerfiles/Dockerfile.rpc_group . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-auth +image-rpc-auth: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_auth:latest -f ./dockerfiles/Dockerfile.rpc_auth . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-msg +image-rpc-msg: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_msg:latest -f ./dockerfiles/Dockerfile.rpc_msg . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg build ok" ${COLOR_SUFFIX} + +# 打包 open_im_demo +image-demo: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo building..." ${COLOR_SUFFIX} + docker build -t openim/demo:latest -f ./dockerfiles/Dockerfile.demo . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo build ok" ${COLOR_SUFFIX} + +.PHONY: win-build-all build-api build-msg-gateway build-msg-transfer build-push + build-timer-task build-rpc-user build-rpc-friend build-rpc-group build-rpc-msg build-demo + image-all image-api image-msg-gateway image-msg-transfer image-push + image-timer-task image-rpc-user image-rpc-friend image-rpc-group image-rpc-msg image-demo diff --git a/deploy/config.example.yaml b/deploy/config.example.yaml new file mode 100644 index 000000000..08d8858e4 --- /dev/null +++ b/deploy/config.example.yaml @@ -0,0 +1,183 @@ +# The class cannot be named by Pascal or camel case. +# If it is not used, the corresponding structure will not be set, +# and it will not be read naturally. +serverversion: 1.0.3 +#---------------Infrastructure configuration---------------------# +etcd: + etcdSchema: openIM + etcdAddr: [ openim_etcd:2379 ] + +mysql: + dbMysqlAddress: [ openim_mysql:3306 ] # openim_mysql 是对应的mysql服务的host + dbMysqlUserName: openIM + dbMysqlPassword: openIM + dbMysqlDatabaseName: openIM + dbTableName: eMsg + dbMsgTableNum: 1 + dbMaxOpenConns: 20 + dbMaxIdleConns: 10 + dbMaxLifeTime: 120 + +mongo: + dbUri: ""#当dbUri值不为空则直接使用该值 + dbAddress: [ openim_mongo:27017 ] + dbDirect: false + dbTimeout: 10 + dbDatabase: openIM + dbSource: admin + dbUserName: + dbPassword: + dbMaxPoolSize: 20 + dbRetainChatRecords: 7 + +redis: + dbAddress: openim_redis:6379 + dbMaxIdle: 128 + dbMaxActive: 0 + dbIdleTimeout: 120 + dbPassWord: openIM + +kafka: + ws2mschat: + addr: [ openim_kafka:9092 ] + topic: "ws2ms_chat" + ms2pschat: + addr: [ openim_kafka:9092 ] + topic: "ms2ps_chat" + consumergroupid: + msgToMongo: mongo + msgToMySql: mysql + msgToPush: push + + + +#---------------Internal service configuration---------------------# + +# The service ip default is empty, +# automatically obtain the machine's valid network card ip as the service ip, +# otherwise the configuration ip is preferred +serverip: 0.0.0.0 + +# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问 +# 新增的这一段配置节,主要是位了注册到etcd时,可以使用同一network下的容器名(host)来访问不同的容器,拆分到不同容器后原来全部使用serverip的形式不能用了 +endpoints: + api: openim_api + push: openim_push + msg_gateway: openim_msg_gateway + rpc_auth: openim_rpc_auth + rpc_friend: openim_rpc_friend + rpc_group: openim_rpc_group + rpc_msg: openim_rpc_msg + rpc_user: openim_rpc_user + +api: + openImApiPort: [ 10000 ] +sdk: + openImSdkWsPort: [ 30000 ] +cmsapi: + openImCmsApiPort: [ 8000 ] + +credential: + tencent: + appID: 1302656840 + region: ap-chengdu + bucket: echat-1302656840 + secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC + secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe + + +rpcport: + openImUserPort: [ 10100 ] + openImFriendPort: [ 10200 ] + openImOfflineMessagePort: [ 10300] + openImOnlineRelayPort: [ 10400 ] + openImGroupPort: [ 10500 ] + openImAuthPort: [ 10600 ] + openImPushPort: [ 10700 ] + openImStatisticsPort: [ 10800 ] + openImMessageCmsPort: [ 10900 ] + openImAdminCmsPort: [ 11000 ] + +rpcregistername: + openImUserName: User + openImFriendName: Friend + openImOfflineMessageName: OfflineMessage + openImPushName: Push + openImOnlineMessageRelayName: OnlineMessageRelay + openImGroupName: Group + openImAuthName: Auth + +log: + storageLocation: ../logs/ + rotationTime: 24 + remainRotationCount: 5 + remainLogLevel: 6 + elasticSearchSwitch: false + elasticSearchAddr: [ 127.0.0.1:9201 ] + elasticSearchUser: "" + elasticSearchPassword: "" + +modulename: + longConnSvrName: msg_gateway + msgTransferName: msg_transfer + pushName: push + +longconnsvr: + openImWsPort: [ 17778 ] + websocketMaxConnNum: 10000 + websocketMaxMsgLen: 4096 + websocketTimeOut: 10 + +push: + tpns: + ios: + accessID: 1600018281 + secretKey: 3cd68a77a95b89e5089a1aca523f318f + android: + accessID: 111 + secretKey: 111 + jpns: + appKey: cf47465a368f24c659608e7e + masterSecret: 02204efe3f3832947a236ee5 + pushUrl: "https://api.jpush.cn/v3/push" + pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" +manager: + appManagerUid: ["openIM123456","openIM654321"] + secrets: ["openIM1","openIM2"] + +secret: tuoyun + +multiloginpolicy: 1 + +#token config +tokenpolicy: + accessSecret: "open_im_server" + # Token effective time day as a unit + accessExpire: 7 + +messagecallback: + callbackSwitch: false + callbackUrl: "http://www.xxx.com/msg/judge" + #TimeOut use second as unit + callbackTimeOut: 10 + + +#---------------demo configuration---------------------# +#The following configuration items are applied to openIM Demo configuration +demoswitch: true +demo: + openImDemoPort: [ 42233 ] + alismsverify: + accessKeyId: LTAI5tJPkn4HuuePdiLdGqe71 + accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV1 + signName: OpenIM Corporation + verificationCodeTemplateCode: SMS_2268101641 + superCode: 666666 + mail: + title: "openIM" + senderMail: "1765567899@qq.com" + senderAuthorizationCode: "1gxyausfoevlzbfag" + smtpAddr: "smtp.qq.com" + smtpPort: 25 + + diff --git a/deploy/dockerfiles/Dockerfile.api b/deploy/dockerfiles/Dockerfile.api new file mode 100644 index 000000000..9c70d735d --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.api @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_api $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.demo b/deploy/dockerfiles/Dockerfile.demo new file mode 100644 index 000000000..ac77ad8d3 --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.demo @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_demo $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.msg_gateway b/deploy/dockerfiles/Dockerfile.msg_gateway new file mode 100644 index 000000000..ffd012bc4 --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.msg_gateway @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_msg_gateway $WORKDIR/main + +# 创建用于挂载的几个目录,重命名可执行文件为 main,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.msg_transfer b/deploy/dockerfiles/Dockerfile.msg_transfer new file mode 100644 index 000000000..a82c4da8b --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.msg_transfer @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_msg_transfer $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.push b/deploy/dockerfiles/Dockerfile.push new file mode 100644 index 000000000..b929dd82c --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.push @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_push $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_auth b/deploy/dockerfiles/Dockerfile.rpc_auth new file mode 100644 index 000000000..a8e50fdb1 --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_auth @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_auth $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_friend b/deploy/dockerfiles/Dockerfile.rpc_friend new file mode 100644 index 000000000..cfa2fe18c --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_friend @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_friend $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_group b/deploy/dockerfiles/Dockerfile.rpc_group new file mode 100644 index 000000000..d56a0fefe --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_group @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_group $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_msg b/deploy/dockerfiles/Dockerfile.rpc_msg new file mode 100644 index 000000000..01b5de02f --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_msg @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_msg $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_user b/deploy/dockerfiles/Dockerfile.rpc_user new file mode 100644 index 000000000..5be6298bd --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_user @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_user $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.timer_task b/deploy/dockerfiles/Dockerfile.timer_task new file mode 100644 index 000000000..0c2222cfb --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.timer_task @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_timer_task $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/env.yaml b/deploy/env.yaml new file mode 100644 index 000000000..423807e4f --- /dev/null +++ b/deploy/env.yaml @@ -0,0 +1,101 @@ +version: "3.7" +networks: + openim: + external: true + +services: + mysql: + networks: + - openim + image: mysql:5.7 + # ports: + # #- 13306:3306 + # - 23306:33060 + container_name: openim_mysql + volumes: + - ./components/mysql/data:/var/lib/mysql + - /etc/localtime:/etc/localtime + environment: + MYSQL_ROOT_PASSWORD: openIM + restart: always + + mongodb: + networks: + - openim + image: mongo:4.4.5-bionic + # ports: + # - 37017:27017 + container_name: openim_mongo + volumes: + - ./components/mongodb/data/db:/data/db + - ./components/mongodb/data/logs:/data/logs + - ./components/mongodb/data/conf:/etc/mongo + environment: + TZ: Asia/Shanghai + # - MONGO_INITDB_ROOT_USERNAME=openIM + # - MONGO_INITDB_ROOT_PASSWORD=openIM + restart: always + + redis: + networks: + - openim + image: redis:6.2.4-alpine + # ports: + # - 16379:6379 + container_name: openim_redis + volumes: + - ./components/redis/data:/data + #redis config file + #- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf + environment: + TZ: Asia/Shanghai + restart: always + sysctls: + net.core.somaxconn: 1024 + command: redis-server --requirepass openIM --appendonly yes + + + zookeeper: + networks: + - openim + image: wurstmeister/zookeeper + # ports: + # - 2181:2181 + container_name: openim_zookeeper + volumes: + - /etc/localtime:/etc/localtime + environment: + TZ: Asia/Shanghai + restart: always + + kafka: + networks: + - openim + image: wurstmeister/kafka + container_name: openim_kafka + restart: always + environment: + TZ: Asia/Shanghai + KAFKA_BROKER_ID: 0 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 + depends_on: + - zookeeper + + etcd: + networks: + - openim + image: quay.io/coreos/etcd + # ports: + # - 2379:2379 + # - 2380:2380 + container_name: openim_etcd + volumes: + - /etc/timezone:/etc/timezone + - /etc/localtime:/etc/localtime + environment: + ETCDCTL_API: 3 + restart: always + command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new + diff --git a/deploy/openim.yaml b/deploy/openim.yaml new file mode 100644 index 000000000..350729399 --- /dev/null +++ b/deploy/openim.yaml @@ -0,0 +1,223 @@ +version: "3.7" +networks: + openim: + external: true + +services: + api: + networks: + - openim + image: openim/api + container_name: openim_api + ports: + - 10000:10000 # API,必须开 + volumes: + - ./logs:/app/logs + # Dockerfile 里定义了配置文件的路径环境变量,CONFIG_NAME,默认指向了 /app/config/config.yaml + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + msg_gateway: + networks: + - openim + image: openim/msg_gateway + container_name: openim_msg_gateway + ports: + - 17778:17778 # 消息,必须开 + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + msg_transfer: + networks: + - openim + image: openim/msg_transfer + container_name: openim_msg_transfer + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + push: + networks: + - openim + image: openim/push + container_name: openim_push + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + timer_task: + networks: + - openim + image: openim/timer_task + container_name: openim_timer_task + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + rpc_user: + networks: + - openim + image: openim/rpc_user + container_name: openim_rpc_user + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + rpc_friend: + networks: + - openim + image: openim/rpc_friend + container_name: openim_rpc_friend + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + rpc_group: + networks: + - openim + image: openim/rpc_group + container_name: openim_rpc_group + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + rpc_auth: + networks: + - openim + image: openim/rpc_auth + container_name: openim_rpc_auth + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + rpc_msg: + networks: + - openim + image: openim/rpc_msg + container_name: openim_rpc_msg + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + demo: + networks: + - openim + image: openim/demo + container_name: openim_demo + ports: + - 42233:42233 + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always \ No newline at end of file diff --git a/deploy/readme.md b/deploy/readme.md new file mode 100644 index 000000000..61fbd9700 --- /dev/null +++ b/deploy/readme.md @@ -0,0 +1,30 @@ + +### 以docker-compose 形式单独部署 +```sh +# 查看 ./Makefile ,先编译各个需要的源码到 ../bin +# win-* 表示在win平台编译位linux二进制,其实就是处理了 go env -w GOOS=linux +make win-build-all + +# 得到各个二进制程序之后,打包为镜像 +# 目前没有处理 Open-IM-SDK-Core ,需要的话可以自己单独处理这个模块 +make image-all + +# docker-compose.yaml 分成了两部分,一部分是openIM的镜像容器 openim.yaml,一部分是依赖的环境 env.yaml +# 两部分使用一个外部的网络来联通,所以首先创建用到的 network +docker network create openim --attachable=true -d bridge + +# 处理openim组件需要的挂载目录,主要是处理config目录 +mkdir ./config +cp ./config.example.yaml ./config/config.yaml # 修改 ./config/config.yaml 内容,比如各个依赖组件的 host + +# 然后拉起env.yaml +docker-compose -f ./env.yaml up -d + +# 等env 容器全部拉起成功之后,拉起openim.yaml +docker-compose -f ./openim.yaml up -d + +# 查看容器运行,推荐使用下 portainer ,web查看容器情况,查看日志等等 +docker container ps -a | grep openim + +# 正常应该是查看api,demo等的容器日志,看到gin打印的路由日志才算是成功 +``` \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 996c70308..78e5c1ac2 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -24,9 +24,14 @@ services: - ./components/mongodb/data/db:/data/db - ./components/mongodb/data/logs:/data/logs - ./components/mongodb/data/conf:/etc/mongo - # environment: - # - MONGO_INITDB_ROOT_USERNAME=openIM - # - MONGO_INITDB_ROOT_PASSWORD=openIM + environment: + - TZ=Asia/Shanghai + # cache + - wiredTigerCacheSizeGB=1 +# environment: +# - MONGO_INITDB_ROOT_USERNAME=openIM +# - MONGO_INITDB_ROOT_PASSWORD=openIM + #TZ: Asia/Shanghai restart: always @@ -89,14 +94,13 @@ services: command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new open_im_server: - image: openim/open_im_server:v1.0.8 + image: openim/open_im_server:v2.0.4 container_name: open_im_server volumes: - ./logs:/Open-IM-Server/logs - ./config/config.yaml:/Open-IM-Server/config/config.yaml - ./db/sdk:/Open-IM-Server/db/sdk - ./script:/Open-IM-Server/script - restart: always depends_on: - kafka diff --git a/docs/Open-IM-Servers-on-System.png b/docs/Open-IM-Servers-on-System.png index ee4fc5d7b..3c8a10202 100644 Binary files a/docs/Open-IM-Servers-on-System.png and b/docs/Open-IM-Servers-on-System.png differ diff --git a/go.mod b/go.mod index 72982fb2c..8bb682c49 100644 --- a/go.mod +++ b/go.mod @@ -5,43 +5,55 @@ go 1.15 require ( github.com/Shopify/sarama v1.19.0 github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect - github.com/aliyun/alibaba-cloud-sdk-go v1.61.1422 + github.com/alibabacloud-go/darabonba-openapi v0.1.11 + github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8 + github.com/alibabacloud-go/sts-20150401 v1.1.0 + github.com/alibabacloud-go/tea v1.1.17 github.com/antonfisher/nested-logrus-formatter v1.3.0 github.com/bwmarrin/snowflake v0.3.0 - github.com/coreos/go-semver v0.3.0 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect github.com/eapache/go-resiliency v1.2.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect github.com/eapache/queue v1.1.0 // indirect + github.com/fatih/structs v1.1.0 github.com/frankban/quicktest v1.14.0 // indirect github.com/garyburd/redigo v1.6.2 github.com/gin-gonic/gin v1.7.0 github.com/go-playground/validator/v10 v10.4.1 + github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/golang-jwt/jwt/v4 v4.1.0 github.com/golang/protobuf v1.5.2 github.com/golang/snappy v0.0.4 // indirect github.com/gorilla/websocket v1.4.2 + github.com/jinzhu/copier v0.3.4 github.com/jinzhu/gorm v1.9.16 + github.com/jinzhu/now v1.1.3 // indirect github.com/jonboulle/clockwork v0.2.2 // indirect github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible github.com/lestrrat-go/strftime v1.0.4 // indirect github.com/lib/pq v1.2.0 // indirect github.com/mattn/go-sqlite3 v1.14.6 // indirect - github.com/mitchellh/mapstructure v1.4.1 + github.com/minio/minio-go/v7 v7.0.22 + github.com/mitchellh/mapstructure v1.4.2 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/olivere/elastic/v7 v7.0.23 github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pkg/errors v0.9.1 github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 github.com/sirupsen/logrus v1.8.1 + github.com/spf13/viper v1.9.0 github.com/stretchr/testify v1.7.0 github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698 + go.mongodb.org/mongo-driver v1.8.3 golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb golang.org/x/net v0.0.0-20210917221730-978cfadd31cf - golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect - google.golang.org/grpc v1.33.2 + google.golang.org/grpc v1.40.0 + google.golang.org/protobuf v1.27.1 + gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect + gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df + gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b sigs.k8s.io/yaml v1.2.0 // indirect diff --git a/go.sum b/go.sum index 8bdcc4463..34b43fe72 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,48 @@ -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -7,11 +50,41 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWso github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.1422 h1:cS+mI0luvAyG2ssIq/rhEOvUWf3PtdepvpGjipIi5kQ= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.1422/go.mod h1:RcDobYh8k5VP6TNybz9m++gL3ijVI5wueVr0EM10VsU= +github.com/alibabacloud-go/darabonba-openapi v0.1.7/go.mod h1:6FV1Bt1AItYIlC2rVopPTumrRNtkfPBmrPVAZ8v2bLk= +github.com/alibabacloud-go/darabonba-openapi v0.1.11 h1:w59gtSA0s87p0U5NNG/N/PIHsRP3rtj7qCP9hx9+GL8= +github.com/alibabacloud-go/darabonba-openapi v0.1.11/go.mod h1:MPJMxv7HYrFm5m9uOZWkDYsAWyZztEgnBRfk9Fg0eIU= +github.com/alibabacloud-go/darabonba-string v1.0.0/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 h1:NqugFkGxx1TXSh/pBcU00Y6bljgDPaFdh5MUSeJ7e50= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8 h1:KXMiCg99Jx7B6V+DlRFbWwL9UCGippE5z1wGzhyimiA= +github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8/go.mod h1:8aL6tSyQIWJygF7W/Vqxdf/QDbN2S+u57k36bEA8hD8= +github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q= +github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/openapi-util v0.0.8/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/openapi-util v0.0.9 h1:Z0DP4LFzkM/rW2nxOMiiLoQVZSeE3jVc5jrZ9Fd/UX0= +github.com/alibabacloud-go/openapi-util v0.0.9/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/sts-20150401 v1.1.0 h1:1yVyKz02ES6aKo3xVjmoPLBH1OAmmSqPkhKRdjEkmYs= +github.com/alibabacloud-go/sts-20150401 v1.1.0/go.mod h1:QW4O/c7Hp4krHYt+6xwnoG8EyZW3V9GYkl6EgIBmxJc= +github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= +github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.11/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.15/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.17 h1:05R5DnaJXe9sCNIe8KUgWHC/z6w/VZIwczgUwzRnul8= +github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/alibabacloud-go/tea-utils v1.3.9 h1:TtbzxS+BXrisA7wzbAMRtlU8A2eWLg0ufm7m/Tl6fc4= +github.com/alibabacloud-go/tea-utils v1.3.9/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY= +github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antonfisher/nested-logrus-formatter v1.3.0 h1:8zixYquU1Odk+vzAaAQPAdRh1ZjmUXNQ1T+dUBvlhVo= github.com/antonfisher/nested-logrus-formatter v1.3.0/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.38.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= @@ -20,14 +93,18 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -51,10 +128,15 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss= github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/garyburd/redigo v1.6.2 h1:yE/pwKCrbLpLpQICzYTeZ7JsTA/C53wFTJHaEtRqniM= github.com/garyburd/redigo v1.6.2/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -62,6 +144,9 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= @@ -72,52 +157,102 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -125,17 +260,43 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jinzhu/copier v0.3.4 h1:mfU6jI9PtCeUjkjQ322dlff9ELjGDu975C2p/nrubVI= +github.com/jinzhu/copier v0.3.4/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jinzhu/now v1.1.3 h1:PlHq1bSCSZL9K0wUhbm2pGLoTWs2GwVhsP6emvGV/ZI= +github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -147,14 +308,28 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= +github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -172,10 +347,18 @@ github.com/lestrrat-go/strftime v1.0.4/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR7 github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -184,29 +367,52 @@ github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRU github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4= +github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= +github.com/minio/minio-go/v7 v7.0.22 h1:iXhsiRyYh1ozm/+jN2qGgEIahYjEkvcpuu6NcdpSxcA= +github.com/minio/minio-go/v7 v7.0.22/go.mod h1:ei5JjmxwHaMrgsMrn4U/+Nmg+d8MKS1U2DAn1ou4+Do= +github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= +github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olivere/elastic/v7 v7.0.23 h1:b7tjMogDMhf2CisGI+L02LXLVa0ZyE82Z15XfW1e8t8= github.com/olivere/elastic/v7 v7.0.23/go.mod h1:OuWmD2DiuYhddWegBKPWQuelVKBLrW0fa/VUYgxuGTY= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -224,31 +430,57 @@ github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqn github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo= github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/assertions v1.1.1/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/gunit v1.4.2/go.mod h1:ZjM1ozSIMJlAz/ay4SG8PeKF00ckUp+zMHZXV9/bvak= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= +github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca h1:G/aIr3WiUesWHL2YGYgEqjM5tCAJ43Ml+0C18wDkWWs= github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca/go.mod h1:b18KQa4IxHbxeseW1GcZox53d7J0z39VNONTxvvlkXw= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -257,118 +489,428 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698 h1:jWtjCJX1qxhHISBMLRztWwR+EXkI7MJAF2HjHAE/x/I= go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.mongodb.org/mongo-driver v1.8.3 h1:TDKlTkGDKm9kkJVUOAXDK5/fkqKHJVwYQSpoRfB43R4= +go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf h1:R150MpwJIv1MpS0N/pc+NhTM8ajzvlmxlY5OYsrevXQ= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2IVY3KZs6p9mix0ziNYJM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 h1:z+ErRPu0+KS02Td3fOAgdX+lnPDh/VyaABEJPD4JRQs= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= +gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= +gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= @@ -377,14 +919,23 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go new file mode 100644 index 000000000..85d427fb8 --- /dev/null +++ b/internal/api/auth/auth.go @@ -0,0 +1,85 @@ +package apiAuth + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/auth" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func UserRegister(c *gin.Context) { + params := api.UserRegisterReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + if params.Secret != config.Config.Secret { + log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) + return + } + req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} + utils.CopyStructFields(req.UserInfo, ¶ms) + //copier.Copy(req.UserInfo, ¶ms) + req.OperationID = params.OperationID + log.NewInfo(req.OperationID, "UserRegister args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + client := rpc.NewAuthClient(etcdConn) + reply, err := client.UserRegister(context.Background(), req) + if err != nil || reply.CommonResp.ErrCode != 0 { + log.NewError(req.OperationID, "UserRegister failed ", err, reply.CommonResp.ErrCode) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": reply.CommonResp.ErrMsg}) + return + } + + pbDataToken := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID} + replyToken, err := client.UserToken(context.Background(), pbDataToken) + if err != nil { + log.NewError(req.OperationID, "UserToken failed ", err.Error(), pbDataToken) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + resp := api.UserRegisterResp{CommResp: api.CommResp{ErrCode: replyToken.CommonResp.ErrCode, ErrMsg: replyToken.CommonResp.ErrMsg}, + UserToken: api.UserTokenInfo{UserID: req.UserInfo.UserID, Token: replyToken.Token, ExpiredTime: replyToken.ExpiredTime}} + log.NewInfo(req.OperationID, "UserRegister return ", resp) + c.JSON(http.StatusOK, resp) + +} + +func UserToken(c *gin.Context) { + params := api.UserTokenReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + if params.Secret != config.Config.Secret { + log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) + return + } + req := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID} + log.NewInfo(req.OperationID, "UserToken args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + client := rpc.NewAuthClient(etcdConn) + reply, err := client.UserToken(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "UserToken failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + resp := api.UserTokenResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}, + UserToken: api.UserTokenInfo{UserID: req.FromUserID, Token: reply.Token, ExpiredTime: reply.ExpiredTime}} + log.NewInfo(req.OperationID, "UserRegister return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/auth/user_register.go b/internal/api/auth/user_register.go deleted file mode 100644 index e0d69eeda..000000000 --- a/internal/api/auth/user_register.go +++ /dev/null @@ -1,95 +0,0 @@ -package apiAuth - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbAuth "Open_IM/pkg/proto/auth" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsUserRegister struct { - Secret string `json:"secret" binding:"required,max=32"` - Platform int32 `json:"platform" binding:"required,min=1,max=7"` - UID string `json:"uid" binding:"required,min=1,max=64"` - Name string `json:"name" binding:"required,min=1,max=64"` - Icon string `json:"icon" binding:"omitempty,max=1024"` - Gender int32 `json:"gender" binding:"omitempty,oneof=0 1 2"` - Mobile string `json:"mobile" binding:"omitempty,max=32"` - Birth string `json:"birth" binding:"omitempty,max=16"` - Email string `json:"email" binding:"omitempty,max=64"` - Ex string `json:"ex" binding:"omitempty,max=1024"` -} - -func newUserRegisterReq(params *paramsUserRegister) *pbAuth.UserRegisterReq { - pbData := pbAuth.UserRegisterReq{ - UID: params.UID, - Name: params.Name, - Icon: params.Icon, - Gender: params.Gender, - Mobile: params.Mobile, - Birth: params.Birth, - Email: params.Email, - Ex: params.Ex, - } - return &pbData -} - -func UserRegister(c *gin.Context) { - log.Info("", "", "api user_register init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) - client := pbAuth.NewAuthClient(etcdConn) - //defer etcdConn.Close() - - params := paramsUserRegister{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - if params.Secret != config.Config.Secret { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) - return - } - pbData := newUserRegisterReq(¶ms) - - log.Info("", "", "api user_register is server, [data: %s]", pbData.String()) - reply, err := client.UserRegister(context.Background(), pbData) - if err != nil || !reply.Success { - log.Error("", "", "api user_register call rpc fail, [data: %s] [err: %s]", pbData.String(), err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) - return - } - log.Info("", "", "api user_register call rpc success, [data: %s] [reply: %s]", pbData.String(), reply.String()) - - pbDataToken := &pbAuth.UserTokenReq{ - Platform: params.Platform, - UID: params.UID, - } - replyToken, err := client.UserToken(context.Background(), pbDataToken) - if err != nil { - log.Error("", "", "api user_register call rpc fail, [data: %s] [err: %s]", pbData.String(), err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) - return - } - log.Info("", "", "api user_register call success, [data: %s] [reply: %s]", pbData.String(), reply.String()) - - if replyToken.ErrCode == 0 { - c.JSON(http.StatusOK, gin.H{ - "errCode": replyToken.ErrCode, - "errMsg": replyToken.ErrMsg, - "data": gin.H{ - "uid": pbData.UID, - "token": replyToken.Token, - "expiredTime": replyToken.ExpiredTime, - }, - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "errCode": replyToken.ErrCode, - "errMsg": replyToken.ErrMsg, - }) - } -} diff --git a/internal/api/auth/user_token.go b/internal/api/auth/user_token.go deleted file mode 100644 index 31839b6b0..000000000 --- a/internal/api/auth/user_token.go +++ /dev/null @@ -1,72 +0,0 @@ -package apiAuth - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbAuth "Open_IM/pkg/proto/auth" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsUserToken struct { - Secret string `json:"secret" binding:"required,max=32"` - Platform int32 `json:"platform" binding:"required,min=1,max=8"` - UID string `json:"uid" binding:"required,min=1,max=64"` -} - -func newUserTokenReq(params *paramsUserToken) *pbAuth.UserTokenReq { - pbData := pbAuth.UserTokenReq{ - Platform: params.Platform, - UID: params.UID, - } - return &pbData -} - -func UserToken(c *gin.Context) { - log.Info("", "", "api user_token init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) - client := pbAuth.NewAuthClient(etcdConn) - //defer etcdConn.Close() - - params := paramsUserToken{} - if err := c.BindJSON(¶ms); err != nil { - log.Error("", "", params.UID, params.Platform, params.Secret) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - if params.Secret != config.Config.Secret { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) - return - } - pbData := newUserTokenReq(¶ms) - - log.Info("", "", "api user_token is server, [data: %s]", pbData.String()) - reply, err := client.UserToken(context.Background(), pbData) - if err != nil { - log.Error("", "", "api user_token call rpc fail, [data: %s] [err: %s]", pbData.String(), err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) - return - } - log.Info("", "", "api user_token call rpc success, [data: %s] [reply: %s]", pbData.String(), reply.String()) - - if reply.ErrCode == 0 { - c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - "data": gin.H{ - "uid": pbData.UID, - "token": reply.Token, - "expiredTime": reply.ExpiredTime, - }, - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - }) - } - -} diff --git a/internal/api/chat/get_max_min_seq.go b/internal/api/chat/get_max_min_seq.go index 06db8fd9d..95a4b1340 100644 --- a/internal/api/chat/get_max_min_seq.go +++ b/internal/api/chat/get_max_min_seq.go @@ -3,9 +3,9 @@ package apiChat import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbMsg "Open_IM/pkg/proto/chat" - "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" @@ -19,7 +19,7 @@ type paramsUserNewestSeq struct { MsgIncr int `json:"msgIncr" binding:"required"` } -func UserGetSeq(c *gin.Context) { +func GetSeq(c *gin.Context) { params := paramsUserNewestSeq{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) @@ -27,8 +27,8 @@ func UserGetSeq(c *gin.Context) { } token := c.Request.Header.Get("token") - if !utils.VerifyToken(token, params.SendID) { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) + if ok, err := token_verify.VerifyToken(token, params.SendID); !ok { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err" + err.Error()}) return } pbData := pbMsg.GetMaxAndMinSeqReq{} @@ -42,7 +42,8 @@ func UserGetSeq(c *gin.Context) { msgClient := pbMsg.NewChatClient(grpcConn) reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) if err != nil { - log.ErrorByKv("rpc call failed to getNewSeq", pbData.OperationID, "err", err, "pbData", pbData.String()) + log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "UserGetSeq rpc failed, " + err.Error()}) return } diff --git a/internal/api/chat/pull_msg.go b/internal/api/chat/pull_msg.go index 4fb90b61f..0872319c6 100644 --- a/internal/api/chat/pull_msg.go +++ b/internal/api/chat/pull_msg.go @@ -3,9 +3,10 @@ package apiChat import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/chat" - "Open_IM/pkg/utils" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" "context" "github.com/gin-gonic/gin" "net/http" @@ -22,63 +23,14 @@ type paramsUserPullMsg struct { } } -func UserPullMsg(c *gin.Context) { - params := paramsUserPullMsg{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - - token := c.Request.Header.Get("token") - if !utils.VerifyToken(token, params.SendID) { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) - return - } - pbData := pbChat.PullMessageReq{} - pbData.UserID = params.SendID - pbData.OperationID = params.OperationID - pbData.SeqBegin = *params.Data.SeqBegin - pbData.SeqEnd = *params.Data.SeqEnd - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) - msgClient := pbChat.NewChatClient(grpcConn) - reply, err := msgClient.PullMessage(context.Background(), &pbData) - if err != nil { - log.ErrorByKv("PullMessage error", pbData.OperationID, "err", err.Error()) - return - } - log.InfoByKv("rpc call success to pullMsgRep", pbData.OperationID, "ReplyArgs", reply.String(), "maxSeq", reply.GetMaxSeq(), - "MinSeq", reply.GetMinSeq(), "singLen", len(reply.GetSingleUserMsg()), "groupLen", len(reply.GetGroupUserMsg())) - - msg := make(map[string]interface{}) - if v := reply.GetSingleUserMsg(); v != nil { - msg["single"] = v - } else { - msg["single"] = []pbChat.GatherFormat{} - } - if v := reply.GetGroupUserMsg(); v != nil { - msg["group"] = v - } else { - msg["group"] = []pbChat.GatherFormat{} - } - msg["maxSeq"] = reply.GetMaxSeq() - msg["minSeq"] = reply.GetMinSeq() - c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - "reqIdentifier": *params.ReqIdentifier, - "data": msg, - }) - -} - type paramsUserPullMsgBySeqList struct { - ReqIdentifier int `json:"reqIdentifier" binding:"required"` - SendID string `json:"sendID" binding:"required"` - OperationID string `json:"operationID" binding:"required"` - SeqList []int64 `json:"seqList"` + ReqIdentifier int `json:"reqIdentifier" binding:"required"` + SendID string `json:"sendID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + SeqList []uint32 `json:"seqList"` } -func UserPullMsgBySeqList(c *gin.Context) { +func PullMsgBySeqList(c *gin.Context) { params := paramsUserPullMsgBySeqList{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) @@ -86,11 +38,11 @@ func UserPullMsgBySeqList(c *gin.Context) { } token := c.Request.Header.Get("token") - if !utils.VerifyToken(token, params.SendID) { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) + if ok, err := token_verify.VerifyToken(token, params.SendID); !ok { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err" + err.Error()}) return } - pbData := pbChat.PullMessageBySeqListReq{} + pbData := open_im_sdk.PullMessageBySeqListReq{} pbData.UserID = params.SendID pbData.OperationID = params.OperationID pbData.SeqList = params.SeqList @@ -102,26 +54,11 @@ func UserPullMsgBySeqList(c *gin.Context) { log.ErrorByKv("PullMessageBySeqList error", pbData.OperationID, "err", err.Error()) return } - log.InfoByKv("rpc call success to PullMessageBySeqList", pbData.OperationID, "ReplyArgs", reply.String(), "maxSeq", reply.GetMaxSeq(), - "MinSeq", reply.GetMinSeq(), "singLen", len(reply.GetSingleUserMsg()), "groupLen", len(reply.GetGroupUserMsg())) - - msg := make(map[string]interface{}) - if v := reply.GetSingleUserMsg(); v != nil { - msg["single"] = v - } else { - msg["single"] = []pbChat.GatherFormat{} - } - if v := reply.GetGroupUserMsg(); v != nil { - msg["group"] = v - } else { - msg["group"] = []pbChat.GatherFormat{} - } - msg["maxSeq"] = reply.GetMaxSeq() - msg["minSeq"] = reply.GetMinSeq() + log.InfoByKv("rpc call success to PullMessageBySeqList", pbData.OperationID, "ReplyArgs", reply.String(), len(reply.List)) c.JSON(http.StatusOK, gin.H{ "errCode": reply.ErrCode, "errMsg": reply.ErrMsg, "reqIdentifier": params.ReqIdentifier, - "data": msg, + "data": reply.List, }) } diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go index 6d7294109..a28dcd1ce 100644 --- a/internal/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -4,7 +4,7 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/chat" - "Open_IM/pkg/utils" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" "context" "Open_IM/pkg/grpc-etcdv3/getcdv3" @@ -14,50 +14,51 @@ import ( ) type paramsUserSendMsg struct { - ReqIdentifier int32 `json:"reqIdentifier" binding:"required"` - PlatformID int32 `json:"platformID" binding:"required"` - SendID string `json:"sendID" binding:"required"` - SenderNickName string `json:"senderNickName"` - SenderFaceURL string `json:"senderFaceUrl"` - OperationID string `json:"operationID" binding:"required"` - Data struct { - SessionType int32 `json:"sessionType" binding:"required"` - MsgFrom int32 `json:"msgFrom" binding:"required"` - ContentType int32 `json:"contentType" binding:"required"` - RecvID string `json:"recvID" binding:"required"` - ForceList []string `json:"forceList"` - Content string `json:"content" binding:"required"` - Options map[string]interface{} `json:"options" ` - ClientMsgID string `json:"clientMsgID" binding:"required"` - OffLineInfo map[string]interface{} `json:"offlineInfo" ` - Ex map[string]interface{} `json:"ext"` + SenderPlatformID int32 `json:"senderPlatformID" binding:"required"` + SendID string `json:"sendID" binding:"required"` + SenderNickName string `json:"senderNickName"` + SenderFaceURL string `json:"senderFaceUrl"` + OperationID string `json:"operationID" binding:"required"` + Data struct { + SessionType int32 `json:"sessionType" binding:"required"` + MsgFrom int32 `json:"msgFrom" binding:"required"` + ContentType int32 `json:"contentType" binding:"required"` + RecvID string `json:"recvID" ` + GroupID string `json:"groupID" ` + ForceList []string `json:"forceList"` + Content []byte `json:"content" binding:"required"` + Options map[string]bool `json:"options" ` + ClientMsgID string `json:"clientMsgID" binding:"required"` + CreateTime int64 `json:"createTime" binding:"required"` + OffLineInfo *open_im_sdk.OfflinePushInfo `json:"offlineInfo" ` } } -func newUserSendMsgReq(token string, params *paramsUserSendMsg) *pbChat.UserSendMsgReq { - pbData := pbChat.UserSendMsgReq{ - ReqIdentifier: params.ReqIdentifier, - Token: token, - SendID: params.SendID, - SenderNickName: params.SenderNickName, - SenderFaceURL: params.SenderFaceURL, - OperationID: params.OperationID, - PlatformID: params.PlatformID, - SessionType: params.Data.SessionType, - MsgFrom: params.Data.MsgFrom, - ContentType: params.Data.ContentType, - RecvID: params.Data.RecvID, - ForceList: params.Data.ForceList, - Content: params.Data.Content, - Options: utils.MapToJsonString(params.Data.Options), - ClientMsgID: params.Data.ClientMsgID, - OffLineInfo: utils.MapToJsonString(params.Data.OffLineInfo), - Ex: utils.MapToJsonString(params.Data.Ex), +func newUserSendMsgReq(token string, params *paramsUserSendMsg) *pbChat.SendMsgReq { + pbData := pbChat.SendMsgReq{ + Token: token, + OperationID: params.OperationID, + MsgData: &open_im_sdk.MsgData{ + SendID: params.SendID, + RecvID: params.Data.RecvID, + GroupID: params.Data.GroupID, + ClientMsgID: params.Data.ClientMsgID, + SenderPlatformID: params.SenderPlatformID, + SenderNickname: params.SenderNickName, + SenderFaceURL: params.SenderFaceURL, + SessionType: params.Data.SessionType, + MsgFrom: params.Data.MsgFrom, + ContentType: params.Data.ContentType, + Content: params.Data.Content, + CreateTime: params.Data.CreateTime, + Options: params.Data.Options, + OfflinePushInfo: params.Data.OffLineInfo, + }, } return &pbData } -func UserSendMsg(c *gin.Context) { +func SendMsg(c *gin.Context) { params := paramsUserSendMsg{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) @@ -70,20 +71,24 @@ func UserSendMsg(c *gin.Context) { log.InfoByKv("api call success to sendMsgReq", params.OperationID, "Parameters", params) pbData := newUserSendMsgReq(token, ¶ms) - log.Info("", "", "api UserSendMsg call start..., [data: %s]", pbData.String()) + log.Info("", "", "api SendMsg call start..., [data: %s]", pbData.String()) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) client := pbChat.NewChatClient(etcdConn) - log.Info("", "", "api UserSendMsg call, api call rpc...") + log.Info("", "", "api SendMsg call, api call rpc...") - reply, _ := client.UserSendMsg(context.Background(), pbData) - log.Info("", "", "api UserSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) + reply, err := client.SendMsg(context.Background(), pbData) + if err != nil { + log.NewError(params.OperationID, "SendMsg rpc failed, ", params, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "SendMsg rpc failed, " + err.Error()}) + return + } + log.Info("", "", "api SendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - "reqIdentifier": reply.ReqIdentifier, + "errCode": reply.ErrCode, + "errMsg": reply.ErrMsg, "data": gin.H{ "clientMsgID": reply.ClientMsgID, "serverMsgID": reply.ServerMsgID, diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go new file mode 100644 index 000000000..3971fbad7 --- /dev/null +++ b/internal/api/conversation/conversation.go @@ -0,0 +1,125 @@ +package conversation + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/user" + rpc "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func GetAllConversationMessageOpt(c *gin.Context) { + params := api.GetAllConversationMessageOptReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + req := &rpc.GetAllConversationMsgOptReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed or not set token in header"}) + return + } + log.NewInfo(params.OperationID, "GetAllConversationMessageOpt args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := user.NewUserClient(etcdConn) + RpcResp, err := client.GetAllConversationMsgOpt(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "GetAllConversationMsgOpt rpc failed, ", req, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + optResult := make([]*api.OptResult, 0) + for _, v := range RpcResp.ConversationOptResultList { + temp := new(api.OptResult) + temp.ConversationID = v.ConversationID + temp.Result = &v.Result + optResult = append(optResult, temp) + } + resp := api.GetAllConversationMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, ConversationOptResultList: optResult} + log.NewInfo(req.OperationID, "GetAllConversationMsgOpt api return: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetReceiveMessageOpt(c *gin.Context) { + params := api.GetReceiveMessageOptReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + req := &rpc.GetReceiveMessageOptReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "GetReceiveMessageOpt args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := user.NewUserClient(etcdConn) + RpcResp, err := client.GetReceiveMessageOpt(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "GetReceiveMessageOpt rpc failed, ", req, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetReceiveMessageOpt rpc failed, " + err.Error()}) + return + } + optResult := make([]*api.OptResult, 0) + for _, v := range RpcResp.ConversationOptResultList { + temp := new(api.OptResult) + temp.ConversationID = v.ConversationID + temp.Result = &v.Result + optResult = append(optResult, temp) + } + resp := api.GetReceiveMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, ConversationOptResultList: optResult} + log.NewInfo(req.OperationID, "GetReceiveMessageOpt api return: ", resp) + c.JSON(http.StatusOK, resp) +} + +func SetReceiveMessageOpt(c *gin.Context) { + params := api.SetReceiveMessageOptReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + req := &rpc.SetReceiveMessageOptReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "SetReceiveMessageOpt args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := user.NewUserClient(etcdConn) + RpcResp, err := client.SetReceiveMessageOpt(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "SetReceiveMessageOpt rpc failed, ", req, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "SetReceiveMessageOpt rpc failed, " + err.Error()}) + return + } + optResult := make([]*api.OptResult, 0) + for _, v := range RpcResp.ConversationOptResultList { + temp := new(api.OptResult) + temp.ConversationID = v.ConversationID + temp.Result = &v.Result + optResult = append(optResult, temp) + } + resp := api.SetReceiveMessageOptResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, ConversationOptResultList: optResult} + log.NewInfo(req.OperationID, "SetReceiveMessageOpt api return: ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/friend/add_blacklist.go b/internal/api/friend/add_blacklist.go deleted file mode 100644 index e0969faf3..000000000 --- a/internal/api/friend/add_blacklist.go +++ /dev/null @@ -1,49 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -/* -type paramsAddBlackList struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` -}*/ - -func AddBlacklist(c *gin.Context) { - log.Info("", "", "api add blacklist init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsSearchFriend{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.AddBlacklistReq{ - Uid: params.UID, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - OwnerUid: params.OwnerUid, - } - log.Info(req.Token, req.OperationID, "api add blacklist is server:userID=%s", req.Uid) - RpcResp, err := client.AddBlacklist(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call add blacklist rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add blacklist rpc server failed"}) - return - } - log.InfoByArgs("call add blacklist rpc server success,args=%s", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - log.InfoByArgs("api add blacklist success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/add_friend.go b/internal/api/friend/add_friend.go deleted file mode 100644 index d949df083..000000000 --- a/internal/api/friend/add_friend.go +++ /dev/null @@ -1,84 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/pkg/proto/friend" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsImportFriendReq struct { - OperationID string `json:"operationID" binding:"required"` - UIDList []string `json:"uidList" binding:"required"` - OwnerUid string `json:"ownerUid" binding:"required"` -} - -type paramsAddFriend struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` - ReqMessage string `json:"reqMessage"` -} - -// -func ImportFriend(c *gin.Context) { - log.Info("", "", "ImportFriend init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - - params := paramsImportFriendReq{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.ImportFriendReq{ - UidList: params.UIDList, - OperationID: params.OperationID, - OwnerUid: params.OwnerUid, - Token: c.Request.Header.Get("token"), - } - RpcResp, err := client.ImportFriend(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,ImportFriend failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "cImportFriend failed" + err.Error()}) - return - } - log.InfoByArgs("ImportFriend success,args=%s", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.CommonResp.ErrorCode, "errMsg": RpcResp.CommonResp.ErrorMsg, "failedUidList": RpcResp.FailedUidList} - c.JSON(http.StatusOK, resp) - log.InfoByArgs("ImportFriend success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} - -func AddFriend(c *gin.Context) { - log.Info("", "", "api add friend init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - - params := paramsAddFriend{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.AddFriendReq{ - Uid: params.UID, - OperationID: params.OperationID, - ReqMessage: params.ReqMessage, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api add friend is server") - RpcResp, err := client.AddFriend(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call add friend rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add friend rpc server failed"}) - return - } - log.InfoByArgs("call add friend rpc server success,args=%s", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - log.InfoByArgs("api add friend success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/add_friend_response.go b/internal/api/friend/add_friend_response.go deleted file mode 100644 index 37e801b3e..000000000 --- a/internal/api/friend/add_friend_response.go +++ /dev/null @@ -1,49 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "fmt" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsAddFriendResponse struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` - Flag int32 `json:"flag" binding:"required"` -} - -func AddFriendResponse(c *gin.Context) { - log.Info("", "", fmt.Sprintf("api add friend response init ....")) - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsAddFriendResponse{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.AddFriendResponseReq{ - Uid: params.UID, - Flag: params.Flag, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api add friend response is server:userID=%s", req.Uid) - RpcResp, err := client.AddFriendResponse(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call add_friend_response rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add_friend_response rpc server failed"}) - return - } - log.InfoByArgs("call add friend response rpc server success,args=%s", RpcResp.String()) - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) - log.InfoByArgs("api add friend response success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/delete_friend.go b/internal/api/friend/delete_friend.go deleted file mode 100644 index 4bdbedeee..000000000 --- a/internal/api/friend/delete_friend.go +++ /dev/null @@ -1,48 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "fmt" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsDeleteFriend struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` -} - -func DeleteFriend(c *gin.Context) { - log.Info("", "", fmt.Sprintf("api delete_friend init ....")) - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsDeleteFriend{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.DeleteFriendReq{ - Uid: params.UID, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api delete_friend is server:%s", req.Uid) - RpcResp, err := client.DeleteFriend(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call delete_friend rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call delete_friend rpc server failed"}) - return - } - log.InfoByArgs("call delete_friend rpc server,args=%s", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - log.InfoByArgs("api delete_friend success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/friend.go b/internal/api/friend/friend.go new file mode 100644 index 000000000..1c6b0a9b2 --- /dev/null +++ b/internal/api/friend/friend.go @@ -0,0 +1,456 @@ +package friend + +import ( + jsonData "Open_IM/internal/utils" + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/friend" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func AddBlack(c *gin.Context) { + params := api.AddBlacklistReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AddBlacklistReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "AddBlacklist args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.AddBlacklist(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "AddBlacklist failed ", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add blacklist rpc server failed"}) + return + } + resp := api.AddBlacklistResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "AddBlacklist api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func ImportFriend(c *gin.Context) { + params := api.ImportFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.ImportFriendReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "ImportFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.ImportFriend(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "ImportFriend failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "ImportFriend failed "}) + return + } + resp := api.ImportFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + if resp.ErrCode == 0 { + for _, v := range RpcResp.UserIDResultList { + resp.UserIDResultList = append(resp.UserIDResultList, api.UserIDResult{UserID: v.UserID, Result: v.Result}) + } + } + if len(resp.UserIDResultList) == 0 { + resp.UserIDResultList = []api.UserIDResult{} + } + log.NewInfo(req.OperationID, "ImportFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func AddFriend(c *gin.Context) { + params := api.AddFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AddFriendReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + req.ReqMsg = params.ReqMsg + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "AddFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.AddFriend(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "AddFriend failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call AddFriend rpc server failed"}) + return + } + + resp := api.AddFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "AddFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func AddFriendResponse(c *gin.Context) { + params := api.AddFriendResponseReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AddFriendResponseReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + req.HandleMsg = params.HandleMsg + req.HandleResult = params.Flag + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + utils.CopyStructFields(req, ¶ms) + log.NewInfo(req.CommID.OperationID, "AddFriendResponse args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.AddFriendResponse(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "AddFriendResponse failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add_friend_response rpc server failed"}) + return + } + + resp := api.AddFriendResponseResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "AddFriendResponse api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func DeleteFriend(c *gin.Context) { + params := api.DeleteFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.DeleteFriendReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "DeleteFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.DeleteFriend(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "DeleteFriend failed ", err, req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call delete_friend rpc server failed"}) + return + } + + resp := api.DeleteFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "DeleteFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetBlacklist(c *gin.Context) { + params := api.GetBlackListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetBlacklistReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetBlacklist args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.GetBlacklist(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetBlacklist failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get blacklist rpc server failed"}) + return + } + + resp := api.GetBlackListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + for _, v := range RpcResp.BlackUserInfoList { + black := open_im_sdk.PublicUserInfo{} + utils.CopyStructFields(&black, v) + resp.BlackUserInfoList = append(resp.BlackUserInfoList, &black) + } + resp.Data = jsonData.JsonDataList(resp.BlackUserInfoList) + log.NewInfo(req.CommID.OperationID, "GetBlacklist api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func SetFriendRemark(c *gin.Context) { + params := api.SetFriendRemarkReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.SetFriendRemarkReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + req.Remark = params.Remark + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "SetFriendComment args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.SetFriendRemark(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "SetFriendComment failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call set friend comment rpc server failed"}) + return + } + resp := api.SetFriendRemarkResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + + log.NewInfo(req.CommID.OperationID, "SetFriendComment api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func RemoveBlack(c *gin.Context) { + params := api.RemoveBlackListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.RemoveBlacklistReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + + log.NewInfo(req.CommID.OperationID, "RemoveBlacklist args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.RemoveBlacklist(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "RemoveBlacklist failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call remove blacklist rpc server failed"}) + return + } + resp := api.RemoveBlackListResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "RemoveBlacklist api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func IsFriend(c *gin.Context) { + params := api.IsFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.IsFriendReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "IsFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.IsFriend(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "IsFriend failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add friend rpc server failed"}) + return + } + resp := api.IsFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + resp.Response.Friend = RpcResp.Response + + log.NewInfo(req.CommID.OperationID, "IsFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +// +//func GetFriendsInfo(c *gin.Context) { +// params := api.GetFriendsInfoReq{} +// if err := c.BindJSON(¶ms); err != nil { +// log.NewError("0", "BindJSON failed ", err.Error()) +// c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) +// return +// } +// req := &rpc.GetFriendsInfoReq{} +// utils.CopyStructFields(req.CommID, params) +// var ok bool +// ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) +// if !ok { +// log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) +// return +// } +// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo args ", req.String()) +// +// etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) +// client := rpc.NewFriendClient(etcdConn) +// RpcResp, err := client.GetFriendsInfo(context.Background(), req) +// if err != nil { +// log.NewError(req.CommID.OperationID, "GetFriendsInfo failed ", err.Error(), req.String()) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call search friend rpc server failed"}) +// return +// } +// +// resp := api.GetFriendsInfoResp{CommResp:api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} +// utils.CopyStructFields(&resp, RpcResp) +// c.JSON(http.StatusOK, resp) +// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo api return ", resp) +//} + +func GetFriendList(c *gin.Context) { + params := api.GetFriendListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetFriendListReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetFriendList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.GetFriendList(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetFriendList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get friend list rpc server failed"}) + return + } + + resp := api.GetFriendListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, FriendInfoList: RpcResp.FriendInfoList} + resp.Data = jsonData.JsonDataList(resp.FriendInfoList) + log.NewInfo(req.CommID.OperationID, "GetFriendList api return ", resp) + c.JSON(http.StatusOK, resp) + //c.JSON(http.StatusOK, resp) +} + +func GetFriendApplyList(c *gin.Context) { + params := api.GetFriendApplyListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetFriendApplyListReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetFriendApplyList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + + RpcResp, err := client.GetFriendApplyList(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetFriendApplyList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get friend apply list rpc server failed"}) + return + } + + resp := api.GetFriendApplyListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, FriendRequestList: RpcResp.FriendRequestList} + resp.Data = jsonData.JsonDataList(resp.FriendRequestList) + log.NewInfo(req.CommID.OperationID, "GetFriendApplyList api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetSelfFriendApplyList(c *gin.Context) { + params := api.GetSelfApplyListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetSelfApplyListReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetSelfApplyList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.GetSelfApplyList(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetSelfApplyList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get self apply list rpc server failed"}) + return + } + resp := api.GetSelfApplyListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, FriendRequestList: RpcResp.FriendRequestList} + resp.Data = jsonData.JsonDataList(resp.FriendRequestList) + log.NewInfo(req.CommID.OperationID, "GetSelfApplyList api return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/friend/get_blcaklist.go b/internal/api/friend/get_blcaklist.go deleted file mode 100644 index 5e875a5e8..000000000 --- a/internal/api/friend/get_blcaklist.go +++ /dev/null @@ -1,79 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "fmt" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsGetBlackList struct { - OperationID string `json:"operationID" binding:"required"` -} - -type blackListUserInfo struct { - UID string `json:"uid"` - Name string `json:"name"` - Icon string `json:"icon"` - Gender int32 `json:"gender"` - Mobile string `json:"mobile"` - Birth string `json:"birth"` - Email string `json:"email"` - Ex string `json:"ex"` -} - -func GetBlacklist(c *gin.Context) { - log.Info("", "", "api get blacklist init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsGetBlackList{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.GetBlacklistReq{ - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, fmt.Sprintf("api get blacklist is server")) - RpcResp, err := client.GetBlacklist(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call get_friend_list rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get blacklist rpc server failed"}) - return - } - log.InfoByArgs("call get blacklist rpc server success,args=%s", RpcResp.String()) - if RpcResp.ErrorCode == 0 { - userBlackList := make([]blackListUserInfo, 0) - for _, friend := range RpcResp.Data { - var fi blackListUserInfo - fi.UID = friend.Uid - fi.Name = friend.Name - fi.Icon = friend.Icon - fi.Gender = friend.Gender - fi.Mobile = friend.Mobile - fi.Birth = friend.Birth - fi.Email = friend.Email - fi.Ex = friend.Ex - userBlackList = append(userBlackList, fi) - } - resp := gin.H{ - "errCode": RpcResp.ErrorCode, - "errMsg": RpcResp.ErrorMsg, - "data": userBlackList, - } - c.JSON(http.StatusOK, resp) - } else { - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - } - log.InfoByArgs("api get black list success return,get args=%s,return=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/get_friend_apply_list.go b/internal/api/friend/get_friend_apply_list.go deleted file mode 100644 index d7ca192e4..000000000 --- a/internal/api/friend/get_friend_apply_list.go +++ /dev/null @@ -1,129 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsGetApplyList struct { - OperationID string `json:"operationID" binding:"required"` -} -type UserInfo struct { - UID string `json:"uid"` - Name string `json:"name"` - Icon string `json:"icon"` - Gender int32 `json:"gender"` - Mobile string `json:"mobile"` - Birth string `json:"birth"` - Email string `json:"email"` - Ex string `json:"ex"` - ReqMessage string `json:"reqMessage"` - ApplyTime string `json:"applyTime"` - Flag int32 `json:"flag"` -} - -func GetFriendApplyList(c *gin.Context) { - log.Info("", "", "api get_friend_apply_list init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsGetApplyList{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.GetFriendApplyReq{ - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api get friend apply list is server") - RpcResp, err := client.GetFriendApplyList(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call get friend apply list rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get friend apply list rpc server failed"}) - return - } - log.InfoByArgs("call get friend apply list rpc server success,args=%s", RpcResp.String()) - if RpcResp.ErrorCode == 0 { - userInfoList := make([]UserInfo, 0) - for _, applyUserinfo := range RpcResp.Data { - var un UserInfo - un.UID = applyUserinfo.Uid - un.Name = applyUserinfo.Name - un.Icon = applyUserinfo.Icon - un.Gender = applyUserinfo.Gender - un.Mobile = applyUserinfo.Mobile - un.Birth = applyUserinfo.Birth - un.Email = applyUserinfo.Email - un.Ex = applyUserinfo.Ex - un.Flag = applyUserinfo.Flag - un.ApplyTime = applyUserinfo.ApplyTime - un.ReqMessage = applyUserinfo.ReqMessage - userInfoList = append(userInfoList, un) - } - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg, "data": userInfoList} - c.JSON(http.StatusOK, resp) - } else { - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - } - log.InfoByArgs("api get friend apply list success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} - -func GetSelfApplyList(c *gin.Context) { - log.Info("", "", "api get self friend apply list init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsGetApplyList{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.GetFriendApplyReq{ - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api get self apply list is server") - RpcResp, err := client.GetSelfApplyList(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call get self apply list rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get self apply list rpc server failed"}) - return - } - log.InfoByArgs("call get self apply list rpc server success,args=%s", RpcResp.String()) - if RpcResp.ErrorCode == 0 { - userInfoList := make([]UserInfo, 0) - for _, selfApplyOtherUserinfo := range RpcResp.Data { - var un UserInfo - un.UID = selfApplyOtherUserinfo.Uid - un.Name = selfApplyOtherUserinfo.Name - un.Icon = selfApplyOtherUserinfo.Icon - un.Gender = selfApplyOtherUserinfo.Gender - un.Mobile = selfApplyOtherUserinfo.Mobile - un.Birth = selfApplyOtherUserinfo.Birth - un.Email = selfApplyOtherUserinfo.Email - un.Ex = selfApplyOtherUserinfo.Ex - un.Flag = selfApplyOtherUserinfo.Flag - un.ApplyTime = selfApplyOtherUserinfo.ApplyTime - un.ReqMessage = selfApplyOtherUserinfo.ReqMessage - userInfoList = append(userInfoList, un) - } - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg, "data": userInfoList} - c.JSON(http.StatusOK, resp) - } else { - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - } - log.InfoByArgs("api get self apply list success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/get_friend_list.go b/internal/api/friend/get_friend_list.go deleted file mode 100644 index db1361572..000000000 --- a/internal/api/friend/get_friend_list.go +++ /dev/null @@ -1,83 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "fmt" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsGetFriendLIst struct { - OperationID string `json:"operationID" binding:"required"` -} - -type friendInfo struct { - UID string `json:"uid"` - Name string `json:"name"` - Icon string `json:"icon"` - Gender int32 `json:"gender"` - Mobile string `json:"mobile"` - Birth string `json:"birth"` - Email string `json:"email"` - Ex string `json:"ex"` - Comment string `json:"comment"` - IsInBlackList int32 `json:"isInBlackList"` -} - -func GetFriendList(c *gin.Context) { - log.Info("", "", fmt.Sprintf("api get_friendlist init ....")) - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsGetFriendLIst{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.GetFriendListReq{ - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api get friend list is server") - RpcResp, err := client.GetFriendList(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call get friend list rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get friend list rpc server failed"}) - return - } - log.InfoByArgs("call get friend list rpc server success,args=%s", RpcResp.String()) - if RpcResp.ErrorCode == 0 { - friendsInfo := make([]friendInfo, 0) - for _, friend := range RpcResp.Data { - var fi friendInfo - fi.UID = friend.Uid - fi.Name = friend.Name - fi.Icon = friend.Icon - fi.Gender = friend.Gender - fi.Mobile = friend.Mobile - fi.Birth = friend.Birth - fi.Email = friend.Email - fi.Ex = friend.Ex - fi.Comment = friend.Comment - fi.IsInBlackList = friend.IsInBlackList - friendsInfo = append(friendsInfo, fi) - } - resp := gin.H{ - "errCode": RpcResp.ErrorCode, - "errMsg": RpcResp.ErrorMsg, - "data": friendsInfo, - } - c.JSON(http.StatusOK, resp) - } else { - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - } - log.InfoByArgs("api get friend list success return,get args=%s,return=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/get_friends_info.go b/internal/api/friend/get_friends_info.go deleted file mode 100644 index 47ee88a10..000000000 --- a/internal/api/friend/get_friends_info.go +++ /dev/null @@ -1,70 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "fmt" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsSearchFriend struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` - OwnerUid string `json:"ownerUid"` -} - -func GetFriendsInfo(c *gin.Context) { - log.Info("", "", fmt.Sprintf("api search friend init ....")) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsSearchFriend{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.GetFriendsInfoReq{ - Uid: params.UID, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api search_friend is server") - RpcResp, err := client.GetFriendsInfo(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call search friend rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call search friend rpc server failed"}) - return - } - log.InfoByArgs("call search friend rpc server success,args=%s", RpcResp.String()) - if RpcResp.ErrorCode == 0 { - resp := gin.H{ - "errCode": RpcResp.ErrorCode, - "errMsg": RpcResp.ErrorMsg, - "data": gin.H{ - "uid": RpcResp.Data.Uid, - "icon": RpcResp.Data.Icon, - "name": RpcResp.Data.Name, - "gender": RpcResp.Data.Gender, - "mobile": RpcResp.Data.Mobile, - "birth": RpcResp.Data.Birth, - "email": RpcResp.Data.Email, - "ex": RpcResp.Data.Ex, - "comment": RpcResp.Data.Comment, - }, - } - c.JSON(http.StatusOK, resp) - } else { - resp := gin.H{ - "errCode": RpcResp.ErrorCode, - "errMsg": RpcResp.ErrorMsg, - } - c.JSON(http.StatusOK, resp) - } - log.InfoByArgs("api search_friend success return,get args=%s,return=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/is_friend.go b/internal/api/friend/is_friend.go deleted file mode 100644 index e10c969f3..000000000 --- a/internal/api/friend/is_friend.go +++ /dev/null @@ -1,47 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsIsFriend struct { - OperationID string `json:"operationID" binding:"required"` - ReceiveUid string `json:"receive_uid"` -} - -func IsFriend(c *gin.Context) { - log.Info("", "", "api is friend init....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsIsFriend{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.IsFriendReq{ - OperationID: params.OperationID, - ReceiveUid: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api is friend is server") - RpcResp, err := client.IsFriend(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call add friend rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add friend rpc server failed"}) - return - } - log.InfoByArgs("call is friend rpc server success,args=%s", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg, "isFriend": RpcResp.ShipType} - c.JSON(http.StatusOK, resp) - log.InfoByArgs("api is friend success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/remove_blacklist.go b/internal/api/friend/remove_blacklist.go deleted file mode 100644 index 57a018513..000000000 --- a/internal/api/friend/remove_blacklist.go +++ /dev/null @@ -1,47 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsRemoveBlackList struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` -} - -func RemoveBlacklist(c *gin.Context) { - log.Info("", "", "api remove_blacklist init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsRemoveBlackList{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.RemoveBlacklistReq{ - Uid: params.UID, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api remove blacklist is server:userID=%s", req.Uid) - RpcResp, err := client.RemoveBlacklist(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call remove blacklist rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call remove blacklist rpc server failed"}) - return - } - log.InfoByArgs("call remove blacklist rpc server success,args=%s", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - log.InfoByArgs("api remove blacklist success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/friend/set_friend_comment.go b/internal/api/friend/set_friend_comment.go deleted file mode 100644 index e16f7e598..000000000 --- a/internal/api/friend/set_friend_comment.go +++ /dev/null @@ -1,48 +0,0 @@ -package friend - -import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsSetFriendComment struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` - Comment string `json:"comment"` -} - -func SetFriendComment(c *gin.Context) { - log.Info("", "", "api set friend comment init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - //defer etcdConn.Close() - - params := paramsSetFriendComment{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbFriend.SetFriendCommentReq{ - Uid: params.UID, - OperationID: params.OperationID, - Comment: params.Comment, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api set friend comment is server") - RpcResp, err := client.SetFriendComment(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call set friend comment rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call set friend comment rpc server failed"}) - return - } - log.Info("", "", "call set friend comment rpc server success,args=%s", RpcResp.String()) - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) - log.Info("", "", "api set friend comment success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/group/create_group.go b/internal/api/group/create_group.go deleted file mode 100644 index fd9cc14f7..000000000 --- a/internal/api/group/create_group.go +++ /dev/null @@ -1,61 +0,0 @@ -package group - -import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsCreateGroupStruct struct { - MemberList []*pb.GroupAddMemberInfo `json:"memberList"` - GroupName string `json:"groupName"` - Introduction string `json:"introduction"` - Notification string `json:"notification"` - FaceUrl string `json:"faceUrl"` - OperationID string `json:"operationID" binding:"required"` - Ex string `json:"ex"` -} - -func CreateGroup(c *gin.Context) { - log.Info("", "", "api create group init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsCreateGroupStruct{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pb.CreateGroupReq{ - MemberList: params.MemberList, - GroupName: params.GroupName, - Introduction: params.Introduction, - Notification: params.Notification, - FaceUrl: params.FaceUrl, - OperationID: params.OperationID, - Ex: params.Ex, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api create group is server,params=%s", req.String()) - RpcResp, err := client.CreateGroup(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call create group rpc server failed", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) - return - } - log.InfoByArgs("call create group rpc server success,args=%s", RpcResp.String()) - if RpcResp.ErrorCode == 0 { - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg, "data": gin.H{"groupID": RpcResp.GroupID}} - c.JSON(http.StatusOK, resp) - } else { - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) - } - log.InfoByArgs("api create group success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/group/get_group_applicationList.go b/internal/api/group/get_group_applicationList.go deleted file mode 100644 index faceb921e..000000000 --- a/internal/api/group/get_group_applicationList.go +++ /dev/null @@ -1,113 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsGroupApplicationList struct { - OperationID string `json:"operationID" binding:"required"` -} - -func newUserRegisterReq(params *paramsGroupApplicationList) *group.GetGroupApplicationListReq { - pbData := group.GetGroupApplicationListReq{ - OperationID: params.OperationID, - } - return &pbData -} - -type paramsGroupApplicationListRet struct { - ID string `json:"id"` - GroupID string `json:"groupID"` - FromUserID string `json:"fromUserID"` - ToUserID string `json:"toUserID"` - Flag int32 `json:"flag"` - RequestMsg string `json:"reqMsg"` - HandledMsg string `json:"handledMsg"` - AddTime int64 `json:"createTime"` - FromUserNickname string `json:"fromUserNickName"` - ToUserNickname string `json:"toUserNickName"` - FromUserFaceUrl string `json:"fromUserFaceURL"` - ToUserFaceUrl string `json:"toUserFaceURL"` - HandledUser string `json:"handledUser"` - Type int32 `json:"type"` - HandleStatus int32 `json:"handleStatus"` - HandleResult int32 `json:"handleResult"` -} - -func GetGroupApplicationList(c *gin.Context) { - log.Info("", "", "api GetGroupApplicationList init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := group.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsGroupApplicationList{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - pbData := newUserRegisterReq(¶ms) - - token := c.Request.Header.Get("token") - if claims, err := utils.ParseToken(token); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) - return - } else { - pbData.UID = claims.UID - } - - log.Info("", "", "api GetGroupApplicationList is server, [data: %s]", pbData.String()) - reply, err := client.GetGroupApplicationList(context.Background(), pbData) - if err != nil { - log.Error("", "", "api GetGroupApplicationList call rpc fail, [data: %s] [err: %s]", pbData.String(), err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) - return - } - log.Info("", "", "api GetGroupApplicationList call rpc success, [data: %s] [reply: %s]", pbData.String(), reply.String()) - - unProcessCount := 0 - userReq := make([]paramsGroupApplicationListRet, 0) - if reply != nil && reply.Data != nil && reply.Data.User != nil { - for i := 0; i < len(reply.Data.User); i++ { - req := paramsGroupApplicationListRet{} - req.ID = reply.Data.User[i].ID - req.GroupID = reply.Data.User[i].GroupID - req.FromUserID = reply.Data.User[i].FromUserID - req.ToUserID = reply.Data.User[i].ToUserID - req.Flag = reply.Data.User[i].Flag - req.RequestMsg = reply.Data.User[i].RequestMsg - req.HandledMsg = reply.Data.User[i].HandledMsg - req.AddTime = reply.Data.User[i].AddTime - req.FromUserNickname = reply.Data.User[i].FromUserNickname - req.ToUserNickname = reply.Data.User[i].ToUserNickname - req.FromUserFaceUrl = reply.Data.User[i].FromUserFaceUrl - req.ToUserFaceUrl = reply.Data.User[i].ToUserFaceUrl - req.HandledUser = reply.Data.User[i].HandledUser - req.Type = reply.Data.User[i].Type - req.HandleStatus = reply.Data.User[i].HandleStatus - req.HandleResult = reply.Data.User[i].HandleResult - userReq = append(userReq, req) - - if req.Flag == 0 { - unProcessCount++ - } - } - } - - c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - "data": gin.H{ - "count": unProcessCount, - "user": userReq, - }, - }) - -} diff --git a/internal/api/group/get_groups_info.go b/internal/api/group/get_groups_info.go deleted file mode 100644 index b2825485a..000000000 --- a/internal/api/group/get_groups_info.go +++ /dev/null @@ -1,67 +0,0 @@ -package group - -import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsGetGroupInfo struct { - GroupIDList []string `json:"groupIDList" binding:"required"` - OperationID string `json:"operationID" binding:"required"` -} - -func GetGroupsInfo(c *gin.Context) { - log.Info("", "", "api get groups info init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsGetGroupInfo{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pb.GetGroupsInfoReq{ - GroupIDList: params.GroupIDList, - Token: c.Request.Header.Get("token"), - OperationID: params.OperationID, - } - log.Info(req.Token, req.OperationID, "get groups info is server,params=%s", req.String()) - RpcResp, err := client.GetGroupsInfo(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "call get groups info rpc server failed,err=%s", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) - return - } - log.InfoByArgs("call get groups info rpc server success", RpcResp.String()) - if RpcResp.ErrorCode == 0 { - groupsInfo := make([]pb.GroupInfo, 0) - for _, v := range RpcResp.Data { - var groupInfo pb.GroupInfo - groupInfo.GroupId = v.GroupId - groupInfo.GroupName = v.GroupName - groupInfo.Notification = v.Notification - groupInfo.Introduction = v.Introduction - groupInfo.FaceUrl = v.FaceUrl - groupInfo.CreateTime = v.CreateTime - groupInfo.OwnerId = v.OwnerId - groupInfo.MemberCount = v.MemberCount - - groupsInfo = append(groupsInfo, groupInfo) - } - c.JSON(http.StatusOK, gin.H{ - "errCode": RpcResp.ErrorCode, - "errMsg": RpcResp.ErrorMsg, - "data": groupsInfo, - }) - } else { - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) - } -} diff --git a/internal/api/group/group.go b/internal/api/group/group.go index e26d235b2..887a89594 100644 --- a/internal/api/group/group.go +++ b/internal/api/group/group.go @@ -1,351 +1,538 @@ package group import ( - pb "Open_IM/pkg/proto/group" + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/group" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" "context" - "fmt" + "github.com/gin-gonic/gin" + "net/http" "strings" + + jsonData "Open_IM/internal/utils" ) -type InviteUserToGroupReq struct { - GroupID string `json:"groupID" binding:"required"` - UidList []string `json:"uidList" binding:"required"` - Reason string `json:"reason"` - OperationID string `json:"operationID" binding:"required"` -} - -type GetJoinedGroupListReq struct { - OperationID string `json:"operationID" binding:"required"` -} - -type KickGroupMemberReq struct { - GroupID string `json:"groupID"` - UidListInfo []*pb.GroupMemberFullInfo `json:"uidListInfo" binding:"required"` - Reason string `json:"reason"` - OperationID string `json:"operationID" binding:"required"` -} - func KickGroupMember(c *gin.Context) { - log.Info("", "", "KickGroupMember start....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - - params := KickGroupMemberReq{} + params := api.KickGroupMemberReq{} if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - req := &pb.KickGroupMemberReq{ - OperationID: params.OperationID, - GroupID: params.GroupID, - Token: c.Request.Header.Get("token"), - - UidListInfo: params.UidListInfo, + req := &rpc.KickGroupMemberReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return } - log.Info(req.Token, req.OperationID, "recv req: ", req.String()) + log.NewInfo(req.OperationID, "KickGroupMember args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.KickGroupMember(context.Background(), req) if err != nil { - log.Error(req.Token, req.OperationID, "GetGroupMemberList failed, err: ", err.Error()) + log.NewError(req.OperationID, "GetGroupMemberList failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) return } - type KickGroupMemberResp struct { - ErrorCode int32 `json:"errCode"` - ErrorMsg string `json:"errMsg"` - Data []Id2Result `json:"data"` + var memberListResp api.KickGroupMemberResp + memberListResp.ErrMsg = RpcResp.ErrMsg + memberListResp.ErrCode = RpcResp.ErrCode + for _, v := range RpcResp.Id2ResultList { + memberListResp.UserIDResultList = append(memberListResp.UserIDResultList, &api.UserIDResult{UserID: v.UserID, Result: v.Result}) + } + if len(memberListResp.UserIDResultList) == 0 { + memberListResp.UserIDResultList = []*api.UserIDResult{} } - var memberListResp KickGroupMemberResp - memberListResp.ErrorMsg = RpcResp.ErrorMsg - memberListResp.ErrorCode = RpcResp.ErrorCode - for _, v := range RpcResp.Id2Result { - memberListResp.Data = append(memberListResp.Data, - Id2Result{UId: v.UId, - Result: v.Result}) - } + log.NewInfo(req.OperationID, "KickGroupMember api return ", memberListResp) c.JSON(http.StatusOK, memberListResp) } -type GetGroupMembersInfoReq struct { - GroupID string `json:"groupID"` - MemberList []string `json:"memberList"` - OperationID string `json:"operationID"` -} -type GetGroupMembersInfoResp struct { - ErrorCode int32 `json:"errCode"` - ErrorMsg string `json:"errMsg"` - Data []MemberResult `json:"data"` -} - func GetGroupMembersInfo(c *gin.Context) { - log.Info("", "", "GetGroupMembersInfo start....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - - params := GetGroupMembersInfoReq{} + params := api.GetGroupMembersInfoReq{} if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - - req := &pb.GetGroupMembersInfoReq{ - OperationID: params.OperationID, - GroupID: params.GroupID, - MemberList: params.MemberList, - Token: c.Request.Header.Get("token"), + req := &rpc.GetGroupMembersInfoReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + //c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + api.SetErrCodeMsg(c, http.StatusInternalServerError) + return } - log.Info(req.Token, req.OperationID, "recv req: ", len(params.MemberList)) + log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupMembersInfo(context.Background(), req) if err != nil { - log.Error(req.Token, req.OperationID, "GetGroupMemberList failed, err: ", err.Error()) + log.NewError(req.OperationID, "GetGroupMemberList failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) return } - var memberListResp GetGroupMembersInfoResp - memberListResp.ErrorMsg = RpcResp.ErrorMsg - memberListResp.ErrorCode = RpcResp.ErrorCode - for _, v := range RpcResp.MemberList { - memberListResp.Data = append(memberListResp.Data, - MemberResult{GroupId: req.GroupID, - UserId: v.UserId, - Role: v.Role, - JoinTime: uint64(v.JoinTime), - Nickname: v.NickName, - FaceUrl: v.FaceUrl}) - } + memberListResp := api.GetGroupMembersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, MemberList: RpcResp.MemberList} + memberListResp.Data = jsonData.JsonDataList(RpcResp.MemberList) + log.NewInfo(req.OperationID, "GetGroupMembersInfo api return ", memberListResp) c.JSON(http.StatusOK, memberListResp) } -type GetGroupMemberListReq struct { - GroupID string `json:"groupID"` - Filter int32 `json:"filter"` - NextSeq int32 `json:"nextSeq"` - OperationID string `json:"operationID"` -} -type getGroupAllMemberReq struct { - GroupID string `json:"groupID"` - OperationID string `json:"operationID"` -} - -type MemberResult struct { - GroupId string `json:"groupID"` - UserId string `json:"userId"` - Role int32 `json:"role"` - JoinTime uint64 `json:"joinTime"` - Nickname string `json:"nickName"` - FaceUrl string `json:"faceUrl"` -} - func GetGroupMemberList(c *gin.Context) { - log.Info("", "", "GetGroupMemberList start....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - - params := GetGroupMemberListReq{} + params := api.GetGroupMemberListReq{} if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - req := &pb.GetGroupMemberListReq{ - OperationID: params.OperationID, - Filter: params.Filter, - NextSeq: params.NextSeq, - GroupID: params.GroupID, - Token: c.Request.Header.Get("token"), + req := &rpc.GetGroupMemberListReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return } - log.Info(req.Token, req.OperationID, "recv req: ", req.String()) + log.NewInfo(req.OperationID, "GetGroupMemberList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.GetGroupMemberList(context.Background(), req) if err != nil { - log.Error(req.Token, req.OperationID, "GetGroupMemberList failed, err: ", err.Error()) + log.NewError(req.OperationID, "GetGroupMemberList failed, ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) return } - type GetGroupMemberListResp struct { - ErrorCode int32 `json:"errCode"` - ErrorMsg string `json:"errMsg"` - NextSeq int32 `json:"nextSeq"` - Data []MemberResult `json:"data"` - } + memberListResp := api.GetGroupMemberListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, MemberList: RpcResp.MemberList, NextSeq: RpcResp.NextSeq} + memberListResp.Data = jsonData.JsonDataList(memberListResp.MemberList) - var memberListResp GetGroupMemberListResp - memberListResp.ErrorMsg = RpcResp.ErrorMsg - memberListResp.ErrorCode = RpcResp.ErrorCode - memberListResp.NextSeq = RpcResp.NextSeq - for _, v := range RpcResp.MemberList { - memberListResp.Data = append(memberListResp.Data, - MemberResult{GroupId: req.GroupID, - UserId: v.UserId, - Role: v.Role, - JoinTime: uint64(v.JoinTime), - Nickname: v.NickName, - FaceUrl: v.FaceUrl}) - } + log.NewInfo(req.OperationID, "GetGroupMemberList api return ", memberListResp) c.JSON(http.StatusOK, memberListResp) - } -func GetGroupAllMember(c *gin.Context) { - log.Info("", "", "GetGroupAllMember start....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - - params := getGroupAllMemberReq{} +func GetGroupAllMemberList(c *gin.Context) { + params := api.GetGroupAllMemberReq{} if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - req := &pb.GetGroupAllMemberReq{ - GroupID: params.GroupID, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), + req := &rpc.GetGroupAllMemberReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return } - log.Info(req.Token, req.OperationID, "recv req: ", req.String()) + log.NewInfo(req.OperationID, "GetGroupAllMember args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupAllMember(context.Background(), req) if err != nil { - log.Error(req.Token, req.OperationID, "GetGroupAllMember failed, err: ", err.Error()) + log.NewError(req.OperationID, "GetGroupAllMember failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) return } - type GetGroupMemberListResp struct { - ErrorCode int32 `json:"errCode"` - ErrorMsg string `json:"errMsg"` - Data []MemberResult `json:"data"` - } - - var memberListResp GetGroupMemberListResp - memberListResp.ErrorMsg = RpcResp.ErrorMsg - memberListResp.ErrorCode = RpcResp.ErrorCode - for _, v := range RpcResp.MemberList { - memberListResp.Data = append(memberListResp.Data, - MemberResult{GroupId: req.GroupID, - UserId: v.UserId, - Role: v.Role, - JoinTime: uint64(v.JoinTime), - Nickname: v.NickName, - FaceUrl: v.FaceUrl}) - } + memberListResp := api.GetGroupAllMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, MemberList: RpcResp.MemberList} + memberListResp.Data = jsonData.JsonDataList(memberListResp.MemberList) + log.NewInfo(req.OperationID, "GetGroupAllMember api return ", memberListResp) c.JSON(http.StatusOK, memberListResp) } -type groupResult struct { - GroupId string `json:"groupId"` - GroupName string `json:"groupName"` - Notification string `json:"notification"` - Introduction string `json:"introduction"` - FaceUrl string `json:"faceUrl"` - OwnerId string `json:"ownerId"` - CreateTime uint64 `json:"createTime"` - MemberCount uint32 `json:"memberCount"` -} - func GetJoinedGroupList(c *gin.Context) { - log.Info("", "", "GetJoinedGroupList start....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - fmt.Println("config: ", etcdConn, config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - - params := GetJoinedGroupListReq{} + params := api.GetJoinedGroupListReq{} if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - req := &pb.GetJoinedGroupListReq{ - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), + req := &rpc.GetJoinedGroupListReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return } - log.Info(req.Token, req.OperationID, "recv req: ", req.String()) + log.NewInfo(req.OperationID, "GetJoinedGroupList args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetJoinedGroupList(context.Background(), req) if err != nil { - log.Error(req.Token, req.OperationID, "GetJoinedGroupList failed, err: ", err.Error()) + log.NewError(req.OperationID, "GetJoinedGroupList failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) return } - log.Info(req.Token, req.OperationID, "GetJoinedGroupList: ", RpcResp) - type GetJoinedGroupListResp struct { - ErrorCode int32 `json:"errCode"` - ErrorMsg string `json:"errMsg"` - Data []groupResult `json:"data"` - } - - var GroupListResp GetJoinedGroupListResp - GroupListResp.ErrorCode = RpcResp.ErrorCode - GroupListResp.ErrorMsg = RpcResp.ErrorMsg - for _, v := range RpcResp.GroupList { - GroupListResp.Data = append(GroupListResp.Data, - groupResult{GroupId: v.GroupId, GroupName: v.GroupName, - Notification: v.Notification, - Introduction: v.Introduction, - FaceUrl: v.FaceUrl, - OwnerId: v.OwnerId, - CreateTime: v.CreateTime, - MemberCount: v.MemberCount}) - } + GroupListResp := api.GetJoinedGroupListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: RpcResp.GroupList} + GroupListResp.Data = jsonData.JsonDataList(GroupListResp.GroupInfoList) + log.NewInfo(req.OperationID, "GetJoinedGroupList api return ", GroupListResp) c.JSON(http.StatusOK, GroupListResp) } -type Id2Result struct { - UId string `json:"uid"` - Result int32 `json:"result"` -} - func InviteUserToGroup(c *gin.Context) { - log.Info("", "", "InviteUserToGroup start....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - - params := InviteUserToGroupReq{} + params := api.InviteUserToGroupReq{} if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - req := &pb.InviteUserToGroupReq{ - OperationID: params.OperationID, - GroupID: params.GroupID, - Reason: params.Reason, - UidList: params.UidList, - Token: c.Request.Header.Get("token"), + req := &rpc.InviteUserToGroupReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return } - log.Info(req.Token, req.OperationID, "recv req: ", req.String()) + log.NewInfo(req.OperationID, "InviteUserToGroup args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.InviteUserToGroup(context.Background(), req) if err != nil { - log.Error(req.Token, req.OperationID, "InviteUserToGroup failed, err: ", err.Error()) + log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), req.String()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) return } - type InviteUserToGroupResp struct { - ErrorCode int32 `json:"errCode"` - ErrorMsg string `json:"errMsg"` - I2R []Id2Result `json:"data"` + resp := api.InviteUserToGroupResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + for _, v := range RpcResp.Id2ResultList { + resp.UserIDResultList = append(resp.UserIDResultList, &api.UserIDResult{UserID: v.UserID, Result: v.Result}) } - var iResp InviteUserToGroupResp - iResp.ErrorMsg = RpcResp.ErrorMsg - iResp.ErrorCode = RpcResp.ErrorCode - for _, v := range RpcResp.Id2Result { - iResp.I2R = append(iResp.I2R, Id2Result{UId: v.UId, Result: v.Result}) + if len(resp.UserIDResultList) == 0 { + resp.UserIDResultList = *new([]*api.UserIDResult) } - //resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg, "data": RpcResp.Id2Result} - c.JSON(http.StatusOK, iResp) + log.NewInfo(req.OperationID, "InviteUserToGroup api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func CreateGroup(c *gin.Context) { + params := api.CreateGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + // + req := &rpc.CreateGroupReq{GroupInfo: &open_im_sdk.GroupInfo{}} + utils.CopyStructFields(req.GroupInfo, ¶ms) + + for _, v := range params.MemberList { + req.InitMemberList = append(req.InitMemberList, &rpc.GroupAddMemberInfo{UserID: v.UserID, RoleLevel: v.RoleLevel}) + } + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + req.OwnerUserID = req.OpUserID + req.OperationID = params.OperationID + log.NewInfo(req.OperationID, "CreateGroup args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.CreateGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "CreateGroup failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + + resp := api.CreateGroupResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + if RpcResp.ErrCode == 0 { + utils.CopyStructFields(&resp.GroupInfo, RpcResp.GroupInfo) + resp.Data = jsonData.JsonDataOne(&resp.GroupInfo) + } + log.NewInfo(req.OperationID, "CreateGroup api return ", resp) + c.JSON(http.StatusOK, resp) +} + +// 群主或管理员收到的 +func GetRecvGroupApplicationList(c *gin.Context) { + params := api.GetGroupApplicationListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetGroupApplicationListReq{} + utils.CopyStructFields(req, params) + //var ok bool + //ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + //if !ok { + // log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + // return + //} + log.NewInfo(req.OperationID, "GetGroupApplicationList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.GetGroupApplicationList(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupApplicationList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.GetGroupApplicationListResp{CommResp: api.CommResp{ErrCode: reply.ErrCode, ErrMsg: reply.ErrMsg}, GroupRequestList: reply.GroupRequestList} + resp.Data = jsonData.JsonDataList(resp.GroupRequestList) + log.NewInfo(req.OperationID, "GetGroupApplicationList api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserReqGroupApplicationList(c *gin.Context) { + var params api.GetUserReqGroupApplicationListReq + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", utils.GetSelfFuncName(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetUserReqApplicationListReq{} + utils.CopyStructFields(req, params) + //ok, req.OpUserID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + //if !ok { + // log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + // return + //} + log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.GetUserReqApplicationList(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupsInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + log.NewInfo(req.OperationID, RpcResp) + resp := api.GetGroupApplicationListResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, GroupRequestList: RpcResp.GroupRequestList} + log.NewInfo(req.OperationID, "GetGroupApplicationList api return ", resp) + resp.Data = jsonData.JsonDataList(resp.GroupRequestList) + c.JSON(http.StatusOK, resp) +} + +func GetGroupsInfo(c *gin.Context) { + params := api.GetGroupInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetGroupsInfoReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.GetGroupsInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupsInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + + resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: RpcResp.GroupInfoList} + resp.Data = jsonData.JsonDataList(resp.GroupInfoList) + log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} + +//process application +func ApplicationGroupResponse(c *gin.Context) { + params := api.ApplicationGroupResponseReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GroupApplicationResponseReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "ApplicationGroupResponse args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.GroupApplicationResponse(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GroupApplicationResponse failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.ApplicationGroupResponseResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "ApplicationGroupResponse api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func JoinGroup(c *gin.Context) { + params := api.JoinGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.JoinGroupReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "JoinGroup args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + + RpcResp, err := client.JoinGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "JoinGroup failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg} + log.NewInfo(req.OperationID, "JoinGroup api return", RpcResp.String()) + c.JSON(http.StatusOK, resp) +} + +func QuitGroup(c *gin.Context) { + params := api.QuitGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.QuitGroupReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "QuitGroup args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.QuitGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call quit group rpc server failed,err=%s", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg} + log.NewInfo(req.OperationID, "QuitGroup api return", RpcResp.String()) + c.JSON(http.StatusOK, resp) +} + +func SetGroupInfo(c *gin.Context) { + params := api.SetGroupInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.SetGroupInfoReq{GroupInfo: &open_im_sdk.GroupInfo{}} + utils.CopyStructFields(req.GroupInfo, ¶ms) + req.OperationID = params.OperationID + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "SetGroupInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.SetGroupInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "SetGroupInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.SetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + c.JSON(http.StatusOK, resp) + log.NewInfo(req.OperationID, "SetGroupInfo api return ", resp) +} + +func TransferGroupOwner(c *gin.Context) { + params := api.TransferGroupOwnerReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.TransferGroupOwnerReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "TransferGroupOwner args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.TransferGroupOwner(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "TransferGroupOwner failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.TransferGroupOwnerResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "TransferGroupOwner api return ", resp) + c.JSON(http.StatusOK, resp) } diff --git a/internal/api/group/group_application_response.go b/internal/api/group/group_application_response.go deleted file mode 100644 index 70dd966eb..000000000 --- a/internal/api/group/group_application_response.go +++ /dev/null @@ -1,87 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsGroupApplicationResponse struct { - OperationID string `json:"operationID" binding:"required"` - GroupID string `json:"groupID" binding:"required"` - FromUserID string `json:"fromUserID" binding:"required"` - FromUserNickName string `json:"fromUserNickName"` - FromUserFaceUrl string `json:"fromUserFaceUrl"` - ToUserID string `json:"toUserID" binding:"required"` - ToUserNickName string `json:"toUserNickName"` - ToUserFaceUrl string `json:"toUserFaceUrl"` - AddTime int64 `json:"addTime"` - RequestMsg string `json:"requestMsg"` - HandledMsg string `json:"handledMsg"` - Type int32 `json:"type"` - HandleStatus int32 `json:"handleStatus"` - HandleResult int32 `json:"handleResult"` -} - -func newGroupApplicationResponse(params *paramsGroupApplicationResponse) *group.GroupApplicationResponseReq { - pbData := group.GroupApplicationResponseReq{ - OperationID: params.OperationID, - GroupID: params.GroupID, - FromUserID: params.FromUserID, - FromUserNickName: params.FromUserNickName, - FromUserFaceUrl: params.FromUserFaceUrl, - ToUserID: params.ToUserID, - ToUserNickName: params.ToUserNickName, - ToUserFaceUrl: params.ToUserFaceUrl, - AddTime: params.AddTime, - RequestMsg: params.RequestMsg, - HandledMsg: params.HandledMsg, - Type: params.Type, - HandleStatus: params.HandleStatus, - HandleResult: params.HandleResult, - } - return &pbData -} - -func ApplicationGroupResponse(c *gin.Context) { - log.Info("", "", "api GroupApplicationResponse init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := group.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsGroupApplicationResponse{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - pbData := newGroupApplicationResponse(¶ms) - - token := c.Request.Header.Get("token") - if claims, err := utils.ParseToken(token); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) - return - } else { - pbData.OwnerID = claims.UID - } - - log.Info("", "", "api GroupApplicationResponse is server, [data: %s]", pbData.String()) - reply, err := client.GroupApplicationResponse(context.Background(), pbData) - if err != nil { - log.Error("", "", "api GroupApplicationResponse call rpc fail, [data: %s] [err: %s]", pbData.String(), err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) - return - } - log.Info("", "", "api GroupApplicationResponse call rpc success, [data: %s] [reply: %s]", pbData.String(), reply.String()) - - c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - }) - -} diff --git a/internal/api/group/join_group.go b/internal/api/group/join_group.go deleted file mode 100644 index 5e85e288e..000000000 --- a/internal/api/group/join_group.go +++ /dev/null @@ -1,47 +0,0 @@ -package group - -import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsJoinGroup struct { - GroupID string `json:"groupID" binding:"required"` - Message string `json:"message"` - OperationID string `json:"operationID" binding:"required"` -} - -func JoinGroup(c *gin.Context) { - log.Info("", "", "api join group init....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsJoinGroup{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pb.JoinGroupReq{ - GroupID: params.GroupID, - Message: params.Message, - Token: c.Request.Header.Get("token"), - OperationID: params.OperationID, - } - log.Info(req.Token, req.OperationID, "api join group is server,params=%s", req.String()) - RpcResp, err := client.JoinGroup(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "call join group rpc server failed,err=%s", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) - return - } - log.InfoByArgs("call join group rpc server success,args=%s", RpcResp.String()) - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) -} diff --git a/internal/api/group/quit_group.go b/internal/api/group/quit_group.go deleted file mode 100644 index 1caea9d0a..000000000 --- a/internal/api/group/quit_group.go +++ /dev/null @@ -1,46 +0,0 @@ -package group - -import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsQuitGroup struct { - GroupID string `json:"groupID" binding:"required"` - OperationID string `json:"operationID" binding:"required"` -} - -func QuitGroup(c *gin.Context) { - log.Info("", "", "api quit group init ....") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsQuitGroup{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pb.QuitGroupReq{ - GroupID: params.GroupID, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.Info(req.Token, req.OperationID, "api quit group is server,params=%s", req.String()) - RpcResp, err := client.QuitGroup(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "call quit group rpc server failed,err=%s", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) - return - } - log.InfoByArgs("call quit group rpc server success,args=%s", RpcResp.String()) - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) - log.InfoByArgs("api quit group success return,get args=%s,return args=%s", req.String(), RpcResp.String()) -} diff --git a/internal/api/group/set_group_info.go b/internal/api/group/set_group_info.go deleted file mode 100644 index 03a3f8c43..000000000 --- a/internal/api/group/set_group_info.go +++ /dev/null @@ -1,53 +0,0 @@ -package group - -import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsSetGroupInfo struct { - GroupID string `json:"groupId" binding:"required"` - GroupName string `json:"groupName"` - Notification string `json:"notification"` - Introduction string `json:"introduction"` - FaceUrl string `json:"faceUrl"` - OperationID string `json:"operationID" binding:"required"` -} - -func SetGroupInfo(c *gin.Context) { - log.Info("", "", "api set group info init...") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pb.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsSetGroupInfo{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pb.SetGroupInfoReq{ - GroupID: params.GroupID, - GroupName: params.GroupName, - Notification: params.Notification, - Introduction: params.Introduction, - FaceUrl: params.FaceUrl, - Token: c.Request.Header.Get("token"), - OperationID: params.OperationID, - } - log.Info(req.Token, req.OperationID, "api set group info is server,params=%s", req.String()) - RpcResp, err := client.SetGroupInfo(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "call set group info rpc server failed,err=%s", err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) - return - } - log.InfoByArgs("call set group info rpc server success,args=%s", RpcResp.String()) - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) -} diff --git a/internal/api/group/transfer_group_owner.go b/internal/api/group/transfer_group_owner.go deleted file mode 100644 index f7baaba3f..000000000 --- a/internal/api/group/transfer_group_owner.go +++ /dev/null @@ -1,65 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsTransferGroupOwner struct { - OperationID string `json:"operationID" binding:"required"` - GroupID string `json:"groupID" binding:"required"` - UID string `json:"uid" binding:"required"` -} - -func newTransferGroupOwnerReq(params *paramsTransferGroupOwner) *group.TransferGroupOwnerReq { - pbData := group.TransferGroupOwnerReq{ - OperationID: params.OperationID, - GroupID: params.GroupID, - NewOwner: params.UID, - } - return &pbData -} - -func TransferGroupOwner(c *gin.Context) { - log.Info("", "", "api TransferGroupOwner init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := group.NewGroupClient(etcdConn) - //defer etcdConn.Close() - - params := paramsTransferGroupOwner{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - pbData := newTransferGroupOwnerReq(¶ms) - - token := c.Request.Header.Get("token") - if claims, err := utils.ParseToken(token); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) - return - } else { - pbData.OldOwner = claims.UID - } - - log.Info("", "", "api TransferGroupOwner is server, [data: %s]", pbData.String()) - reply, err := client.TransferGroupOwner(context.Background(), pbData) - if err != nil { - log.Error("", "", "api TransferGroupOwner call rpc fail, [data: %s] [err: %s]", pbData.String(), err.Error()) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) - return - } - log.Info("", "", "api TransferGroupOwner call rpc success, [data: %s] [reply: %s]", pbData.String(), reply.String()) - - c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - }) - -} diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index a398dce10..8ff3e5906 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -7,11 +7,15 @@ package manage import ( + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/proto/sdk_ws" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" @@ -23,19 +27,7 @@ import ( var validate *validator.Validate -type paramsManagementSendMsg struct { - OperationID string `json:"operationID" binding:"required"` - SendID string `json:"sendID" binding:"required"` - RecvID string `json:"recvID" binding:"required"` - SenderNickName string `json:"senderNickName" ` - SenderFaceURL string `json:"senderFaceURL" ` - ForceList []string `json:"forceList" ` - Content map[string]interface{} `json:"content" binding:"required"` - ContentType int32 `json:"contentType" binding:"required"` - SessionType int32 `json:"sessionType" binding:"required"` -} - -func newUserSendMsgReq(params *paramsManagementSendMsg) *pbChat.UserSendMsgReq { +func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq { var newContent string switch params.ContentType { case constant.Text: @@ -49,31 +41,44 @@ func newUserSendMsgReq(params *paramsManagementSendMsg) *pbChat.UserSendMsgReq { case constant.File: newContent = utils.StructToJsonString(params.Content) default: - } - pbData := pbChat.UserSendMsgReq{ - ReqIdentifier: constant.WSSendMsg, - SendID: params.SendID, - SenderNickName: params.SenderNickName, - SenderFaceURL: params.SenderFaceURL, - OperationID: params.OperationID, - PlatformID: 0, - SessionType: params.SessionType, - MsgFrom: constant.UserMsgType, - ContentType: params.ContentType, - RecvID: params.RecvID, - ForceList: params.ForceList, - Content: newContent, - ClientMsgID: utils.GetMsgID(params.SendID), + var options map[string]bool + if params.IsOnlineOnly { + options = make(map[string]bool, 5) + utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false) + utils.SetSwitchFromOptions(options, constant.IsHistory, false) + utils.SetSwitchFromOptions(options, constant.IsPersistent, false) + utils.SetSwitchFromOptions(options, constant.IsSenderSync, false) + } + pbData := pbChat.SendMsgReq{ + OperationID: params.OperationID, + MsgData: &open_im_sdk.MsgData{ + SendID: params.SendID, + RecvID: params.RecvID, + GroupID: params.GroupID, + ClientMsgID: utils.GetMsgID(params.SendID), + SenderPlatformID: params.SenderPlatformID, + SenderNickname: params.SenderNickname, + SenderFaceURL: params.SenderFaceURL, + SessionType: params.SessionType, + MsgFrom: constant.SysMsgType, + ContentType: params.ContentType, + Content: []byte(newContent), + // ForceList: params.ForceList, + CreateTime: utils.GetCurrentTimestampByMill(), + Options: options, + OfflinePushInfo: params.OfflinePushInfo, + }, } return &pbData } func init() { validate = validator.New() } + func ManagementSendMsg(c *gin.Context) { var data interface{} - params := paramsManagementSendMsg{} + params := ManagementSendMsgReq{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) log.ErrorByKv("json unmarshal err", c.PostForm("operationID"), "err", err.Error(), "content", c.PostForm("content")) @@ -84,8 +89,24 @@ func ManagementSendMsg(c *gin.Context) { data = TextElem{} case constant.Picture: data = PictureElem{} + case constant.Voice: + data = SoundElem{} + case constant.Video: + data = VideoElem{} + case constant.File: + data = FileElem{} + //case constant.AtText: + // data = AtElem{} + //case constant.Merger: + // data = + //case constant.Card: + //case constant.Location: case constant.Custom: data = CustomElem{} + //case constant.Revoke: + //case constant.HasReadReceipt: + //case constant.Typing: + //case constant.Quote: default: c.JSON(http.StatusBadRequest, gin.H{"errCode": 404, "errMsg": "contentType err"}) log.ErrorByKv("contentType err", c.PostForm("operationID"), "content", c.PostForm("content")) @@ -102,7 +123,7 @@ func ManagementSendMsg(c *gin.Context) { } token := c.Request.Header.Get("token") - claims, err := utils.ParseToken(token) + claims, err := token_verify.ParseToken(token) if err != nil { log.NewError(params.OperationID, "parse token failed", err.Error()) c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "parse token failed", "sendTime": 0, "MsgID": ""}) @@ -111,6 +132,19 @@ func ManagementSendMsg(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "not authorized", "sendTime": 0, "MsgID": ""}) return + } + switch params.SessionType { + case constant.SingleChatType: + if len(params.RecvID) == 0 { + log.NewError(params.OperationID, "recvID is a null string") + c.JSON(http.StatusBadRequest, gin.H{"errCode": 405, "errMsg": "recvID is a null string", "sendTime": 0, "MsgID": ""}) + } + case constant.GroupChatType: + if len(params.GroupID) == 0 { + log.NewError(params.OperationID, "groupID is a null string") + c.JSON(http.StatusBadRequest, gin.H{"errCode": 405, "errMsg": "groupID is a null string", "sendTime": 0, "MsgID": ""}) + } + } log.InfoByKv("Ws call success to ManagementSendMsgReq", params.OperationID, "Parameters", params) @@ -122,16 +156,44 @@ func ManagementSendMsg(c *gin.Context) { log.Info("", "", "api ManagementSendMsg call, api call rpc...") - reply, _ := client.UserSendMsg(context.Background(), pbData) - log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) + RpcResp, err := client.SendMsg(context.Background(), pbData) + if err != nil { + log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"}) + return + } + log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) + resp := api.ManagementSendMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, ResultList: server_api_params.UserSendMsgResp{ServerMsgID: RpcResp.ServerMsgID, ClientMsgID: RpcResp.ClientMsgID, SendTime: RpcResp.SendTime}} + log.Info(params.OperationID, "ManagementSendMsg return", resp) + c.JSON(http.StatusOK, resp) - c.JSON(http.StatusOK, gin.H{ - "errCode": reply.ErrCode, - "errMsg": reply.ErrMsg, - "sendTime": reply.SendTime, - "msgID": reply.ClientMsgID, - }) +} +// +//type MergeElem struct { +// Title string `json:"title"` +// AbstractList []string `json:"abstractList"` +// MultiMessage []*MsgStruct `json:"multiMessage"` +//} +// +//type QuoteElem struct { +// Text string `json:"text"` +// QuoteMessage *MsgStruct `json:"quoteMessage"` +//} +type ManagementSendMsgReq struct { + OperationID string `json:"operationID" binding:"required"` + SendID string `json:"sendID" binding:"required"` + RecvID string `json:"recvID" ` + GroupID string `json:"groupID" ` + SenderNickname string `json:"senderNickname" ` + SenderFaceURL string `json:"senderFaceURL" ` + SenderPlatformID int32 `json:"senderPlatformID"` + ForceList []string `json:"forceList" ` + Content map[string]interface{} `json:"content" binding:"required"` + ContentType int32 `json:"contentType" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` + IsOnlineOnly bool `json:"isOnlineOnly"` + OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"` } type PictureBaseInfo struct { @@ -177,12 +239,6 @@ type FileElem struct { FileName string `mapstructure:"fileName"` FileSize int64 `mapstructure:"fileSize"` } - -//type MergeElem struct { -// Title string `json:"title"` -// AbstractList []string `json:"abstractList"` -// MultiMessage []*MsgStruct `json:"multiMessage"` -//} type AtElem struct { Text string `mapstructure:"text"` AtUserList []string `mapstructure:"atUserList"` @@ -201,8 +257,3 @@ type CustomElem struct { type TextElem struct { Text string `mapstructure:"text" validate:"required"` } - -//type QuoteElem struct { -// Text string `json:"text"` -// QuoteMessage *MsgStruct `json:"quoteMessage"` -//} diff --git a/internal/api/manage/management_user.go b/internal/api/manage/management_user.go index cd43fd59b..6ef6f678f 100644 --- a/internal/api/manage/management_user.go +++ b/internal/api/manage/management_user.go @@ -7,72 +7,174 @@ package manage import ( - pbUser "Open_IM/pkg/proto/user" + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbRelay "Open_IM/pkg/proto/relay" + rpc "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" "strings" ) -type paramsDeleteUsers struct { - OperationID string `json:"operationID" binding:"required"` - DeleteUidList []string `json:"deleteUidList" binding:"required"` -} -type paramsGetAllUsersUid struct { - OperationID string `json:"operationID" binding:"required"` -} - func DeleteUser(c *gin.Context) { - params := paramsDeleteUsers{} + params := api.DeleteUsersReq{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - log.InfoByKv("DeleteUser req come here", params.OperationID, "DeleteUidList", params.DeleteUidList) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - //defer etcdConn.Close() - - req := &pbUser.DeleteUsersReq{ - OperationID: params.OperationID, - DeleteUidList: params.DeleteUidList, - Token: c.Request.Header.Get("token"), + req := &rpc.DeleteUsersReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return } + log.NewInfo(params.OperationID, "DeleteUser args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.DeleteUsers(context.Background(), req) if err != nil { - + log.NewError(req.OperationID, "call delete users rpc server failed", err.Error()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call delete users rpc server failed"}) return } - log.InfoByKv("call delete user rpc server is success", params.OperationID, "resp args", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.CommonResp.ErrorCode, "errMsg": RpcResp.CommonResp.ErrorMsg, "failedUidList": RpcResp.FailedUidList} + resp := api.DeleteUsersResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, FailedUserIDList: RpcResp.FailedUserIDList} + if len(RpcResp.FailedUserIDList) == 0 { + resp.FailedUserIDList = []string{} + } + log.NewInfo(req.OperationID, "DeleteUser api return", resp) c.JSON(http.StatusOK, resp) } func GetAllUsersUid(c *gin.Context) { - params := paramsGetAllUsersUid{} + params := api.GetAllUsersUidReq{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - log.InfoByKv("GetAllUsersUid req come here", params.OperationID) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - //defer etcdConn.Close() - - req := &pbUser.GetAllUsersUidReq{ - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - RpcResp, err := client.GetAllUsersUid(context.Background(), req) - if err != nil { - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error(), "uidList": []string{}}) + req := &rpc.GetAllUserIDReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) return } - log.InfoByKv("call GetAllUsersUid rpc server is success", params.OperationID, "resp args", RpcResp.String()) - resp := gin.H{"errCode": RpcResp.CommonResp.ErrorCode, "errMsg": RpcResp.CommonResp.ErrorMsg, "uidList": RpcResp.UidList} + log.NewInfo(params.OperationID, "GetAllUsersUid args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.GetAllUserID(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call GetAllUsersUid users rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call GetAllUsersUid users rpc server failed"}) + return + } + resp := api.GetAllUsersUidResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserIDList: RpcResp.UserIDList} + if len(RpcResp.UserIDList) == 0 { + resp.UserIDList = []string{} + } + log.NewInfo(req.OperationID, "GetAllUsersUid api return", resp) + c.JSON(http.StatusOK, resp) + +} +func AccountCheck(c *gin.Context) { + params := api.AccountCheckReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AccountCheckReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "AccountCheck args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + + RpcResp, err := client.AccountCheck(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call AccountCheck users rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call AccountCheck users rpc server failed"}) + return + } + resp := api.AccountCheckResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, ResultList: RpcResp.ResultList} + if len(RpcResp.ResultList) == 0 { + resp.ResultList = []*rpc.AccountCheckResp_SingleUserStatus{} + } + log.NewInfo(req.OperationID, "AccountCheck api return", resp) + c.JSON(http.StatusOK, resp) +} +func GetUsersOnlineStatus(c *gin.Context) { + params := api.GetUsersOnlineStatusReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &pbRelay.GetUsersOnlineStatusReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "GetUsersOnlineStatus args ", req.String()) + var wsResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult + var respResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult + flag := false + grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + for _, v := range grpcCons { + client := pbRelay.NewOnlineMessageRelayServiceClient(v) + reply, err := client.GetUsersOnlineStatus(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "GetUsersOnlineStatus rpc err", req.String(), err.Error()) + continue + } else { + if reply.ErrCode == 0 { + wsResult = append(wsResult, reply.SuccessResult...) + } + } + } + log.NewInfo(params.OperationID, "call GetUsersOnlineStatus rpc server is success", wsResult) + //Online data merge of each node + for _, v1 := range params.UserIDList { + flag = false + temp := new(pbRelay.GetUsersOnlineStatusResp_SuccessResult) + for _, v2 := range wsResult { + if v2.UserID == v1 { + flag = true + temp.UserID = v1 + temp.Status = constant.OnlineStatus + temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, v2.DetailPlatformStatus...) + } + + } + if !flag { + temp.UserID = v1 + temp.Status = constant.OfflineStatus + } + respResult = append(respResult, temp) + } + resp := api.GetUsersOnlineStatusResp{CommResp: api.CommResp{ErrCode: 0, ErrMsg: ""}, SuccessResult: respResult} + if len(respResult) == 0 { + resp.SuccessResult = []*pbRelay.GetUsersOnlineStatusResp_SuccessResult{} + } + log.NewInfo(req.OperationID, "GetUsersOnlineStatus api return", resp) c.JSON(http.StatusOK, resp) } diff --git a/internal/api/third/ali_oss_credential.go b/internal/api/third/ali_oss_credential.go new file mode 100644 index 000000000..c07cd5d22 --- /dev/null +++ b/internal/api/third/ali_oss_credential.go @@ -0,0 +1,95 @@ +package apiThird + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "fmt" + openapi "github.com/alibabacloud-go/darabonba-openapi/client" + sts20150401 "github.com/alibabacloud-go/sts-20150401/client" + "github.com/alibabacloud-go/tea/tea" + "github.com/fatih/structs" + + //"github.com/fatih/structs" + "github.com/gin-gonic/gin" + "net/http" + "time" +) + +var stsClient *sts20150401.Client + +/** + * 使用AK&SK初始化账号Client + * @param accessKeyId + * @param accessKeySecret + * @return Client + * @throws Exception + */ +func getStsClient() *sts20150401.Client { + if stsClient != nil { + return stsClient + } + conf := &openapi.Config{ + // 您的AccessKey ID + AccessKeyId: tea.String(config.Config.Credential.Ali.AccessKeyID), + // 您的AccessKey Secret + AccessKeySecret: tea.String(config.Config.Credential.Ali.AccessKeySecret), + // Endpoint + Endpoint: tea.String(config.Config.Credential.Ali.StsEndpoint), + } + result, err := sts20150401.NewClient(conf) + if err != nil { + log.NewError("", "alists client初始化失败 ", err) + } + stsClient = result + return stsClient +} + +func AliOSSCredential(c *gin.Context) { + req := api.OSSCredentialReq{} + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "AliOSSCredential args ", userID) + + stsResp, err := getStsClient().AssumeRole(&sts20150401.AssumeRoleRequest{ + DurationSeconds: tea.Int64(config.Config.Credential.Ali.StsDurationSeconds), + Policy: nil, + RoleArn: tea.String(config.Config.Credential.Ali.OssRoleArn), + RoleSessionName: tea.String(fmt.Sprintf("%s-%d", userID, time.Now().Unix())), + }) + + resp := api.OSSCredentialResp{} + if err != nil { + resp.ErrCode = constant.ErrTencentCredential.ErrCode + resp.ErrMsg = err.Error() + } else { + resp = api.OSSCredentialResp{ + CommResp: api.CommResp{}, + OssData: api.OSSCredentialRespData{ + Endpoint: config.Config.Credential.Ali.OssEndpoint, + AccessKeyId: *stsResp.Body.Credentials.AccessKeyId, + AccessKeySecret: *stsResp.Body.Credentials.AccessKeySecret, + Token: *stsResp.Body.Credentials.SecurityToken, + Bucket: config.Config.Credential.Ali.Bucket, + FinalHost: config.Config.Credential.Ali.FinalHost, + }, + Data: nil, + } + } + + resp.Data = structs.Map(&resp.OssData) + log.NewInfo(req.OperationID, "AliOSSCredential return ", resp) + + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/third/minio_init.go b/internal/api/third/minio_init.go new file mode 100644 index 000000000..29338ee77 --- /dev/null +++ b/internal/api/third/minio_init.go @@ -0,0 +1,52 @@ +package apiThird + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "context" + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + url2 "net/url" +) + +func MinioInit() { + minioUrl, err := url2.Parse(config.Config.Credential.Minio.Endpoint) + if err != nil { + log.NewError("", utils.GetSelfFuncName(), "parse failed, please check config/config.yaml", err.Error()) + return + } + minioClient, err := minio.New(minioUrl.Host, &minio.Options{ + Creds: credentials.NewStaticV4(config.Config.Credential.Minio.AccessKeyID, config.Config.Credential.Minio.SecretAccessKey, ""), + Secure: false, + }) + if err != nil { + log.NewError("", utils.GetSelfFuncName(), "init minio client failed", err.Error()) + return + } + opt := minio.MakeBucketOptions{ + Region: config.Config.Credential.Minio.Location, + ObjectLocking: false, + } + err = minioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt) + if err != nil { + log.NewInfo("", utils.GetSelfFuncName(), err.Error()) + exists, err := minioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket) + if err == nil && exists { + log.NewInfo("", utils.GetSelfFuncName(), "We already own %s\n", config.Config.Credential.Minio.Bucket) + } else { + if err != nil { + log.NewError("", utils.GetSelfFuncName(), err.Error()) + } + log.NewError("", utils.GetSelfFuncName(), "create bucket failed and bucket not exists") + return + } + } + // 自动化桶public的代码 + //err = minioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite) + //if err != nil { + // log.NewError("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in ", err.Error()) + // return`z + //} + log.NewInfo("", utils.GetSelfFuncName(), "minio create and set policy success") +} diff --git a/internal/api/third/minio_storage_credential.go b/internal/api/third/minio_storage_credential.go new file mode 100644 index 000000000..f34f64c94 --- /dev/null +++ b/internal/api/third/minio_storage_credential.go @@ -0,0 +1,55 @@ +package apiThird + +import ( + apiStruct "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + _ "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/utils" + "github.com/gin-gonic/gin" + _ "github.com/minio/minio-go/v7" + cr "github.com/minio/minio-go/v7/pkg/credentials" + "net/http" +) + +func MinioStorageCredential(c *gin.Context) { + var ( + req apiStruct.MinioStorageCredentialReq + resp apiStruct.MiniostorageCredentialResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + ok, _ := token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError("", utils.GetSelfFuncName(), "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + var stsOpts cr.STSAssumeRoleOptions + stsOpts.AccessKey = config.Config.Credential.Minio.AccessKeyID + stsOpts.SecretKey = config.Config.Credential.Minio.SecretAccessKey + stsOpts.DurationSeconds = constant.MinioDurationTimes + li, err := cr.NewSTSAssumeRole(config.Config.Credential.Minio.Endpoint, stsOpts) + if err != nil { + log.NewError("", utils.GetSelfFuncName(), "NewSTSAssumeRole failed", err.Error(), stsOpts, config.Config.Credential.Minio.Endpoint) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + v, err := li.Get() + if err != nil { + log.NewError("0", utils.GetSelfFuncName(), "li.Get error", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + resp.SessionToken = v.SessionToken + resp.SecretAccessKey = v.SecretAccessKey + resp.AccessKeyID = v.AccessKeyID + resp.BucketName = config.Config.Credential.Minio.Bucket + resp.StsEndpointURL = config.Config.Credential.Minio.Endpoint + c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data":resp}) +} diff --git a/internal/api/third/tencent_cloud_storage_credential.go b/internal/api/third/tencent_cloud_storage_credential.go index af68d8fd8..d78d03b96 100644 --- a/internal/api/third/tencent_cloud_storage_credential.go +++ b/internal/api/third/tencent_cloud_storage_credential.go @@ -1,50 +1,40 @@ package apiThird import ( + api "Open_IM/pkg/base_info" "Open_IM/pkg/common/config" - log2 "Open_IM/pkg/common/log" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "github.com/fatih/structs" + + //"github.com/fatih/structs" "github.com/gin-gonic/gin" sts "github.com/tencentyun/qcloud-cos-sts-sdk/go" "net/http" "time" ) -type paramsTencentCloudStorageCredential struct { - Token string `json:"token"` - OperationID string `json:"operationID"` -} - -var lastTime int64 -var lastRes *sts.CredentialResult - func TencentCloudStorageCredential(c *gin.Context) { - params := paramsTencentCloudStorageCredential{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "Parameter parsing error,please check the parameters and request service again"}) + req := api.TencentCloudStorageCredentialReq{} + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } - - log2.Info(params.Token, params.OperationID, "api TencentUpLoadCredential call start...") - - if time.Now().Unix()-lastTime < 10 && lastRes != nil { - c.JSON(http.StatusOK, gin.H{ - "errCode": 0, - "errMsg": "", - "region": config.Config.Credential.Tencent.Region, - "bucket": config.Config.Credential.Tencent.Bucket, - "data": lastRes, - }) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) return } - - lastTime = time.Now().Unix() + log.NewInfo(req.OperationID, "TencentCloudStorageCredential args ", userID) cli := sts.NewClient( config.Config.Credential.Tencent.SecretID, config.Config.Credential.Tencent.SecretKey, nil, ) - log2.Info(c.Request.Header.Get("token"), c.PostForm("optionID"), "api TencentUpLoadCredential sts.NewClient cli = %v", cli) opt := &sts.CredentialOptions{ DurationSeconds: int64(time.Hour.Seconds()), @@ -64,29 +54,19 @@ func TencentCloudStorageCredential(c *gin.Context) { }, }, } - log2.Info(c.Request.Header.Get("token"), c.PostForm("optionID"), "api TencentUpLoadCredential sts.CredentialOptions opt = %v", opt) - res, err := cli.GetCredential(opt) + resp := api.TencentCloudStorageCredentialResp{} if err != nil { - log2.Error(c.Request.Header.Get("token"), c.PostForm("optionID"), "api TencentUpLoadCredential cli.GetCredential err = %s", err.Error()) - c.JSON(http.StatusOK, gin.H{ - "errCode": config.ErrTencentCredential.ErrCode, - "errMsg": err.Error(), - "bucket": "", - "region": "", - "data": res, - }) - return + resp.ErrCode = constant.ErrTencentCredential.ErrCode + resp.ErrMsg = err.Error() + } else { + resp.CosData.Bucket = config.Config.Credential.Tencent.Bucket + resp.CosData.Region = config.Config.Credential.Tencent.Region + resp.CosData.CredentialResult = res } - log2.Info(c.Request.Header.Get("token"), c.PostForm("optionID"), "api TencentUpLoadCredential cli.GetCredential success res = %v, res.Credentials = %v", res, res.Credentials) - lastRes = res + resp.Data = structs.Map(&resp.CosData) + log.NewInfo(req.OperationID, "TencentCloudStorageCredential return ", resp) - c.JSON(http.StatusOK, gin.H{ - "errCode": 0, - "errMsg": "", - "region": config.Config.Credential.Tencent.Region, - "bucket": config.Config.Credential.Tencent.Bucket, - "data": res, - }) + c.JSON(http.StatusOK, resp) } diff --git a/internal/api/user/get_user_info.go b/internal/api/user/get_user_info.go deleted file mode 100644 index 4e93787b5..000000000 --- a/internal/api/user/get_user_info.go +++ /dev/null @@ -1,74 +0,0 @@ -package user - -import ( - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type userInfo struct { - UID string `json:"uid"` - Name string `json:"name"` - Icon string `json:"icon"` - Gender int32 `json:"gender"` - Mobile string `json:"mobile"` - Birth string `json:"birth"` - Email string `json:"email"` - Ex string `json:"ex"` -} - -func GetUserInfo(c *gin.Context) { - log.InfoByKv("api get userinfo init...", "") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - //defer etcdConn.Close() - - params := paramsStruct{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbUser.GetUserInfoReq{ - UserIDList: params.UIDList, - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - } - log.InfoByKv("api get user info is server", c.PostForm("OperationID"), c.Request.Header.Get("token")) - RpcResp, err := client.GetUserInfo(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call get user info rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{ - "errorCode": 500, - "errorMsg": "call rpc server failed", - }) - return - } - log.InfoByKv("call get user info rpc server success", params.OperationID) - if RpcResp.ErrorCode == 0 { - userInfoList := make([]userInfo, 0) - for _, user := range RpcResp.Data { - var ui userInfo - ui.UID = user.Uid - ui.Name = user.Name - ui.Icon = user.Icon - ui.Gender = user.Gender - ui.Mobile = user.Mobile - ui.Birth = user.Birth - ui.Email = user.Email - ui.Ex = user.Ex - userInfoList = append(userInfoList, ui) - } - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg, "data": userInfoList} - c.JSON(http.StatusOK, resp) - } else { - resp := gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg} - c.JSON(http.StatusOK, resp) - } - log.InfoByKv("api get user info return success", params.OperationID, "args=%s", RpcResp.String()) -} diff --git a/internal/api/user/update_user_info.go b/internal/api/user/update_user_info.go deleted file mode 100644 index 1bcc32117..000000000 --- a/internal/api/user/update_user_info.go +++ /dev/null @@ -1,62 +0,0 @@ -package user - -import ( - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -type paramsStruct struct { - OperationID string `json:"operationID" binding:"required"` - UIDList []string `json:"uidList"` - Platform int32 `json:"platform"` - Name string `json:"name"` - Icon string `json:"icon"` - Gender int32 `json:"gender"` - Mobile string `json:"mobile"` - Birth string `json:"birth"` - Email string `json:"email"` - Ex string `json:"ex"` - Uid string `json:"uid"` -} - -func UpdateUserInfo(c *gin.Context) { - log.InfoByKv("api update userinfo init...", "") - - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - //defer etcdConn.Close() - - params := paramsStruct{} - if err := c.BindJSON(¶ms); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &pbUser.UpdateUserInfoReq{ - OperationID: params.OperationID, - Token: c.Request.Header.Get("token"), - Name: params.Name, - Icon: params.Icon, - Gender: params.Gender, - Mobile: params.Mobile, - Birth: params.Birth, - Email: params.Email, - Ex: params.Ex, - Uid: params.Uid, - } - log.InfoByKv("api update user info is server", req.OperationID, req.Token) - RpcResp, err := client.UpdateUserInfo(context.Background(), req) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,call get user info rpc server failed", err) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) - return - } - log.InfoByKv("call update user info rpc server success", params.OperationID) - c.JSON(http.StatusOK, gin.H{"errCode": RpcResp.ErrorCode, "errMsg": RpcResp.ErrorMsg}) - log.InfoByKv("api update user info return success", params.OperationID, "args=%s", RpcResp.String()) -} diff --git a/internal/api/user/user.go b/internal/api/user/user.go new file mode 100644 index 000000000..4fa1c62dd --- /dev/null +++ b/internal/api/user/user.go @@ -0,0 +1,129 @@ +package user + +import ( + jsonData "Open_IM/internal/utils" + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + rpc "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func GetUsersInfo(c *gin.Context) { + params := api.GetUsersInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) + return + } + req := &rpc.GetUserInfoReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.GetUserInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + var publicUserInfoList []*open_im_sdk.PublicUserInfo + for _, v := range RpcResp.UserInfoList { + publicUserInfoList = append(publicUserInfoList, + &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) + } + + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + resp.Data = jsonData.JsonDataList(resp.UserInfoList) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func UpdateUserInfo(c *gin.Context) { + params := api.UpdateSelfUserInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.UpdateUserInfoReq{UserInfo: &open_im_sdk.UserInfo{}} + utils.CopyStructFields(req.UserInfo, ¶ms) + + req.OperationID = params.OperationID + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "UpdateUserInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.UpdateUserInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetSelfUserInfo(c *gin.Context) { + params := api.GetSelfUserInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) + return + } + req := &rpc.GetUserInfoReq{} + + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + req.UserIDList = append(req.UserIDList, req.OpUserID) + log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.GetUserInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + if len(RpcResp.UserInfoList) == 1 { + resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]} + resp.Data = jsonData.JsonDataOne(resp.UserInfo) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + } else { + resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + } + +} diff --git a/internal/cms_api/admin/admin.go b/internal/cms_api/admin/admin.go new file mode 100644 index 000000000..02b2390c5 --- /dev/null +++ b/internal/cms_api/admin/admin.go @@ -0,0 +1,42 @@ +package admin + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAdmin "Open_IM/pkg/proto/admin_cms" + "Open_IM/pkg/utils" + "context" + "strings" + + "github.com/gin-gonic/gin" +) + +// register +func AdminLogin(c *gin.Context) { + var ( + req cms_api_struct.AdminLoginRequest + resp cms_api_struct.AdminLoginResponse + reqPb pbAdmin.AdminLoginReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewInfo("0", utils.GetSelfFuncName(), err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.Secret = req.Secret + reqPb.AdminID = req.AdminName + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAdminCMSName) + client := pbAdmin.NewAdminCMSClient(etcdConn) + respPb, err := client.AdminLogin(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.Token = respPb.Token + openIMHttp.RespHttp200(c, constant.OK, resp) +} diff --git a/internal/cms_api/group/group.go b/internal/cms_api/group/group.go new file mode 100644 index 000000000..c7013c2bd --- /dev/null +++ b/internal/cms_api/group/group.go @@ -0,0 +1,449 @@ +package group + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" + + pbGroup "Open_IM/pkg/proto/group" + + "github.com/gin-gonic/gin" +) + +func GetGroupById(c *gin.Context) { + var ( + req cms_api_struct.GetGroupByIdRequest + resp cms_api_struct.GetGroupByIdResponse + reqPb pbGroup.GetGroupByIdReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroupById(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupById failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.GroupName = respPb.CMSGroup.GroupInfo.GroupName + resp.GroupID = respPb.CMSGroup.GroupInfo.GroupID + resp.CreateTime = (utils.UnixSecondToTime(int64(respPb.CMSGroup.GroupInfo.CreateTime))).String() + resp.ProfilePhoto = respPb.CMSGroup.GroupInfo.FaceURL + resp.GroupMasterName = respPb.CMSGroup.GroupMasterName + resp.GroupMasterId = respPb.CMSGroup.GroupMasterId + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetGroups(c *gin.Context) { + var ( + req cms_api_struct.GetGroupsRequest + resp cms_api_struct.GetGroupsResponse + reqPb pbGroup.GetGroupsReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.Pagination = &commonPb.RequestPagination{} + utils.CopyStructFields(&reqPb.Pagination, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroups(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + for _, v := range respPb.CMSGroups { + resp.Groups = append(resp.Groups, cms_api_struct.GroupResponse{ + GroupName: v.GroupInfo.GroupName, + GroupID: v.GroupInfo.GroupID, + GroupMasterName: v.GroupMasterName, + GroupMasterId: v.GroupMasterId, + CreateTime: (utils.UnixSecondToTime(int64(v.GroupInfo.CreateTime))).String(), + IsBanChat: false, + IsBanPrivateChat: false, + ProfilePhoto: v.GroupInfo.FaceURL, + }) + } + resp.GroupNums = int(respPb.GroupNum) + resp.CurrentPage = int(respPb.Pagination.PageNumber) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetGroupByName(c *gin.Context) { + var ( + req cms_api_struct.GetGroupRequest + resp cms_api_struct.GetGroupResponse + reqPb pbGroup.GetGroupReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupName = req.GroupName + reqPb.Pagination = &commonPb.RequestPagination{} + utils.CopyStructFields(&reqPb.Pagination, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroup(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroup failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrServer, nil) + return + } + for _, v := range respPb.CMSGroups { + resp.Groups = append(resp.Groups, cms_api_struct.GroupResponse{ + GroupName: v.GroupInfo.GroupName, + GroupID: v.GroupInfo.GroupID, + GroupMasterName: v.GroupMasterName, + GroupMasterId: v.GroupMasterId, + CreateTime: (utils.UnixSecondToTime(int64(v.GroupInfo.CreateTime))).String(), + IsBanChat: false, + IsBanPrivateChat: false, + ProfilePhoto: v.GroupInfo.FaceURL, + }) + } + resp.CurrentPage = int(respPb.Pagination.PageNumber) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.GroupNums = int(respPb.GroupNums) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func CreateGroup(c *gin.Context) { + var ( + req cms_api_struct.CreateGroupRequest + _ cms_api_struct.CreateGroupResponse + reqPb pbGroup.CreateGroupReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupInfo = &commonPb.GroupInfo{} + reqPb.GroupInfo.GroupName = req.GroupName + reqPb.GroupInfo.CreatorUserID = req.GroupMasterId + reqPb.OwnerUserID = req.GroupMasterId + reqPb.OpUserID = req.GroupMasterId + for _, v := range req.GroupMembers { + reqPb.InitMemberList = append(reqPb.InitMemberList, &pbGroup.GroupAddMemberInfo{ + UserID: v, + RoleLevel: 1, + }) + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.CreateGroup(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "CreateGroup failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrServer, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func BanGroupChat(c *gin.Context) { + var ( + req cms_api_struct.BanGroupChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupBanChat + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BanGroupChat failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) + +} + +func BanPrivateChat(c *gin.Context) { + var ( + req cms_api_struct.BanPrivateChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupBanPrivateChat + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func OpenGroupChat(c *gin.Context) { + var ( + req cms_api_struct.BanPrivateChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupOk + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func OpenPrivateChat(c *gin.Context) { + var ( + req cms_api_struct.BanPrivateChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OpenPrivateChat failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupOk + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func GetGroupMembers(c *gin.Context) { + var ( + req cms_api_struct.GetGroupMembersRequest + reqPb pbGroup.GetGroupMembersCMSReq + resp cms_api_struct.GetGroupMembersResponse + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.Pagination = &commonPb.RequestPagination{ + PageNumber: int32(req.PageNumber), + ShowNumber: int32(req.ShowNumber), + } + reqPb.GroupId = req.GroupId + reqPb.UserName = req.UserName + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroupMembersCMS(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupMembersCMS failed:", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.ResponsePagination = cms_api_struct.ResponsePagination{ + CurrentPage: int(respPb.Pagination.CurrentPage), + ShowNumber: int(respPb.Pagination.ShowNumber), + } + resp.MemberNums = int(respPb.MemberNums) + for _, groupMembers := range respPb.Members { + resp.GroupMembers = append(resp.GroupMembers, cms_api_struct.GroupMemberResponse{ + MemberPosition: int(groupMembers.RoleLevel), + MemberNickName: groupMembers.Nickname, + MemberId: groupMembers.UserID, + JoinTime: utils.UnixSecondToTime(int64(groupMembers.JoinTime)).String(), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func AddGroupMembers(c *gin.Context) { + var ( + req cms_api_struct.RemoveGroupMembersRequest + resp cms_api_struct.RemoveGroupMembersResponse + reqPb pbGroup.AddGroupMembersCMSReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationId, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserIds = req.Members + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.AddGroupMembersCMS(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationId, utils.GetSelfFuncName(), "AddGroupMembersCMS failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.Success = respPb.Success + resp.Failed = respPb.Failed + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func RemoveGroupMembers(c *gin.Context) { + var ( + req cms_api_struct.RemoveGroupMembersRequest + resp cms_api_struct.RemoveGroupMembersResponse + reqPb pbGroup.RemoveGroupMembersCMSReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserIds = req.Members + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.RemoveGroupMembersCMS(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "RemoveGroupMembersCMS failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.Success = respPb.Success + resp.Failed = respPb.Failed + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func DeleteGroup(c *gin.Context) { + var ( + req cms_api_struct.DeleteGroupRequest + _ cms_api_struct.DeleteGroupResponse + reqPb pbGroup.DeleteGroupReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.DeleteGroup(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func SetGroupMaster(c *gin.Context) { + var ( + req cms_api_struct.SetGroupMasterRequest + _ cms_api_struct.SetGroupMasterResponse + reqPb pbGroup.OperateUserRoleReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.UserId = req.UserId + reqPb.RoleLevel = constant.GroupOwner + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateUserRole(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrServer, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func SetGroupOrdinaryUsers(c *gin.Context) { + var ( + req cms_api_struct.SetGroupMemberRequest + _ cms_api_struct.AdminLoginResponse + reqPb pbGroup.OperateUserRoleReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.UserId = req.UserId + reqPb.RoleLevel = constant.GroupOrdinaryUsers + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateUserRole(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func AlterGroupInfo(c *gin.Context) { + var ( + req cms_api_struct.AlterGroupInfoRequest + _ cms_api_struct.SetGroupMasterResponse + reqPb pbGroup.SetGroupInfoReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.OpUserID = c.MustGet("userID").(string) + reqPb.GroupInfo = &commonPb.GroupInfo{ + GroupID: req.GroupID, + GroupName: req.GroupName, + Introduction: req.Introduction, + Notification: req.Notification, + FaceURL: req.ProfilePhoto, + GroupType: int32(req.GroupType), + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.SetGroupInfo(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} diff --git a/internal/cms_api/message_cms/message.go b/internal/cms_api/message_cms/message.go new file mode 100644 index 000000000..c5ced390e --- /dev/null +++ b/internal/cms_api/message_cms/message.go @@ -0,0 +1,109 @@ +package messageCMS + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMessage "Open_IM/pkg/proto/message_cms" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" + + "Open_IM/pkg/common/constant" + + "github.com/gin-gonic/gin" +) + +func BroadcastMessage(c *gin.Context) { + var ( + reqPb pbMessage.BoradcastMessageReq + ) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + _, err := client.BoradcastMessage(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func MassSendMassage(c *gin.Context) { + var ( + reqPb pbMessage.MassSendMessageReq + ) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + _, err := client.MassSendMessage(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func WithdrawMessage(c *gin.Context) { + var ( + reqPb pbMessage.WithdrawMessageReq + ) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + _, err := client.WithdrawMessage(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func GetChatLogs(c *gin.Context) { + var ( + req cms_api_struct.GetChatLogsRequest + resp cms_api_struct.GetChatLogsResponse + reqPb pbMessage.GetChatLogsReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: int32(req.PageNumber), + ShowNumber: int32(req.ShowNumber), + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + respPb, err := client.GetChatLogs(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, resp) + return + } + //utils.CopyStructFields(&resp, &respPb) + for _, chatLog := range respPb.ChatLogs { + resp.ChatLogs = append(resp.ChatLogs, cms_api_struct.ChatLog{ + SessionType: int(chatLog.SessionType), + ContentType: int(chatLog.ContentType), + SenderNickName: chatLog.SenderNickName, + SenderId: chatLog.SenderId, + SearchContent: chatLog.SearchContent, + WholeContent: chatLog.WholeContent, + ReceiverNickName: chatLog.ReciverNickName, + ReceiverID: chatLog.ReciverId, + GroupName: chatLog.GroupName, + GroupId: chatLog.GroupId, + Date: chatLog.Date, + }) + } + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.ChatLogsNum = int(respPb.ChatLogsNum) + openIMHttp.RespHttp200(c, constant.OK, resp) +} diff --git a/internal/cms_api/middleware/cors.go b/internal/cms_api/middleware/cors.go new file mode 100644 index 000000000..139a001af --- /dev/null +++ b/internal/cms_api/middleware/cors.go @@ -0,0 +1,23 @@ +package middleware + +import ( + "github.com/gin-gonic/gin" + "net/http" +) + +func CorsHandler() gin.HandlerFunc { + return func(context *gin.Context) { + context.Writer.Header().Set("Access-Control-Allow-Origin", "*") + context.Header("Access-Control-Allow-Methods", "*") + context.Header("Access-Control-Allow-Headers", "*") + context.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers,Cache-Control,Content-Language,Content-Type,Expires,Last-Modified,Pragma,FooBar") // 跨域关键设置 让浏览器可以解析 + context.Header("Access-Control-Max-Age", "172800") // 缓存请求信息 单位为秒 + context.Header("Access-Control-Allow-Credentials", "false") // 跨域请求是否需要带cookie信息 默认设置为true + context.Header("content-type", "application/json") // 设置返回格式是json + //Release all option pre-requests + if context.Request.Method == http.MethodOptions { + context.JSON(http.StatusOK, "Options Request!") + } + context.Next() + } +} diff --git a/internal/cms_api/middleware/jwt_auth.go b/internal/cms_api/middleware/jwt_auth.go new file mode 100644 index 000000000..f245fc4ad --- /dev/null +++ b/internal/cms_api/middleware/jwt_auth.go @@ -0,0 +1,24 @@ +package middleware + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/utils" + "github.com/gin-gonic/gin" +) + +func JWTAuth() gin.HandlerFunc { + return func(c *gin.Context) { + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + log.NewInfo("0", utils.GetSelfFuncName(), "userID: ", userID) + c.Set("userID", userID) + if !ok { + log.NewError("","GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.Abort() + http.RespHttp200(c, constant.ErrParseToken, nil) + return + } + } +} diff --git a/internal/cms_api/organization/organization.go b/internal/cms_api/organization/organization.go new file mode 100644 index 000000000..f775283ca --- /dev/null +++ b/internal/cms_api/organization/organization.go @@ -0,0 +1,49 @@ +package organization + +import ( + "github.com/gin-gonic/gin" +) + +func GetStaffs(c *gin.Context) { + +} + +func GetOrganizations(c *gin.Context) { + +} + +func GetSquads(c *gin.Context) { + +} + +func AlterStaff(c *gin.Context) { + +} + +func AddOrganization(c *gin.Context) { + +} + +func InquireOrganization(g *gin.Context) { + +} + +func AlterOrganization(c *gin.Context) { + +} + +func DeleteOrganization(g *gin.Context) { + +} + +func GetOrganizationSquads(c *gin.Context) { + +} + +func AlterStaffsInfo(c *gin.Context) { + +} + +func AddChildOrganization(c *gin.Context) { + +} diff --git a/internal/cms_api/router.go b/internal/cms_api/router.go new file mode 100644 index 000000000..941cc5bf5 --- /dev/null +++ b/internal/cms_api/router.go @@ -0,0 +1,95 @@ +package cms_api + +import ( + "Open_IM/internal/cms_api/admin" + "Open_IM/internal/cms_api/group" + messageCMS "Open_IM/internal/cms_api/message_cms" + "Open_IM/internal/cms_api/middleware" + "Open_IM/internal/cms_api/organization" + "Open_IM/internal/cms_api/statistics" + "Open_IM/internal/cms_api/user" + + "github.com/gin-gonic/gin" +) + +func NewGinRouter() *gin.Engine { + gin.SetMode(gin.ReleaseMode) + baseRouter := gin.Default() + router := baseRouter.Group("/api") + router.Use(middleware.CorsHandler()) + adminRouterGroup := router.Group("/admin") + { + adminRouterGroup.POST("/login", admin.AdminLogin) + } + r2 := router.Group("") + r2.Use(middleware.JWTAuth()) + statisticsRouterGroup := r2.Group("/statistics") + { + statisticsRouterGroup.GET("/get_messages_statistics", statistics.GetMessagesStatistics) + statisticsRouterGroup.GET("/get_user_statistics", statistics.GetUserStatistics) + statisticsRouterGroup.GET("/get_group_statistics", statistics.GetGroupStatistics) + statisticsRouterGroup.GET("/get_active_user", statistics.GetActiveUser) + statisticsRouterGroup.GET("/get_active_group", statistics.GetActiveGroup) + } + organizationRouterGroup := r2.Group("/organization") + { + organizationRouterGroup.GET("/get_staffs", organization.GetStaffs) + organizationRouterGroup.GET("/get_organizations", organization.GetOrganizations) + organizationRouterGroup.GET("/get_squad", organization.GetSquads) + organizationRouterGroup.POST("/add_organization", organization.AddOrganization) + organizationRouterGroup.POST("/alter_staff", organization.AlterStaff) + organizationRouterGroup.GET("/inquire_organization", organization.InquireOrganization) + organizationRouterGroup.POST("/alter_organization", organization.AlterOrganization) + organizationRouterGroup.POST("/delete_organization", organization.DeleteOrganization) + organizationRouterGroup.POST("/get_organization_squad", organization.GetOrganizationSquads) + organizationRouterGroup.PATCH("/alter_corps_info", organization.AlterStaffsInfo) + organizationRouterGroup.POST("/add_child_org", organization.AddChildOrganization) + } + groupRouterGroup := r2.Group("/group") + { + groupRouterGroup.GET("/get_group_by_id", group.GetGroupById) + groupRouterGroup.GET("/get_groups", group.GetGroups) + groupRouterGroup.GET("/get_group_by_name", group.GetGroupByName) + groupRouterGroup.GET("/get_group_members", group.GetGroupMembers) + groupRouterGroup.POST("/create_group", group.CreateGroup) + groupRouterGroup.POST("/add_members", group.AddGroupMembers) + groupRouterGroup.POST("/remove_members", group.RemoveGroupMembers) + groupRouterGroup.POST("/ban_group_private_chat", group.BanPrivateChat) + groupRouterGroup.POST("/open_group_private_chat", group.OpenPrivateChat) + groupRouterGroup.POST("/ban_group_chat", group.BanGroupChat) + groupRouterGroup.POST("/open_group_chat", group.OpenGroupChat) + groupRouterGroup.POST("/delete_group", group.DeleteGroup) + groupRouterGroup.POST("/get_members_in_group", group.GetGroupMembers) + groupRouterGroup.POST("/set_group_master", group.SetGroupMaster) + groupRouterGroup.POST("/set_group_ordinary_user", group.SetGroupOrdinaryUsers) + groupRouterGroup.POST("/alter_group_info", group.AlterGroupInfo) + } + userRouterGroup := r2.Group("/user") + { + userRouterGroup.POST("/resign", user.ResignUser) + userRouterGroup.GET("/get_user", user.GetUserById) + userRouterGroup.POST("/alter_user", user.AlterUser) + userRouterGroup.GET("/get_users", user.GetUsers) + userRouterGroup.POST("/add_user", user.AddUser) + userRouterGroup.POST("/unblock_user", user.UnblockUser) + userRouterGroup.POST("/block_user", user.BlockUser) + userRouterGroup.GET("/get_block_users", user.GetBlockUsers) + userRouterGroup.GET("/get_block_user", user.GetBlockUserById) + userRouterGroup.POST("/delete_user", user.DeleteUser) + userRouterGroup.GET("/get_users_by_name", user.GetUsersByName) + } + friendRouterGroup := r2.Group("/friend") + { + friendRouterGroup.POST("/get_friends_by_id") + friendRouterGroup.POST("/set_friend") + friendRouterGroup.POST("/remove_friend") + } + messageCMSRouterGroup := r2.Group("/message") + { + messageCMSRouterGroup.GET("/get_chat_logs", messageCMS.GetChatLogs) + messageCMSRouterGroup.POST("/broadcast_message", messageCMS.BroadcastMessage) + messageCMSRouterGroup.POST("/mass_send_message", messageCMS.MassSendMassage) + messageCMSRouterGroup.POST("/withdraw_message", messageCMS.WithdrawMessage) + } + return baseRouter +} diff --git a/internal/cms_api/statistics/statistics.go b/internal/cms_api/statistics/statistics.go new file mode 100644 index 000000000..c8a9488ca --- /dev/null +++ b/internal/cms_api/statistics/statistics.go @@ -0,0 +1,224 @@ +package statistics + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/statistics" + "Open_IM/pkg/utils" + "context" + "strings" + + "github.com/gin-gonic/gin" +) + +func GetMessagesStatistics(c *gin.Context) { + var ( + req cms_api_struct.GetMessageStatisticsRequest + resp cms_api_struct.GetMessageStatisticsResponse + reqPb pb.GetMessageStatisticsReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetMessageStatistics(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetMessageStatistics failed", err.Error()) + openIMHttp.RespHttp200(c, err, resp) + return + } + // utils.CopyStructFields(&resp, respPb) + resp.GroupMessageNum = int(respPb.GroupMessageNum) + resp.PrivateMessageNum = int(respPb.PrivateMessageNum) + for _, v := range respPb.PrivateMessageNumList { + resp.PrivateMessageNumList = append(resp.PrivateMessageNumList, struct { + Date string "json:\"date\"" + MessageNum int "json:\"message_num\"" + }{ + Date: v.Date, + MessageNum: int(v.Num), + }) + } + for _, v := range respPb.GroupMessageNumList { + resp.GroupMessageNumList = append(resp.GroupMessageNumList, struct { + Date string "json:\"date\"" + MessageNum int "json:\"message_num\"" + }{ + Date: v.Date, + MessageNum: int(v.Num), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetUserStatistics(c *gin.Context) { + var ( + req cms_api_struct.GetUserStatisticsRequest + resp cms_api_struct.GetUserStatisticsResponse + reqPb pb.GetUserStatisticsReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUserStatistics(context.Background(), &reqPb) + if err != nil { + log.NewError("0", utils.GetSelfFuncName(), "GetUserStatistics failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + // utils.CopyStructFields(&resp, respPb) + resp.ActiveUserNum = int(respPb.ActiveUserNum) + resp.IncreaseUserNum = int(respPb.IncreaseUserNum) + resp.TotalUserNum = int(respPb.TotalUserNum) + for _, v := range respPb.ActiveUserNumList { + resp.ActiveUserNumList = append(resp.ActiveUserNumList, struct { + Date string "json:\"date\"" + ActiveUserNum int "json:\"active_user_num\"" + }{ + Date: v.Date, + ActiveUserNum: int(v.Num), + }) + } + for _, v := range respPb.IncreaseUserNumList { + resp.IncreaseUserNumList = append(resp.IncreaseUserNumList, struct { + Date string "json:\"date\"" + IncreaseUserNum int "json:\"increase_user_num\"" + }{ + Date: v.Date, + IncreaseUserNum: int(v.Num), + }) + } + for _, v := range respPb.TotalUserNumList { + resp.TotalUserNumList = append(resp.TotalUserNumList, struct { + Date string "json:\"date\"" + TotalUserNum int "json:\"total_user_num\"" + }{ + Date: v.Date, + TotalUserNum: int(v.Num), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetGroupStatistics(c *gin.Context) { + var ( + req cms_api_struct.GetGroupStatisticsRequest + resp cms_api_struct.GetGroupStatisticsResponse + reqPb pb.GetGroupStatisticsReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetGroupStatistics(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupStatistics failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + // utils.CopyStructFields(&resp, respPb) + resp.IncreaseGroupNum = int(respPb.GetIncreaseGroupNum()) + resp.TotalGroupNum = int(respPb.GetTotalGroupNum()) + for _, v := range respPb.IncreaseGroupNumList { + resp.IncreaseGroupNumList = append(resp.IncreaseGroupNumList, + struct { + Date string "json:\"date\"" + IncreaseGroupNum int "json:\"increase_group_num\"" + }{ + Date: v.Date, + IncreaseGroupNum: int(v.Num), + }) + } + for _, v := range respPb.TotalGroupNumList { + resp.TotalGroupNumList = append(resp.TotalGroupNumList, + struct { + Date string "json:\"date\"" + TotalGroupNum int "json:\"total_group_num\"" + }{ + Date: v.Date, + TotalGroupNum: int(v.Num), + }) + + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetActiveUser(c *gin.Context) { + var ( + req cms_api_struct.GetActiveUserRequest + resp cms_api_struct.GetActiveUserResponse + reqPb pb.GetActiveUserReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetActiveUser(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetActiveUser failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + utils.CopyStructFields(&resp.ActiveUserList, respPb.Users) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetActiveGroup(c *gin.Context) { + var ( + req cms_api_struct.GetActiveGroupRequest + resp cms_api_struct.GetActiveGroupResponse + reqPb pb.GetActiveGroupReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetActiveGroup(context.Background(), &reqPb) + if err != nil { + log.NewError("0", utils.GetSelfFuncName(), "GetActiveGroup failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + for _, group := range respPb.Groups { + resp.ActiveGroupList = append(resp.ActiveGroupList, struct { + GroupName string "json:\"group_name\"" + GroupId string "json:\"group_id\"" + MessageNum int "json:\"message_num\"" + }{ + GroupName: group.GroupName, + GroupId: group.GroupId, + MessageNum: int(group.MessageNum), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} diff --git a/internal/cms_api/user/user.go b/internal/cms_api/user/user.go new file mode 100644 index 000000000..a0e5dc188 --- /dev/null +++ b/internal/cms_api/user/user.go @@ -0,0 +1,307 @@ +package user + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + commonPb "Open_IM/pkg/proto/sdk_ws" + pb "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "fmt" + "net/http" + "strings" + + "github.com/gin-gonic/gin" +) + +func GetUserById(c *gin.Context) { + var ( + req cms_api_struct.GetUserRequest + resp cms_api_struct.GetUserResponse + reqPb pb.GetUserByIdReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUserById(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + if respPb.User.UserId == "" { + openIMHttp.RespHttp200(c, constant.OK, nil) + return + } + utils.CopyStructFields(&resp, respPb.User) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetUsersByName(c *gin.Context) { + var ( + req cms_api_struct.GetUsersByNameRequest + resp cms_api_struct.GetUsersByNameResponse + reqPb pb.GetUsersByNameReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserName = req.UserName + reqPb.Pagination = &commonPb.RequestPagination{ + PageNumber: int32(req.PageNumber), + ShowNumber: int32(req.ShowNumber), + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUsersByName(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "rpc", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + utils.CopyStructFields(&resp.Users, respPb.Users) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.UserNums = respPb.UserNums + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetUsers(c *gin.Context) { + var ( + req cms_api_struct.GetUsersRequest + resp cms_api_struct.GetUsersResponse + reqPb pb.GetUsersReq + ) + reqPb.Pagination = &commonPb.RequestPagination{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.Pagination, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUsers(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + return + } + utils.CopyStructFields(&resp.Users, respPb.User) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.UserNums = respPb.UserNums + openIMHttp.RespHttp200(c, constant.OK, resp) + +} + +func ResignUser(c *gin.Context) { + var ( + req cms_api_struct.ResignUserRequest + resp cms_api_struct.ResignUserResponse + reqPb pb.ResignUserReq + ) + if err := c.ShouldBind(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) + return + } + utils.CopyStructFields(&reqPb, &req) + fmt.Println(reqPb.UserId) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.ResignUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func AlterUser(c *gin.Context) { + var ( + req cms_api_struct.AlterUserRequest + resp cms_api_struct.AlterUserResponse + reqPb pb.AlterUserReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.AlterUser(context.Background(), &reqPb) + if err != nil { + log.NewError("0", "microserver failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func AddUser(c *gin.Context) { + var ( + req cms_api_struct.AddUserRequest + reqPb pb.AddUserReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.AddUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func BlockUser(c *gin.Context) { + var ( + req cms_api_struct.BlockUserRequest + resp cms_api_struct.BlockUserResponse + reqPb pb.BlockUserReq + ) + if err := c.BindJSON(&req); err != nil { + fmt.Println(err) + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + fmt.Println(reqPb) + _, err := client.BlockUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + return + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func UnblockUser(c *gin.Context) { + var ( + req cms_api_struct.UnblockUserRequest + resp cms_api_struct.UnBlockUserResponse + reqPb pb.UnBlockUserReq + ) + if err := c.ShouldBind(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.UnBlockUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + return + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetBlockUsers(c *gin.Context) { + var ( + req cms_api_struct.GetBlockUsersRequest + resp cms_api_struct.GetBlockUsersResponse + reqPb pb.GetBlockUsersReq + respPb *pb.GetBlockUsersResp + ) + reqPb.Pagination = &commonPb.RequestPagination{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb.Pagination, &req) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "blockUsers", reqPb.Pagination, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetBlockUsers(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetBlockUsers rpc", err.Error()) + openIMHttp.RespHttp200(c, err, resp) + return + } + for _, v := range respPb.BlockUsers { + resp.BlockUsers = append(resp.BlockUsers, cms_api_struct.BlockUser{ + UserResponse: cms_api_struct.UserResponse{ + UserId: v.User.UserId, + ProfilePhoto: v.User.ProfilePhoto, + Nickname: v.User.Nickname, + IsBlock: v.User.IsBlock, + CreateTime: v.User.CreateTime, + }, + BeginDisableTime: v.BeginDisableTime, + EndDisableTime: v.EndDisableTime, + }) + } + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.UserNums = respPb.UserNums + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetBlockUserById(c *gin.Context) { + var ( + req cms_api_struct.GetBlockUserRequest + resp cms_api_struct.GetBlockUserResponse + reqPb pb.GetBlockUserByIdReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserId = req.UserId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetBlockUserById(context.Background(), &reqPb) + if err != nil { + log.NewError("0", "GetBlockUserById rpc failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.EndDisableTime = respPb.BlockUser.EndDisableTime + resp.BeginDisableTime = respPb.BlockUser.BeginDisableTime + utils.CopyStructFields(&resp, respPb.BlockUser.User) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func DeleteUser(c *gin.Context) { + var ( + req cms_api_struct.DeleteUserRequest + reqPb pb.DeleteUserReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserId = req.UserId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.DeleteUser(context.Background(), &reqPb) + if err != nil { + log.NewError("0", "DeleteUser rpc failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go new file mode 100644 index 000000000..e6de926dc --- /dev/null +++ b/internal/demo/register/login.go @@ -0,0 +1,70 @@ +package register + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + http2 "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "encoding/json" + "fmt" + "github.com/gin-gonic/gin" + "net/http" +) + +type ParamsLogin struct { + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + Password string `json:"password"` + Platform int32 `json:"platform"` + OperationID string `json:"operationID" binding:"required"` +} + +func Login(c *gin.Context) { + params := ParamsLogin{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + + r, err := im_mysql_model.GetRegister(account) + if err != nil { + log.NewError(params.OperationID, "user have not register", params.Password, account, err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.NotRegistered, "errMsg": "Mobile phone number is not registered"}) + return + } + if r.Password != params.Password { + log.NewError(params.OperationID, "password err", params.Password, account, r.Password, r.Account) + c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) + return + } + url := fmt.Sprintf("http://%s:10000/auth/user_token", utils.ServerIP) + openIMGetUserToken := api.UserTokenReq{} + openIMGetUserToken.OperationID = params.OperationID + openIMGetUserToken.Platform = params.Platform + openIMGetUserToken.Secret = config.Config.Secret + openIMGetUserToken.UserID = account + openIMGetUserTokenResp := api.UserTokenResp{} + bMsg, err := http2.Post(url, openIMGetUserToken, 2) + if err != nil { + log.NewError(params.OperationID, "request openIM get user token error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.GetIMTokenErr, "errMsg": err.Error()}) + return + } + err = json.Unmarshal(bMsg, &openIMGetUserTokenResp) + if err != nil || openIMGetUserTokenResp.ErrCode != 0 { + log.NewError(params.OperationID, "request get user token", account, "err", "") + c.JSON(http.StatusOK, gin.H{"errCode": constant.GetIMTokenErr, "errMsg": ""}) + return + } + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMGetUserTokenResp.UserToken}) + +} diff --git a/internal/demo/register/reset_password.go b/internal/demo/register/reset_password.go new file mode 100644 index 000000000..b668f4f62 --- /dev/null +++ b/internal/demo/register/reset_password.go @@ -0,0 +1,56 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "github.com/gin-gonic/gin" + "net/http" +) + +type resetPasswordRequest struct { + VerificationCode string `json:"verificationCode" binding:"required"` + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + NewPassword string `json:"newPassword" binding:"required"` + OperationID string `json:"operationID"` +} + +func ResetPassword(c *gin.Context) { + var ( + req resetPasswordRequest + ) + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if req.Email != "" { + account = req.Email + } else { + account = req.PhoneNumber + } + if req.VerificationCode != config.Config.Demo.SuperCode { + accountKey := account + "_" + constant.VerificationCodeForResetSuffix + v, err := db.DB.GetAccountCode(accountKey) + if err != nil || v != req.VerificationCode { + log.NewError(req.OperationID, "password Verification code error", account, req.VerificationCode, v) + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code error!"}) + return + } + } + user, err := im_mysql_model.GetRegister(account) + if err != nil || user.Account == "" { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "get register error", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.NotRegistered, "errMsg": "user not register!"}) + return + } + if err := im_mysql_model.ResetPassword(account, req.NewPassword); err != nil { + c.JSON(http.StatusOK, gin.H{"errCode": constant.ResetPasswordFailed, "errMsg": "reset password failed: "+err.Error()}) + return + } + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "reset password success"}) +} diff --git a/internal/demo/register/send_code.go b/internal/demo/register/send_code.go new file mode 100644 index 000000000..37e355b46 --- /dev/null +++ b/internal/demo/register/send_code.go @@ -0,0 +1,130 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "fmt" + openapi "github.com/alibabacloud-go/darabonba-openapi/client" + dysmsapi20170525 "github.com/alibabacloud-go/dysmsapi-20170525/v2/client" + "github.com/alibabacloud-go/tea/tea" + "github.com/gin-gonic/gin" + "gopkg.in/gomail.v2" + "math/rand" + "net/http" + "time" +) + +type paramsVerificationCode struct { + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + OperationID string `json:"operationID" binding:"required"` + UsedFor int `json:"usedFor"` +} + +func SendVerificationCode(c *gin.Context) { + params := paramsVerificationCode{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("", "BindJSON failed", "err:", err.Error(), "phoneNumber", params.PhoneNumber, "email", params.Email) + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + var accountKey string + if params.UsedFor == 0 { + params.UsedFor = constant.VerificationCodeForRegister + } + switch params.UsedFor { + case constant.VerificationCodeForRegister: + _, err := im_mysql_model.GetRegister(account) + if err == nil { + log.NewError(params.OperationID, "The phone number has been registered", params) + c.JSON(http.StatusOK, gin.H{"errCode": constant.HasRegistered, "errMsg": "The phone number has been registered"}) + return + } + ok, err := db.DB.JudgeAccountEXISTS(account) + if ok || err != nil { + log.NewError(params.OperationID, "The phone number has been registered", params) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "The phone number has been registered"}) + return + } + accountKey = account + "_" + constant.VerificationCodeForRegisterSuffix + + case constant.VerificationCodeForReset: + accountKey = account + "_" + constant.VerificationCodeForResetSuffix + } + rand.Seed(time.Now().UnixNano()) + code := 100000 + rand.Intn(900000) + log.NewInfo(params.OperationID, params.UsedFor,"begin store redis", accountKey, code) + err := db.DB.SetAccountCode(accountKey, code, config.Config.Demo.CodeTTL) + if err != nil { + log.NewError(params.OperationID, "set redis error", accountKey, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + log.NewDebug("", config.Config.Demo) + if params.Email != "" { + m := gomail.NewMessage() + m.SetHeader(`From`, config.Config.Demo.Mail.SenderMail) + m.SetHeader(`To`, []string{account}...) + m.SetHeader(`Subject`, config.Config.Demo.Mail.Title) + m.SetBody(`text/html`, fmt.Sprintf("%d", code)) + if err := gomail.NewDialer(config.Config.Demo.Mail.SmtpAddr, config.Config.Demo.Mail.SmtpPort, config.Config.Demo.Mail.SenderMail, config.Config.Demo.Mail.SenderAuthorizationCode).DialAndSend(m); err != nil { + log.ErrorByKv("send mail error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.MailSendCodeErr, "errMsg": ""}) + return + } + } else { + client, err := CreateClient(tea.String(config.Config.Demo.AliSMSVerify.AccessKeyID), tea.String(config.Config.Demo.AliSMSVerify.AccessKeySecret)) + if err != nil { + log.NewError(params.OperationID, "create sendSms client err", "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + + sendSmsRequest := &dysmsapi20170525.SendSmsRequest{ + PhoneNumbers: tea.String(account), + SignName: tea.String(config.Config.Demo.AliSMSVerify.SignName), + TemplateCode: tea.String(config.Config.Demo.AliSMSVerify.VerificationCodeTemplateCode), + TemplateParam: tea.String(fmt.Sprintf("{\"code\":\"%d\"}", code)), + } + + response, err := client.SendSms(sendSmsRequest) + if err != nil { + log.NewError(params.OperationID, "sendSms error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + if *response.Body.Code != "OK" { + log.NewError(params.OperationID, "alibabacloud sendSms error", account, "err", response.Body.Code, response.Body.Message) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + } + + data := make(map[string]interface{}) + data["account"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verification code has been set!", "data": data}) +} + +func CreateClient(accessKeyId *string, accessKeySecret *string) (result *dysmsapi20170525.Client, err error) { + c := &openapi.Config{ + // 您的AccessKey ID + AccessKeyId: accessKeyId, + // 您的AccessKey Secret + AccessKeySecret: accessKeySecret, + } + + // 访问的域名 + c.Endpoint = tea.String("dysmsapi.aliyuncs.com") + result = &dysmsapi20170525.Client{} + result, err = dysmsapi20170525.NewClient(c) + return result, err +} diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go new file mode 100644 index 000000000..7540d9830 --- /dev/null +++ b/internal/demo/register/set_password.go @@ -0,0 +1,85 @@ +package register + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + http2 "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "encoding/json" + "fmt" + "github.com/gin-gonic/gin" + "net/http" +) + +type ParamsSetPassword struct { + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + Password string `json:"password"` + VerificationCode string `json:"verificationCode"` + Platform int32 `json:"platform" binding:"required,min=1,max=7"` + Ex string `json:"ex"` + OperationID string `json:"operationID" binding:"required"` +} + +func SetPassword(c *gin.Context) { + params := ParamsSetPassword{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + if params.VerificationCode != config.Config.Demo.SuperCode { + accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix + v, err := db.DB.GetAccountCode(accountKey) + if err != nil || v != params.VerificationCode { + log.NewError(params.OperationID, "password Verification code error", account, params.VerificationCode) + data := make(map[string]interface{}) + data["PhoneNumber"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code error!", "data": data}) + return + } + } + url := fmt.Sprintf("http://%s:10000/auth/user_register", utils.ServerIP) + openIMRegisterReq := api.UserRegisterReq{} + openIMRegisterReq.OperationID = params.OperationID + openIMRegisterReq.Platform = params.Platform + openIMRegisterReq.UserID = account + openIMRegisterReq.Nickname = account + openIMRegisterReq.Secret = config.Config.Secret + openIMRegisterResp := api.UserRegisterResp{} + bMsg, err := http2.Post(url, openIMRegisterReq, 2) + if err != nil { + log.NewError(params.OperationID, "request openIM register error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": err.Error()}) + return + } + err = json.Unmarshal(bMsg, &openIMRegisterResp) + if err != nil || openIMRegisterResp.ErrCode != 0 { + log.NewError(params.OperationID, "request openIM register error", account, "err", "resp: ", openIMRegisterResp.ErrCode) + if err != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), err.Error()) + } + c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": "register failed: "+openIMRegisterResp.ErrMsg}) + return + } + log.Info(params.OperationID, "begin store mysql", account, params.Password) + err = im_mysql_model.SetPassword(account, params.Password, params.Ex) + if err != nil { + log.NewError(params.OperationID, "set phone number password error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": err.Error()}) + return + } + log.Info(params.OperationID, "end setPassword", account, params.Password) + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken}) + return +} diff --git a/internal/demo/register/verify.go b/internal/demo/register/verify.go new file mode 100644 index 000000000..01fafbb92 --- /dev/null +++ b/internal/demo/register/verify.go @@ -0,0 +1,80 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + + "github.com/gin-gonic/gin" + "net/http" +) + +type paramsCertification struct { + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + VerificationCode string `json:"verificationCode"` + OperationID string `json:"operationID" binding:"required"` + UsedFor int `json:"usedFor"` +} + +func Verify(c *gin.Context) { + params := paramsCertification{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("", "request params json parsing failed", "", "err", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + log.NewInfo("recv req: ", params) + + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + + if params.VerificationCode == config.Config.Demo.SuperCode { + log.InfoByKv("Super Code Verified successfully", account) + data := make(map[string]interface{}) + data["account"] = account + data["verificationCode"] = params.VerificationCode + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verified successfully!", "data": data}) + return + } + log.NewInfo("0", " params.VerificationCode != config.Config.Demo.SuperCode", params.VerificationCode, config.Config.Demo) + log.NewInfo(params.OperationID, "begin get form redis", account) + if params.UsedFor == 0 { + params.UsedFor = constant.VerificationCodeForRegister + } + var accountKey string + switch params.UsedFor { + case constant.VerificationCodeForRegister: + accountKey = account + "_" + constant.VerificationCodeForRegisterSuffix + case constant.VerificationCodeForReset: + accountKey = account + "_" + constant.VerificationCodeForResetSuffix + } + + code, err := db.DB.GetAccountCode(accountKey) + log.NewInfo(params.OperationID, "redis phone number and verificating Code", accountKey, code, params) + if err != nil { + log.NewError(params.OperationID, "Verification code expired", accountKey, "err", err.Error()) + data := make(map[string]interface{}) + data["account"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code expired!", "data": data}) + return + } + if params.VerificationCode == code { + log.Info(params.OperationID, "Verified successfully", account) + data := make(map[string]interface{}) + data["account"] = account + data["verificationCode"] = params.VerificationCode + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verified successfully!", "data": data}) + return + } else { + log.Info(params.OperationID, "Verification code error", account, params.VerificationCode) + data := make(map[string]interface{}) + data["account"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code error!", "data": data}) + } +} diff --git a/internal/msg_gateway/gate/init.go b/internal/msg_gateway/gate/init.go index 03f82f3ad..b827f9928 100644 --- a/internal/msg_gateway/gate/init.go +++ b/internal/msg_gateway/gate/init.go @@ -3,15 +3,19 @@ package gate import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" + "Open_IM/pkg/statistics" + "fmt" "github.com/go-playground/validator/v10" "sync" ) var ( - rwLock *sync.RWMutex - validate *validator.Validate - ws WServer - rpcSvr RPCServer + rwLock *sync.RWMutex + validate *validator.Validate + ws WServer + rpcSvr RPCServer + sendMsgCount uint64 + userCount uint64 ) func Init(rpcPort, wsPort int) { @@ -19,6 +23,8 @@ func Init(rpcPort, wsPort int) { log.NewPrivateLog(config.Config.ModuleName.LongConnSvrName) rwLock = new(sync.RWMutex) validate = validator.New() + statistics.NewStatistics(&sendMsgCount, config.Config.ModuleName.LongConnSvrName, fmt.Sprintf("%d second recv to msg_gateway sendMsgCount", sendMsgCount), 300) + statistics.NewStatistics(&userCount, config.Config.ModuleName.LongConnSvrName, fmt.Sprintf("%d second add user conn", userCount), 300) ws.onInit(wsPort) rpcSvr.onInit(rpcPort) } diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 9eadb529e..8e5fdcdac 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -6,12 +6,10 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbChat "Open_IM/pkg/proto/chat" - open_im_sdk "Open_IM/pkg/proto/sdk_ws" - "Open_IM/pkg/utils" + sdk_ws "Open_IM/pkg/proto/sdk_ws" "bytes" "context" "encoding/gob" - "encoding/json" "github.com/golang/protobuf/proto" "github.com/gorilla/websocket" "runtime" @@ -30,7 +28,7 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { dec := gob.NewDecoder(b) err := dec.Decode(&m) if err != nil { - log.ErrorByKv("ws json Unmarshal err", "", "err", err.Error()) + log.ErrorByKv("ws Decode err", "", "err", err.Error()) ws.sendErrMsg(conn, 200, err.Error(), constant.WSDataError, "", "") err = conn.Close() if err != nil { @@ -51,42 +49,41 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { switch m.ReqIdentifier { case constant.WSGetNewestSeq: - go ws.getSeqReq(conn, &m) - case constant.WSPullMsg: - go ws.pullMsgReq(conn, &m) + ws.getSeqReq(conn, &m) case constant.WSSendMsg: - sendTime := utils.GetCurrentTimestampByNano() - go ws.sendMsgReq(conn, &m, sendTime) + ws.sendMsgReq(conn, &m) + case constant.WSSendSignalMsg: + ws.sendSignalMsgReq(conn, &m) case constant.WSPullMsgBySeqList: - go ws.pullMsgBySeqListReq(conn, &m) + ws.pullMsgBySeqListReq(conn, &m) default: } log.NewInfo("", "goroutine num is ", runtime.NumGoroutine()) } func (ws *WServer) getSeqReq(conn *UserConn, m *Req) { log.NewInfo(m.OperationID, "Ws call success to getNewSeq", m.MsgIncr, m.SendID, m.ReqIdentifier) - pbData := pbChat.GetMaxAndMinSeqReq{} + rpcReq := pbChat.GetMaxAndMinSeqReq{} nReply := new(pbChat.GetMaxAndMinSeqResp) - pbData.UserID = m.SendID - pbData.OperationID = m.OperationID + rpcReq.UserID = m.SendID + rpcReq.OperationID = m.OperationID grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) if grpcConn == nil { - log.ErrorByKv("get grpcConn err", pbData.OperationID, "args", m) + log.ErrorByKv("get grpcConn err", rpcReq.OperationID, "args", m) } msgClient := pbChat.NewChatClient(grpcConn) - reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) + rpcReply, err := msgClient.GetMaxAndMinSeq(context.Background(), &rpcReq) if err != nil { - log.ErrorByKv("rpc call failed to getSeqReq", pbData.OperationID, "err", err, "pbData", pbData.String()) - nReply.ErrCode = 200 + log.Error(rpcReq.OperationID, "rpc call failed to getSeqReq", err, rpcReq.String()) + nReply.ErrCode = 500 nReply.ErrMsg = err.Error() ws.getSeqResp(conn, m, nReply) } else { - log.InfoByKv("rpc call success to getSeqReq", pbData.OperationID, "replyData", reply.String()) - ws.getSeqResp(conn, m, reply) + log.InfoByKv("rpc call success to getSeqReq", rpcReq.OperationID, "replyData", rpcReply.String()) + ws.getSeqResp(conn, m, rpcReply) } } func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeqResp) { - var mReplyData open_im_sdk.GetMaxAndMinSeqResp + var mReplyData sdk_ws.GetMaxAndMinSeqResp mReplyData.MaxSeq = pb.GetMaxSeq() mReplyData.MinSeq = pb.GetMinSeq() b, _ := proto.Marshal(&mReplyData) @@ -100,58 +97,38 @@ func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeq } ws.sendMsg(conn, mReply) } -func (ws *WServer) pullMsgReq(conn *UserConn, m *Req) { - log.NewInfo(m.OperationID, "Ws call success to pullMsgReq", m.ReqIdentifier, m.MsgIncr, m.SendID) - nReply := new(pbChat.PullMessageResp) - isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsg) + +func (ws *WServer) pullMsgBySeqListReq(conn *UserConn, m *Req) { + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq start", m.SendID, m.ReqIdentifier, m.MsgIncr) + nReply := new(sdk_ws.PullMessageBySeqListResp) + isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList) + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq middle", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(sdk_ws.PullMessageBySeqListReq).SeqList) if isPass { - pbData := pbChat.PullMessageReq{} - pbData.UserID = m.SendID - pbData.OperationID = m.OperationID - pbData.SeqBegin = data.(SeqData).SeqBegin - pbData.SeqEnd = data.(SeqData).SeqEnd + rpcReq := sdk_ws.PullMessageBySeqListReq{} + rpcReq.SeqList = data.(sdk_ws.PullMessageBySeqListReq).SeqList + rpcReq.UserID = m.SendID + rpcReq.OperationID = m.OperationID grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) msgClient := pbChat.NewChatClient(grpcConn) - reply, err := msgClient.PullMessage(context.Background(), &pbData) + reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq) if err != nil { - log.ErrorByKv("PullMessage error", pbData.OperationID, "err", err.Error()) + log.NewError(rpcReq.OperationID, "pullMsgBySeqListReq err", err.Error()) nReply.ErrCode = 200 nReply.ErrMsg = err.Error() - ws.pullMsgResp(conn, m, nReply) + ws.pullMsgBySeqListResp(conn, m, nReply) } else { - log.InfoByKv("rpc call success to pullMsgRep", pbData.OperationID, "ReplyArgs", reply.String(), "maxSeq", reply.GetMaxSeq(), - "MinSeq", reply.GetMinSeq(), "singLen", len(reply.GetSingleUserMsg()), "groupLen", len(reply.GetGroupUserMsg())) - ws.pullMsgResp(conn, m, reply) + log.NewInfo(rpcReq.OperationID, "rpc call success to pullMsgBySeqListReq", reply.String(), len(reply.List)) + ws.pullMsgBySeqListResp(conn, m, reply) } } else { nReply.ErrCode = errCode nReply.ErrMsg = errMsg - ws.pullMsgResp(conn, m, nReply) + ws.pullMsgBySeqListResp(conn, m, nReply) } } -func (ws *WServer) pullMsgResp(conn *UserConn, m *Req, pb *pbChat.PullMessageResp) { - log.NewInfo(m.OperationID, "pullMsgResp come here ", pb.String()) - var mReplyData open_im_sdk.PullMessageBySeqListResp - a, err := json.Marshal(pb.SingleUserMsg) - if err != nil { - log.NewError(m.OperationID, "GetSingleUserMsg,json marshal,err", err.Error()) - } - log.NewInfo(m.OperationID, "pullMsgResp json is ", len(pb.SingleUserMsg)) - err = json.Unmarshal(a, &mReplyData.SingleUserMsg) - if err != nil { - log.NewError(m.OperationID, "SingleUserMsg,json Unmarshal,err", err.Error()) - } - b, err := json.Marshal(pb.GroupUserMsg) - if err != nil { - log.NewError(m.OperationID, "mReplyData,json marshal,err", err.Error()) - } - err = json.Unmarshal(b, &mReplyData.GroupUserMsg) - if err != nil { - log.NewError(m.OperationID, "test SingleUserMsg,json Unmarshal,err", err.Error()) - } - c, err := proto.Marshal(&mReplyData) - log.NewInfo(m.OperationID, "test info is ", len(mReplyData.SingleUserMsg), mReplyData.SingleUserMsg) - +func (ws *WServer) pullMsgBySeqListResp(conn *UserConn, m *Req, pb *sdk_ws.PullMessageBySeqListResp) { + log.NewInfo(m.OperationID, "pullMsgBySeqListResp come here ", pb.String()) + c, _ := proto.Marshal(pb) mReply := Resp{ ReqIdentifier: m.ReqIdentifier, MsgIncr: m.MsgIncr, @@ -160,92 +137,52 @@ func (ws *WServer) pullMsgResp(conn *UserConn, m *Req, pb *pbChat.PullMessageRes OperationID: m.OperationID, Data: c, } - log.NewInfo(m.OperationID, "pullMsgResp all data is ", mReply.ReqIdentifier, mReply.MsgIncr, mReply.ErrCode, mReply.ErrMsg, + log.NewInfo(m.OperationID, "pullMsgBySeqListResp all data is ", mReply.ReqIdentifier, mReply.MsgIncr, mReply.ErrCode, mReply.ErrMsg, len(mReply.Data)) ws.sendMsg(conn, mReply) } -func (ws *WServer) pullMsgBySeqListReq(conn *UserConn, m *Req) { - log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq start", m.SendID, m.ReqIdentifier, m.MsgIncr) - nReply := new(pbChat.PullMessageResp) - isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList) - log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq middle", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(open_im_sdk.PullMessageBySeqListReq).SeqList) - if isPass { - pbData := pbChat.PullMessageBySeqListReq{} - pbData.SeqList = data.(open_im_sdk.PullMessageBySeqListReq).SeqList - pbData.UserID = m.SendID - pbData.OperationID = m.OperationID - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) - msgClient := pbChat.NewChatClient(grpcConn) - reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData) - if err != nil { - log.NewError(pbData.OperationID, "pullMsgBySeqListReq err", err.Error()) - nReply.ErrCode = 200 - nReply.ErrMsg = err.Error() - ws.pullMsgResp(conn, m, nReply) - } else { - log.NewInfo(pbData.OperationID, "rpc call success to pullMsgBySeqListReq", reply.String(), reply.GetMaxSeq(), reply.GetMinSeq(), len(reply.GetSingleUserMsg()), len(reply.GetGroupUserMsg())) - ws.pullMsgResp(conn, m, reply) - } - } else { - nReply.ErrCode = errCode - nReply.ErrMsg = errMsg - ws.pullMsgResp(conn, m, nReply) - } -} -func (ws *WServer) sendMsgReq(conn *UserConn, m *Req, sendTime int64) { - log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, sendTime) - nReply := new(pbChat.UserSendMsgResp) +func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { + sendMsgCount++ + log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID) + nReply := new(pbChat.SendMsgResp) isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg) if isPass { - data := pData.(open_im_sdk.UserSendMsgReq) - pbData := pbChat.UserSendMsgReq{ - ReqIdentifier: m.ReqIdentifier, - Token: m.Token, - SendID: m.SendID, - OperationID: m.OperationID, - PlatformID: data.PlatformID, - SessionType: data.SessionType, - MsgFrom: data.MsgFrom, - ContentType: data.ContentType, - RecvID: data.RecvID, - ForceList: data.ForceList, - SenderNickName: data.SenderNickName, - SenderFaceURL: data.SenderFaceURL, - Content: data.Content, - Options: utils.MapIntToJsonString(data.Options), - ClientMsgID: data.ClientMsgID, - SendTime: sendTime, + data := pData.(sdk_ws.MsgData) + pbData := pbChat.SendMsgReq{ + Token: m.Token, + OperationID: m.OperationID, + MsgData: &data, } log.NewInfo(m.OperationID, "Ws call success to sendMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, data) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) client := pbChat.NewChatClient(etcdConn) - reply, err := client.UserSendMsg(context.Background(), &pbData) + reply, err := client.SendMsg(context.Background(), &pbData) if err != nil { log.NewError(pbData.OperationID, "UserSendMsg err", err.Error()) nReply.ErrCode = 200 nReply.ErrMsg = err.Error() - ws.sendMsgResp(conn, m, nReply, sendTime) + ws.sendMsgResp(conn, m, nReply) } else { log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String()) - ws.sendMsgResp(conn, m, reply, sendTime) + ws.sendMsgResp(conn, m, reply) } } else { nReply.ErrCode = errCode nReply.ErrMsg = errMsg - ws.sendMsgResp(conn, m, nReply, sendTime) + ws.sendMsgResp(conn, m, nReply) } } -func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.UserSendMsgResp, sendTime int64) { +func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.SendMsgResp) { // := make(map[string]interface{}) - var mReplyData open_im_sdk.UserSendMsgResp + var mReplyData sdk_ws.UserSendMsgResp mReplyData.ClientMsgID = pb.GetClientMsgID() mReplyData.ServerMsgID = pb.GetServerMsgID() - mReplyData.SendTime = sendTime + mReplyData.SendTime = pb.GetSendTime() b, _ := proto.Marshal(&mReplyData) mReply := Resp{ ReqIdentifier: m.ReqIdentifier, @@ -258,17 +195,70 @@ func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.UserSendMsgRes ws.sendMsg(conn, mReply) } +func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { + sendMsgCount++ + log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID) + nReply := new(pbChat.SendMsgResp) + isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg) + if isPass { + data := pData.(sdk_ws.MsgData) + pbData := pbChat.SendMsgReq{ + Token: m.Token, + OperationID: m.OperationID, + MsgData: &data, + } + log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, data) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + reply, err := client.SendMsg(context.Background(), &pbData) + if err != nil { + log.NewError(pbData.OperationID, "rpc sendMsg err", err.Error()) + nReply.ErrCode = 200 + nReply.ErrMsg = err.Error() + ws.sendSignalMsgResp(conn, m, nReply) + } else { + log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String()) + ws.sendSignalMsgResp(conn, m, reply) + } + + } else { + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + ws.sendSignalMsgResp(conn, m, nReply) + } + +} +func (ws *WServer) sendSignalMsgResp(conn *UserConn, m *Req, pb *pbChat.SendMsgResp) { + // := make(map[string]interface{}) + + var mReplyData sdk_ws.UserSendMsgResp + mReplyData.ClientMsgID = pb.GetClientMsgID() + mReplyData.ServerMsgID = pb.GetServerMsgID() + mReplyData.SendTime = pb.GetSendTime() + b, _ := proto.Marshal(&mReplyData) + mReply := Resp{ + ReqIdentifier: m.ReqIdentifier, + MsgIncr: m.MsgIncr, + ErrCode: pb.GetErrCode(), + ErrMsg: pb.GetErrMsg(), + OperationID: m.OperationID, + Data: b, + } + ws.sendMsg(conn, mReply) +} func (ws *WServer) sendMsg(conn *UserConn, mReply interface{}) { var b bytes.Buffer enc := gob.NewEncoder(&b) err := enc.Encode(mReply) if err != nil { - log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "Encode Msg error", conn.RemoteAddr().String(), ws.getUserUid(conn), err.Error()) + uid, platform := ws.getUserUid(conn) + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "Encode Msg error", conn.RemoteAddr().String(), uid, platform, err.Error()) return } err = ws.writeMsg(conn, websocket.BinaryMessage, b.Bytes()) if err != nil { - log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "WS WriteMsg error", conn.RemoteAddr().String(), ws.getUserUid(conn), err.Error()) + uid, platform := ws.getUserUid(conn) + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "WS WriteMsg error", conn.RemoteAddr().String(), uid, platform, err.Error()) } } func (ws *WServer) sendErrMsg(conn *UserConn, errCode int32, errMsg string, reqIdentifier int32, msgIncr string, operationID string) { diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go index 464c0e2d4..fc285b033 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -4,9 +4,9 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbRelay "Open_IM/pkg/proto/relay" - open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "bytes" "context" @@ -55,26 +55,10 @@ func (r *RPCServer) run() { return } } -func (r *RPCServer) MsgToUser(_ context.Context, in *pbRelay.MsgToUserReq) (*pbRelay.MsgToUserResp, error) { +func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgReq) (*pbRelay.OnlinePushMsgResp, error) { log.InfoByKv("PushMsgToUser is arriving", in.OperationID, "args", in.String()) var resp []*pbRelay.SingleMsgToUser - var RecvID string - msg := open_im_sdk.MsgData{ - SendID: in.SendID, - RecvID: in.RecvID, - MsgFrom: in.MsgFrom, - ContentType: in.ContentType, - SessionType: in.SessionType, - SenderNickName: in.SenderNickName, - SenderFaceURL: in.SenderFaceURL, - ClientMsgID: in.ClientMsgID, - ServerMsgID: in.ServerMsgID, - Content: in.Content, - Seq: in.RecvSeq, - SendTime: in.SendTime, - SenderPlatformID: in.PlatformID, - } - msgBytes, _ := proto.Marshal(&msg) + msgBytes, _ := proto.Marshal(in.MsgData) mReply := Resp{ ReqIdentifier: constant.WSPushMsg, OperationID: in.OperationID, @@ -86,31 +70,24 @@ func (r *RPCServer) MsgToUser(_ context.Context, in *pbRelay.MsgToUserReq) (*pbR if err != nil { log.NewError(in.OperationID, "data encode err", err.Error()) } - switch in.GetSessionType() { - case constant.SingleChatType: - RecvID = in.GetRecvID() - case constant.GroupChatType: - RecvID = strings.Split(in.GetRecvID(), " ")[0] - } var tag bool - var UIDAndPID []string - userIDList := genUidPlatformArray(RecvID) - for _, v := range userIDList { - UIDAndPID = strings.Split(v, " ") - if conn := ws.getUserConn(v); conn != nil { + recvID := in.PushToUserID + platformList := genPlatformArray() + for _, v := range platformList { + if conn := ws.getUserConn(recvID, v); conn != nil { tag = true - resultCode := sendMsgToUser(conn, replyBytes.Bytes(), in, UIDAndPID[1], UIDAndPID[0]) + resultCode := sendMsgToUser(conn, replyBytes.Bytes(), in, v, recvID) temp := &pbRelay.SingleMsgToUser{ ResultCode: resultCode, - RecvID: UIDAndPID[0], - RecvPlatFormID: utils.PlatformNameToID(UIDAndPID[1]), + RecvID: recvID, + RecvPlatFormID: constant.PlatformNameToID(v), } resp = append(resp, temp) } else { temp := &pbRelay.SingleMsgToUser{ ResultCode: -1, - RecvID: UIDAndPID[0], - RecvPlatFormID: utils.PlatformNameToID(UIDAndPID[1]), + RecvID: recvID, + RecvPlatFormID: constant.PlatformNameToID(v), } resp = append(resp, temp) } @@ -129,16 +106,43 @@ func (r *RPCServer) MsgToUser(_ context.Context, in *pbRelay.MsgToUserReq) (*pbR if !tag { log.NewError(in.OperationID, "push err ,no matched ws conn not in map", in.String()) } - return &pbRelay.MsgToUserResp{ + return &pbRelay.OnlinePushMsgResp{ Resp: resp, }, nil } +func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUsersOnlineStatusReq) (*pbRelay.GetUsersOnlineStatusResp, error) { + log.NewInfo(req.OperationID, "rpc GetUsersOnlineStatus arrived server", req.String()) + if !token_verify.IsMangerUserID(req.OpUserID) { + log.NewError(req.OperationID, "no permission GetUsersOnlineStatus ", req.OpUserID) + return &pbRelay.GetUsersOnlineStatusResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + var resp pbRelay.GetUsersOnlineStatusResp + for _, userID := range req.UserIDList { + platformList := genPlatformArray() + temp := new(pbRelay.GetUsersOnlineStatusResp_SuccessResult) + temp.UserID = userID + for _, platform := range platformList { + if conn := ws.getUserConn(userID, platform); conn != nil { + ps := new(pbRelay.GetUsersOnlineStatusResp_SuccessDetail) + ps.Platform = platform + ps.Status = constant.OnlineStatus + temp.Status = constant.OnlineStatus + temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, ps) -func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.MsgToUserReq, RecvPlatForm, RecvID string) (ResultCode int64) { + } + } + if temp.Status == constant.OnlineStatus { + resp.SuccessResult = append(resp.SuccessResult, temp) + } + } + log.NewInfo(req.OperationID, "GetUsersOnlineStatus rpc return ", resp.String()) + return &resp, nil +} +func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, RecvPlatForm, RecvID string) (ResultCode int64) { err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) if err != nil { log.ErrorByKv("PushMsgToUser is failed By Ws", "", "Addr", conn.RemoteAddr().String(), - "error", err, "senderPlatform", utils.PlatformIDToName(in.PlatformID), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) + "error", err, "senderPlatform", constant.PlatformIDToName(in.MsgData.SenderPlatformID), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) ResultCode = -2 return ResultCode } else { @@ -148,9 +152,9 @@ func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.MsgToUserReq, RecvPl } } -func genUidPlatformArray(uid string) (array []string) { - for i := 1; i <= utils.LinuxPlatformID; i++ { - array = append(array, uid+" "+utils.PlatformIDToName(int32(i))) +func genPlatformArray() (array []string) { + for i := 1; i <= constant.LinuxPlatformID; i++ { + array = append(array, constant.PlatformIDToName(int32(i))) } return array } diff --git a/internal/msg_gateway/gate/validate.go b/internal/msg_gateway/gate/validate.go index 269229e9c..c763ff1b2 100644 --- a/internal/msg_gateway/gate/validate.go +++ b/internal/msg_gateway/gate/validate.go @@ -58,8 +58,8 @@ type SeqListData struct { func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, errMsg string, returnData interface{}) { switch r { - case constant.WSSendMsg: - data := open_im_sdk.UserSendMsgReq{} + case constant.WSSendMsg | constant.WSSendSignalMsg: + data := open_im_sdk.MsgData{} if err := proto.Unmarshal(m.Data, &data); err != nil { log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r) return false, 203, err.Error(), nil diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 8faa748a9..477d43420 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -2,12 +2,19 @@ package gate import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" "Open_IM/pkg/utils" - "github.com/gorilla/websocket" + "bytes" + "encoding/gob" + "github.com/garyburd/redigo/redis" "net/http" "sync" "time" + + "github.com/gorilla/websocket" ) type UserConn struct { @@ -18,16 +25,15 @@ type WServer struct { wsAddr string wsMaxConnNum int wsUpGrader *websocket.Upgrader - wsConnToUser map[*UserConn]string - wsUserToConn map[string]*UserConn + wsConnToUser map[*UserConn]map[string]string + wsUserToConn map[string]map[string]*UserConn } func (ws *WServer) onInit(wsPort int) { - ip := utils.ServerIP - ws.wsAddr = ip + ":" + utils.IntToString(wsPort) + ws.wsAddr = ":" + utils.IntToString(wsPort) ws.wsMaxConnNum = config.Config.LongConnSvr.WebsocketMaxConnNum - ws.wsConnToUser = make(map[*UserConn]string) - ws.wsUserToConn = make(map[string]*UserConn) + ws.wsConnToUser = make(map[*UserConn]map[string]string) + ws.wsUserToConn = make(map[string]map[string]*UserConn) ws.wsUpGrader = &websocket.Upgrader{ HandshakeTimeout: time.Duration(config.Config.LongConnSvr.WebsocketTimeOut) * time.Second, ReadBufferSize: config.Config.LongConnSvr.WebsocketMaxMsgLen, @@ -53,10 +59,10 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { } else { //Connection mapping relationship, //userID+" "+platformID->conn - SendID := query["sendID"][0] + " " + utils.PlatformIDToName(int32(utils.StringToInt64(query["platformID"][0]))) + //Initialize a lock for each user newConn := &UserConn{conn, new(sync.Mutex)} - ws.addUserConn(SendID, newConn) + ws.addUserConn(query["sendID"][0], int32(utils.StringToInt64(query["platformID"][0])), newConn, query["token"][0]) go ws.readMsg(newConn) } } @@ -69,7 +75,8 @@ func (ws *WServer) readMsg(conn *UserConn) { log.NewInfo("", "this is a pingMessage") } if err != nil { - log.ErrorByKv("WS ReadMsg error", "", "userIP", conn.RemoteAddr().String(), "userUid", ws.getUserUid(conn), "error", err) + uid, platform := ws.getUserUid(conn) + log.ErrorByKv("WS ReadMsg error", "", "userIP", conn.RemoteAddr().String(), "userUid", uid, "platform", platform, "error", err.Error()) ws.delUserConn(conn) return } else { @@ -86,70 +93,176 @@ func (ws *WServer) writeMsg(conn *UserConn, a int, msg []byte) error { return conn.WriteMessage(a, msg) } -func (ws *WServer) addUserConn(uid string, conn *UserConn) { +func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int32, newConn *UserConn, token string) { + switch config.Config.MultiLoginPolicy { + case constant.AllLoginButSameTermKick: + if oldConnMap, ok := ws.wsUserToConn[uid]; ok { + if oldConn, ok := oldConnMap[constant.PlatformIDToName(platformID)]; ok { + log.NewDebug("", uid, platformID, "kick old conn") + ws.sendKickMsg(oldConn, newConn) + m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID)) + if err != nil && err != redis.ErrNil { + log.NewError("", "get token from redis err", err.Error()) + return + } + if m == nil { + log.NewError("", "get token from redis err", "m is nil") + return + } + for k, _ := range m { + if k != token { + m[k] = constant.KickedToken + } + } + log.NewDebug("get map is ", m) + err = db.DB.SetTokenMapByUidPid(uid, platformID, m) + if err != nil { + log.NewError("", "SetTokenMapByUidPid err", err.Error()) + return + } + err = oldConn.Close() + delete(oldConnMap, constant.PlatformIDToName(platformID)) + ws.wsUserToConn[uid] = oldConnMap + if len(oldConnMap) == 0 { + delete(ws.wsUserToConn, uid) + } + delete(ws.wsConnToUser, oldConn) + if err != nil { + log.NewError("", "conn close err", err.Error(), uid, platformID) + } + + } + + } else { + log.NewDebug("no other conn", ws.wsUserToConn) + } + + case constant.SingleTerminalLogin: + case constant.WebAndOther: + } +} +func (ws *WServer) sendKickMsg(oldConn, newConn *UserConn) { + mReply := Resp{ + ReqIdentifier: constant.WSKickOnlineMsg, + ErrCode: constant.ErrTokenInvalid.ErrCode, + ErrMsg: constant.ErrTokenInvalid.ErrMsg, + } + var b bytes.Buffer + enc := gob.NewEncoder(&b) + err := enc.Encode(mReply) + if err != nil { + log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "Encode Msg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) + return + } + err = ws.writeMsg(oldConn, websocket.BinaryMessage, b.Bytes()) + if err != nil { + log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "WS WriteMsg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) + } +} +func (ws *WServer) addUserConn(uid string, platformID int32, conn *UserConn, token string) { rwLock.Lock() defer rwLock.Unlock() - if oldConn, ok := ws.wsUserToConn[uid]; ok { - err := oldConn.Close() - delete(ws.wsConnToUser, oldConn) - if err != nil { - log.ErrorByKv("close err", "", "uid", uid, "conn", conn) - } + ws.MultiTerminalLoginChecker(uid, platformID, conn, token) + if oldConnMap, ok := ws.wsUserToConn[uid]; ok { + oldConnMap[constant.PlatformIDToName(platformID)] = conn + ws.wsUserToConn[uid] = oldConnMap } else { - log.InfoByKv("this user is first login", "", "uid", uid) + i := make(map[string]*UserConn) + i[constant.PlatformIDToName(platformID)] = conn + ws.wsUserToConn[uid] = i } - ws.wsConnToUser[conn] = uid - ws.wsUserToConn[uid] = conn - log.WarnByKv("WS Add operation", "", "wsUser added", ws.wsUserToConn, "uid", uid, "online_num", len(ws.wsUserToConn)) + if oldStringMap, ok := ws.wsConnToUser[conn]; ok { + oldStringMap[constant.PlatformIDToName(platformID)] = uid + ws.wsConnToUser[conn] = oldStringMap + } else { + i := make(map[string]string) + i[constant.PlatformIDToName(platformID)] = uid + ws.wsConnToUser[conn] = i + } + count := 0 + for _, v := range ws.wsUserToConn { + count = count + len(v) + } + log.Debug("WS Add operation", "", "wsUser added", ws.wsUserToConn, "connection_uid", uid, "connection_platform", constant.PlatformIDToName(platformID), "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) + userCount = uint64(len(ws.wsUserToConn)) } func (ws *WServer) delUserConn(conn *UserConn) { rwLock.Lock() defer rwLock.Unlock() - var uidPlatform string - if uid, ok := ws.wsConnToUser[conn]; ok { - uidPlatform = uid - if _, ok = ws.wsUserToConn[uid]; ok { - delete(ws.wsUserToConn, uid) - log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "uid", uid, "online_num", len(ws.wsUserToConn)) - } else { - log.WarnByKv("uid not exist", "", "wsUser deleted", ws.wsUserToConn, "uid", uid, "online_num", len(ws.wsUserToConn)) + var platform, uid string + if oldStringMap, ok := ws.wsConnToUser[conn]; ok { + for k, v := range oldStringMap { + platform = k + uid = v } + if oldConnMap, ok := ws.wsUserToConn[uid]; ok { + delete(oldConnMap, platform) + ws.wsUserToConn[uid] = oldConnMap + if len(oldConnMap) == 0 { + delete(ws.wsUserToConn, uid) + } + count := 0 + for _, v := range ws.wsUserToConn { + count = count + len(v) + } + log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) + } else { + log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn)) + } + userCount = uint64(len(ws.wsUserToConn)) delete(ws.wsConnToUser, conn) + } err := conn.Close() if err != nil { - log.ErrorByKv("close err", "", "uid", uidPlatform) + log.ErrorByKv("close err", "", "uid", uid, "platform", platform) + } } -func (ws *WServer) getUserConn(uid string) *UserConn { +func (ws *WServer) getUserConn(uid string, platform string) *UserConn { rwLock.RLock() defer rwLock.RUnlock() - if conn, ok := ws.wsUserToConn[uid]; ok { - return conn + if connMap, ok := ws.wsUserToConn[uid]; ok { + if conn, flag := connMap[platform]; flag { + return conn + } } return nil } -func (ws *WServer) getUserUid(conn *UserConn) string { +func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn { + rwLock.RLock() + defer rwLock.RUnlock() + if connMap, ok := ws.wsUserToConn[uid]; ok { + return connMap + } + return nil +} +func (ws *WServer) getUserUid(conn *UserConn) (uid, platform string) { rwLock.RLock() defer rwLock.RUnlock() - if uid, ok := ws.wsConnToUser[conn]; ok { - return uid + if stringMap, ok := ws.wsConnToUser[conn]; ok { + for k, v := range stringMap { + platform = k + uid = v + } + return uid, platform } - return "" + return "", "" } func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { status := http.StatusUnauthorized query := r.URL.Query() if len(query["token"]) != 0 && len(query["sendID"]) != 0 && len(query["platformID"]) != 0 { - if !utils.VerifyToken(query["token"][0], query["sendID"][0]) { + if ok, err := token_verify.VerifyToken(query["token"][0], query["sendID"][0]); !ok { + e := err.(*constant.ErrInfo) log.ErrorByKv("Token verify failed", "", "query", query) w.Header().Set("Sec-Websocket-Version", "13") - http.Error(w, http.StatusText(status), status) + http.Error(w, e.ErrMsg, int(e.ErrCode)) return false } else { log.InfoByKv("Connection Authentication Success", "", "token", query["token"][0], "userID", query["sendID"][0]) @@ -161,5 +274,7 @@ func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { http.Error(w, http.StatusText(status), status) return false } - +} +func genMapKey(uid string, platformID int32) string { + return uid + " " + constant.PlatformIDToName(platformID) } diff --git a/internal/msg_transfer/logic/db.go b/internal/msg_transfer/logic/db.go index 3d6e0e3f6..806b782c0 100644 --- a/internal/msg_transfer/logic/db.go +++ b/internal/msg_transfer/logic/db.go @@ -2,24 +2,22 @@ package logic import ( "Open_IM/pkg/common/db" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" "Open_IM/pkg/common/log" pbMsg "Open_IM/pkg/proto/chat" "Open_IM/pkg/utils" ) -func saveUserChat(uid string, pbMsg *pbMsg.MsgSvrToPushSvrChatMsg) error { +func saveUserChat(uid string, msg *pbMsg.MsgDataToMQ) error { time := utils.GetCurrentTimestampByMill() seq, err := db.DB.IncrUserSeq(uid) if err != nil { - log.NewError(pbMsg.OperationID, "data insert to redis err", err.Error(), pbMsg.String()) + log.NewError(msg.OperationID, "data insert to redis err", err.Error(), msg.String()) return err } - pbMsg.RecvSeq = seq - log.NewInfo(pbMsg.OperationID, "IncrUserSeq cost time", utils.GetCurrentTimestampByMill()-time) - return db.DB.SaveUserChat(uid, pbMsg.SendTime, pbMsg) -} - -func getGroupList(groupID string) ([]string, error) { - return im_mysql_model.SelectGroupList(groupID) + msg.MsgData.Seq = uint32(seq) + pbSaveData := pbMsg.MsgDataToDB{} + pbSaveData.MsgData = msg.MsgData + log.NewInfo(msg.OperationID, "IncrUserSeq cost time", utils.GetCurrentTimestampByMill()-time) + return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) +// return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) } diff --git a/internal/msg_transfer/logic/history_msg_handler.go b/internal/msg_transfer/logic/history_msg_handler.go index e3b5efb05..1281b1732 100644 --- a/internal/msg_transfer/logic/history_msg_handler.go +++ b/internal/msg_transfer/logic/history_msg_handler.go @@ -8,6 +8,7 @@ import ( "Open_IM/pkg/grpc-etcdv3/getcdv3" pbMsg "Open_IM/pkg/proto/chat" pbPush "Open_IM/pkg/proto/push" + "Open_IM/pkg/statistics" "Open_IM/pkg/utils" "context" "github.com/Shopify/sarama" @@ -20,9 +21,14 @@ type fcb func(msg []byte, msgKey string) type HistoryConsumerHandler struct { msgHandle map[string]fcb historyConsumerGroup *kfk.MConsumerGroup + singleMsgCount uint64 + groupMsgCount uint64 } func (mc *HistoryConsumerHandler) Init() { + statistics.NewStatistics(&mc.singleMsgCount, config.Config.ModuleName.MsgTransferName, "singleMsgCount insert to mongo ", 300) + statistics.NewStatistics(&mc.groupMsgCount, config.Config.ModuleName.MsgTransferName, "groupMsgCount insert to mongo ", 300) + mc.msgHandle = make(map[string]fcb) mc.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = mc.handleChatWs2Mongo mc.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, @@ -32,80 +38,53 @@ func (mc *HistoryConsumerHandler) Init() { } func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) { - log.InfoByKv("chat come mongo!!!", "", "chat", string(msg)) + log.NewInfo("msg come mongo!!!", "", "msg", string(msg)) time := utils.GetCurrentTimestampByNano() - pbData := pbMsg.WSToMsgSvrChatMsg{} - err := proto.Unmarshal(msg, &pbData) + msgFromMQ := pbMsg.MsgDataToMQ{} + err := proto.Unmarshal(msg, &msgFromMQ) if err != nil { - log.ErrorByKv("msg_transfer Unmarshal chat err", "", "chat", string(msg), "err", err.Error()) + log.ErrorByKv("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) return } - pbSaveData := pbMsg.MsgSvrToPushSvrChatMsg{} - pbSaveData.SendID = pbData.SendID - pbSaveData.SenderNickName = pbData.SenderNickName - pbSaveData.SenderFaceURL = pbData.SenderFaceURL - pbSaveData.ClientMsgID = pbData.ClientMsgID - pbSaveData.SendTime = pbData.SendTime - pbSaveData.Content = pbData.Content - pbSaveData.MsgFrom = pbData.MsgFrom - pbSaveData.ContentType = pbData.ContentType - pbSaveData.SessionType = pbData.SessionType - pbSaveData.MsgID = pbData.MsgID - pbSaveData.OperationID = pbData.OperationID - pbSaveData.RecvID = pbData.RecvID - pbSaveData.PlatformID = pbData.PlatformID - Options := utils.JsonStringToMap(pbData.Options) + operationID := msgFromMQ.OperationID //Control whether to store offline messages (mongo) - isHistory := utils.GetSwitchFromOptions(Options, "history") + isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory) //Control whether to store history messages (mysql) - isPersist := utils.GetSwitchFromOptions(Options, "persistent") - switch pbData.SessionType { + isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent) + isSenderSync := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsSenderSync) + switch msgFromMQ.MsgData.SessionType { case constant.SingleChatType: - log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = SingleChatType", isHistory, isPersist) + log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = SingleChatType", isHistory, isPersist) if isHistory { - if msgKey == pbSaveData.RecvID { - err := saveUserChat(pbData.RecvID, &pbSaveData) - if err != nil { - log.NewError(pbSaveData.OperationID, "single data insert to mongo err", err.Error(), pbSaveData.String()) - return - } - - } else if msgKey == pbSaveData.SendID { - err := saveUserChat(pbData.SendID, &pbSaveData) - if err != nil { - log.NewError(pbSaveData.OperationID, "single data insert to mongo err", err.Error(), pbSaveData.String()) - return - } - - } - - log.NewDebug(pbSaveData.OperationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time) - } - if msgKey == pbSaveData.RecvID { - pbSaveData.Options = pbData.Options - pbSaveData.OfflineInfo = pbData.OfflineInfo - go sendMessageToPush(&pbSaveData) - log.NewDebug(pbSaveData.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time) - } - - case constant.GroupChatType: - log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = GroupChatType", isHistory, isPersist) - if isHistory { - uidAndGroupID := strings.Split(pbData.RecvID, " ") - err := saveUserChat(uidAndGroupID[0], &pbSaveData) + err := saveUserChat(msgKey, &msgFromMQ) if err != nil { - log.NewError(pbSaveData.OperationID, "group data insert to mongo err", pbSaveData.String(), uidAndGroupID[0], err.Error()) + log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) return } + mc.singleMsgCount++ + log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time) } - pbSaveData.Options = pbData.Options - pbSaveData.OfflineInfo = pbData.OfflineInfo - go sendMessageToPush(&pbSaveData) + if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { + } else { + go sendMessageToPush(&msgFromMQ, msgKey) + } + log.NewDebug(operationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time) + case constant.GroupChatType: + log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = GroupChatType", isHistory, isPersist) + if isHistory { + err := saveUserChat(msgFromMQ.MsgData.RecvID, &msgFromMQ) + if err != nil { + log.NewError(operationID, "group data insert to mongo err", msgFromMQ.String(), msgFromMQ.MsgData.RecvID, err.Error()) + return + } + mc.groupMsgCount++ + } + go sendMessageToPush(&msgFromMQ, msgFromMQ.MsgData.RecvID) default: - log.NewError(pbSaveData.OperationID, "SessionType error", pbSaveData.String()) + log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) return } - log.NewDebug(pbSaveData.OperationID, "msg_transfer handle topic data to database success...", pbSaveData.String()) + log.NewDebug(msgFromMQ.OperationID, "msg_transfer handle topic data to database success...", msgFromMQ.String()) } func (HistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } @@ -113,50 +92,35 @@ func (HistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { ret func (mc *HistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { for msg := range claim.Messages() { - log.InfoByKv("kafka get info to mongo", "", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "chat", string(msg.Value)) + log.InfoByKv("kafka get info to mongo", "", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) mc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) sess.MarkMessage(msg, "") } return nil } -func sendMessageToPush(message *pbMsg.MsgSvrToPushSvrChatMsg) { +func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { log.InfoByKv("msg_transfer send message to push", message.OperationID, "message", message.String()) - msg := pbPush.PushMsgReq{} - msg.OperationID = message.OperationID - msg.PlatformID = message.PlatformID - msg.Content = message.Content - msg.ContentType = message.ContentType - msg.SessionType = message.SessionType - msg.RecvID = message.RecvID - msg.SendID = message.SendID - msg.SenderNickName = message.SenderNickName - msg.SenderFaceURL = message.SenderFaceURL - msg.ClientMsgID = message.ClientMsgID - msg.MsgFrom = message.MsgFrom - msg.Options = message.Options - msg.RecvSeq = message.RecvSeq - msg.SendTime = message.SendTime - msg.MsgID = message.MsgID - msg.OfflineInfo = message.OfflineInfo + rpcPushMsg := pbPush.PushMsgReq{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} + mqPushMsg := pbMsg.PushMsgDataToMQ{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName) if grpcConn == nil { - log.ErrorByKv("rpc dial failed", msg.OperationID, "push data", msg.String()) - pid, offset, err := producer.SendMessage(message) + log.ErrorByKv("rpc dial failed", rpcPushMsg.OperationID, "push data", rpcPushMsg.String()) + pid, offset, err := producer.SendMessage(&mqPushMsg) if err != nil { - log.ErrorByKv("kafka send failed", msg.OperationID, "send data", message.String(), "pid", pid, "offset", offset, "err", err.Error()) + log.ErrorByKv("kafka send failed", mqPushMsg.OperationID, "send data", message.String(), "pid", pid, "offset", offset, "err", err.Error()) } return } msgClient := pbPush.NewPushMsgServiceClient(grpcConn) - _, err := msgClient.PushMsg(context.Background(), &msg) + _, err := msgClient.PushMsg(context.Background(), &rpcPushMsg) if err != nil { - log.ErrorByKv("rpc send failed", msg.OperationID, "push data", msg.String(), "err", err.Error()) - pid, offset, err := producer.SendMessage(message) + log.ErrorByKv("rpc send failed", rpcPushMsg.OperationID, "push data", rpcPushMsg.String(), "err", err.Error()) + pid, offset, err := producer.SendMessage(&mqPushMsg) if err != nil { - log.ErrorByKv("kafka send failed", msg.OperationID, "send data", message.String(), "pid", pid, "offset", offset, "err", err.Error()) + log.ErrorByKv("kafka send failed", mqPushMsg.OperationID, "send data", mqPushMsg.String(), "pid", pid, "offset", offset, "err", err.Error()) } } else { - log.InfoByKv("rpc send success", msg.OperationID, "push data", msg.String()) + log.InfoByKv("rpc send success", rpcPushMsg.OperationID, "push data", rpcPushMsg.String()) } } diff --git a/internal/msg_transfer/logic/persistent_msg_handler.go b/internal/msg_transfer/logic/persistent_msg_handler.go index 88039041c..59c338294 100644 --- a/internal/msg_transfer/logic/persistent_msg_handler.go +++ b/internal/msg_transfer/logic/persistent_msg_handler.go @@ -16,7 +16,6 @@ import ( "Open_IM/pkg/utils" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" - "strings" ) type PersistentConsumerHandler struct { @@ -32,30 +31,29 @@ func (pc *PersistentConsumerHandler) Init() { config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMySql) } + func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey string) { - log.InfoByKv("chat come here mysql!!!", "", "chat", string(msg)) - pbData := pbMsg.WSToMsgSvrChatMsg{} - err := proto.Unmarshal(msg, &pbData) + log.NewInfo("msg come here mysql!!!", "", "msg", string(msg)) + msgFromMQ := pbMsg.MsgDataToMQ{} + err := proto.Unmarshal(msg, &msgFromMQ) if err != nil { - log.ErrorByKv("msg_transfer Unmarshal chat err", "", "chat", string(msg), "err", err.Error()) + log.ErrorByKv("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) return } - Options := utils.JsonStringToMap(pbData.Options) //Control whether to store history messages (mysql) - isPersist := utils.GetSwitchFromOptions(Options, "persistent") + isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent) //Only process receiver data if isPersist { - if msgKey == pbData.RecvID && pbData.SessionType == constant.SingleChatType { - log.InfoByKv("msg_transfer chat persisting", pbData.OperationID) - if err = im_mysql_msg_model.InsertMessageToChatLog(pbData); err != nil { - log.ErrorByKv("Message insert failed", pbData.OperationID, "err", err.Error(), "chat", pbData.String()) + if msgKey == msgFromMQ.MsgData.RecvID && msgFromMQ.MsgData.SessionType == constant.SingleChatType { + log.InfoByKv("msg_transfer msg persisting", msgFromMQ.OperationID) + if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil { + log.ErrorByKv("Message insert failed", msgFromMQ.OperationID, "err", err.Error(), "msg", msgFromMQ.String()) return } - } else if pbData.SessionType == constant.GroupChatType && msgKey == "0" { - pbData.RecvID = strings.Split(pbData.RecvID, " ")[1] - log.InfoByKv("msg_transfer chat persisting", pbData.OperationID) - if err = im_mysql_msg_model.InsertMessageToChatLog(pbData); err != nil { - log.ErrorByKv("Message insert failed", pbData.OperationID, "err", err.Error(), "chat", pbData.String()) + } else if msgFromMQ.MsgData.SessionType == constant.GroupChatType && msgKey == msgFromMQ.MsgData.SendID { + log.InfoByKv("msg_transfer msg persisting", msgFromMQ.OperationID) + if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil { + log.ErrorByKv("Message insert failed", msgFromMQ.OperationID, "err", err.Error(), "msg", msgFromMQ.String()) return } } @@ -67,7 +65,7 @@ func (PersistentConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { func (pc *PersistentConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { for msg := range claim.Messages() { - log.InfoByKv("kafka get info to mysql", "", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "chat", string(msg.Value)) + log.InfoByKv("kafka get info to mysql", "", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) pc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) sess.MarkMessage(msg, "") } diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index b2cf95d9a..f0843a3f0 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -13,21 +13,24 @@ import ( type JPushResp struct { } -func JGAccountListPush(accounts []string, content, detailContent, platform string) ([]byte, error) { +func JGAccountListPush(accounts []string, alert, detailContent, platform string) ([]byte, error) { var pf requestBody.Platform _ = pf.SetPlatform(platform) var au requestBody.Audience au.SetAlias(accounts) var no requestBody.Notification - no.SetAlert(content) + no.SetAlert(alert, platform) var me requestBody.Message me.SetMsgContent(detailContent) + var o requestBody.Options + o.SetApnsProduction(false) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) po.SetNotification(&no) po.SetMessage(&me) + po.SetOptions(&o) con, err := json.Marshal(po) if err != nil { diff --git a/internal/push/jpush/requestBody/notification.go b/internal/push/jpush/requestBody/notification.go index 192803353..3f2876612 100644 --- a/internal/push/jpush/requestBody/notification.go +++ b/internal/push/jpush/requestBody/notification.go @@ -1,17 +1,41 @@ package requestBody +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" +) + type Notification struct { - Alert string `json:"alert,omitempty"` - Android *Android `json:"android,omitempty"` - IOS *Ios `json:"ios,omitempty"` + Alert string `json:"alert,omitempty"` + Android Android `json:"android,omitempty"` + IOS Ios `json:"ios,omitempty"` } type Android struct { + Alert string `json:"alert,omitempty"` + Intent struct { + URL string `json:"url,omitempty"` + } `json:"intent,omitempty"` } - type Ios struct { + Alert string `json:"alert,omitempty"` + Sound string `json:"sound,omitempty"` + Badge string `json:"badge,omitempty"` } -func (n *Notification) SetAlert(alert string) { +func (n *Notification) SetAlert(alert, platform string) { n.Alert = alert + switch platform { + case constant.AndroidPlatformStr: + n.Android.Alert = alert + n.SetAndroidIntent() + case constant.IOSPlatformStr: + n.IOS.Alert = alert + n.IOS.Sound = "default" + n.IOS.Badge = "+1" + default: + } +} +func (n *Notification) SetAndroidIntent() { + n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent } diff --git a/internal/push/jpush/requestBody/options.go b/internal/push/jpush/requestBody/options.go new file mode 100644 index 000000000..f82ebd035 --- /dev/null +++ b/internal/push/jpush/requestBody/options.go @@ -0,0 +1,9 @@ +package requestBody + +type Options struct { + ApnsProduction bool `json:"apns_production"` +} + +func (o *Options) SetApnsProduction(c bool) { + o.ApnsProduction = c +} diff --git a/internal/push/jpush/requestBody/platform.go b/internal/push/jpush/requestBody/platform.go index 47a08fc57..0f9d243cf 100644 --- a/internal/push/jpush/requestBody/platform.go +++ b/internal/push/jpush/requestBody/platform.go @@ -1,7 +1,7 @@ package requestBody import ( - "Open_IM/pkg/utils" + "Open_IM/pkg/common/constant" "errors" ) @@ -53,9 +53,9 @@ func (p *Platform) Set(os string) error { } func (p *Platform) SetPlatform(platform string) error { switch platform { - case utils.AndroidPlatformStr: + case constant.AndroidPlatformStr: return p.SetAndroid() - case utils.IOSPlatformStr: + case constant.IOSPlatformStr: return p.SetIOS() default: return errors.New("platform err") diff --git a/internal/push/jpush/requestBody/pushObj.go b/internal/push/jpush/requestBody/pushObj.go index 24c912b26..974161407 100644 --- a/internal/push/jpush/requestBody/pushObj.go +++ b/internal/push/jpush/requestBody/pushObj.go @@ -5,6 +5,7 @@ type PushObj struct { Audience interface{} `json:"audience"` Notification interface{} `json:"notification,omitempty"` Message interface{} `json:"message,omitempty"` + Options interface{} `json:"options,omitempty"` } func (p *PushObj) SetPlatform(pf *Platform) { @@ -22,3 +23,6 @@ func (p *PushObj) SetNotification(no *Notification) { func (p *PushObj) SetMessage(m *Message) { p.Message = m } +func (p *PushObj) SetOptions(o *Options) { + p.Options = o +} diff --git a/internal/push/logic/init.go b/internal/push/logic/init.go index 9fba41bdd..6f6f061b8 100644 --- a/internal/push/logic/init.go +++ b/internal/push/logic/init.go @@ -8,9 +8,11 @@ package logic import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/kafka" "Open_IM/pkg/common/log" - "Open_IM/pkg/utils" + "Open_IM/pkg/statistics" + "fmt" ) var ( @@ -18,16 +20,18 @@ var ( pushCh PushConsumerHandler pushTerminal []int32 producer *kafka.Producer + count uint64 ) func Init(rpcPort int) { log.NewPrivateLog(config.Config.ModuleName.PushName) rpcServer.Init(rpcPort) pushCh.Init() - pushTerminal = []int32{utils.IOSPlatformID, utils.AndroidPlatformID} + pushTerminal = []int32{constant.IOSPlatformID, constant.AndroidPlatformID} } func init() { producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) + statistics.NewStatistics(&count, config.Config.ModuleName.PushName, fmt.Sprintf("%d second push to msg_gateway count", 300), 300) } func Run() { diff --git a/internal/push/logic/push_handler.go b/internal/push/logic/push_handler.go index 22382a5b9..294c48f15 100644 --- a/internal/push/logic/push_handler.go +++ b/internal/push/logic/push_handler.go @@ -11,7 +11,7 @@ import ( kfk "Open_IM/pkg/common/kafka" "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/chat" - pbRelay "Open_IM/pkg/proto/relay" + pbPush "Open_IM/pkg/proto/push" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" ) @@ -32,28 +32,13 @@ func (ms *PushConsumerHandler) Init() { } func (ms *PushConsumerHandler) handleMs2PsChat(msg []byte) { log.InfoByKv("msg come from kafka And push!!!", "", "msg", string(msg)) - pbData := pbChat.MsgSvrToPushSvrChatMsg{} - if err := proto.Unmarshal(msg, &pbData); err != nil { + msgFromMQ := pbChat.PushMsgDataToMQ{} + if err := proto.Unmarshal(msg, &msgFromMQ); err != nil { log.ErrorByKv("push Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) return } - sendPbData := pbRelay.MsgToUserReq{} - sendPbData.SendTime = pbData.SendTime - sendPbData.OperationID = pbData.OperationID - sendPbData.ServerMsgID = pbData.MsgID - sendPbData.MsgFrom = pbData.MsgFrom - sendPbData.ContentType = pbData.ContentType - sendPbData.SessionType = pbData.SessionType - sendPbData.RecvID = pbData.RecvID - sendPbData.Content = pbData.Content - sendPbData.SendID = pbData.SendID - sendPbData.SenderNickName = pbData.SenderNickName - sendPbData.SenderFaceURL = pbData.SenderFaceURL - sendPbData.ClientMsgID = pbData.ClientMsgID - sendPbData.PlatformID = pbData.PlatformID - sendPbData.RecvSeq = pbData.RecvSeq //Call push module to send message to the user - MsgToUser(&sendPbData, pbData.OfflineInfo, pbData.Options) + MsgToUser((*pbPush.PushMsgReq)(&msgFromMQ)) } func (PushConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } func (PushConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } diff --git a/internal/push/logic/push_rpc_server.go b/internal/push/logic/push_rpc_server.go index ca0e93880..b622ba721 100644 --- a/internal/push/logic/push_rpc_server.go +++ b/internal/push/logic/push_rpc_server.go @@ -5,7 +5,6 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/push" - pbRelay "Open_IM/pkg/proto/relay" "Open_IM/pkg/utils" "context" "google.golang.org/grpc" @@ -49,23 +48,8 @@ func (r *RPCServer) run() { } } func (r *RPCServer) PushMsg(_ context.Context, pbData *pbPush.PushMsgReq) (*pbPush.PushMsgResp, error) { - sendPbData := pbRelay.MsgToUserReq{} - sendPbData.SendTime = pbData.SendTime - sendPbData.OperationID = pbData.OperationID - sendPbData.ServerMsgID = pbData.MsgID - sendPbData.MsgFrom = pbData.MsgFrom - sendPbData.ContentType = pbData.ContentType - sendPbData.SenderNickName = pbData.SenderNickName - sendPbData.SenderFaceURL = pbData.SenderFaceURL - sendPbData.ClientMsgID = pbData.ClientMsgID - sendPbData.SessionType = pbData.SessionType - sendPbData.RecvID = pbData.RecvID - sendPbData.Content = pbData.Content - sendPbData.SendID = pbData.SendID - sendPbData.PlatformID = pbData.PlatformID - sendPbData.RecvSeq = pbData.RecvSeq //Call push module to send message to the user - MsgToUser(&sendPbData, pbData.OfflineInfo, pbData.Options) + MsgToUser(pbData) return &pbPush.PushMsgResp{ ResultCode: 0, }, nil diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 8f5a004d9..a5a6397f2 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -8,13 +8,11 @@ package logic import ( push "Open_IM/internal/push/jpush" - rpcChat "Open_IM/internal/rpc/chat" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbChat "Open_IM/pkg/proto/chat" - pbGroup "Open_IM/pkg/proto/group" + pbPush "Open_IM/pkg/proto/push" pbRelay "Open_IM/pkg/proto/relay" "Open_IM/pkg/utils" "context" @@ -26,7 +24,7 @@ type OpenIMContent struct { SessionType int `json:"sessionType"` From string `json:"from"` To string `json:"to"` - Seq int64 `json:"seq"` + Seq uint32 `json:"seq"` } type AtContent struct { Text string `json:"text"` @@ -34,48 +32,51 @@ type AtContent struct { IsAtSelf bool `json:"isAtSelf"` } -func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) { +func MsgToUser(pushMsg *pbPush.PushMsgReq) { var wsResult []*pbRelay.SingleMsgToUser - MOptions := utils.JsonStringToMap(Options) //Control whether to push message to sender's other terminal - //isSenderSync := utils.GetSwitchFromOptions(MOptions, "senderSync") - isOfflinePush := utils.GetSwitchFromOptions(MOptions, "offlinePush") - log.InfoByKv("Get chat from msg_transfer And push chat", sendPbData.OperationID, "PushData", sendPbData) + isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) + log.Debug("Get msg from msg_transfer And push msg", pushMsg.OperationID, "PushData", pushMsg.String()) grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) //Online push message - log.InfoByKv("test", sendPbData.OperationID, "len grpc", len(grpcCons), "data", sendPbData) + log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) for _, v := range grpcCons { msgClient := pbRelay.NewOnlineMessageRelayServiceClient(v) - reply, err := msgClient.MsgToUser(context.Background(), sendPbData) + reply, err := msgClient.OnlinePushMsg(context.Background(), &pbRelay.OnlinePushMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserID: pushMsg.PushToUserID}) if err != nil { - log.InfoByKv("push data to client rpc err", sendPbData.OperationID, "err", err) + log.InfoByKv("push data to client rpc err", pushMsg.OperationID, "err", err) + continue } - if reply != nil && reply.Resp != nil && err == nil { + if reply != nil && reply.Resp != nil { wsResult = append(wsResult, reply.Resp...) } } - log.InfoByKv("push_result", sendPbData.OperationID, "result", wsResult, "sendData", sendPbData) - if sendPbData.ContentType != constant.Typing && sendPbData.ContentType != constant.HasReadReceipt { - if isOfflinePush { - for _, v := range wsResult { - if v.ResultCode == 0 { - continue - } - //supported terminal - for _, t := range pushTerminal { - if v.RecvPlatFormID == t { - //Use offline push messaging - var UIDList []string - UIDList = append(UIDList, v.RecvID) - customContent := OpenIMContent{ - SessionType: int(sendPbData.SessionType), - From: sendPbData.SendID, - To: sendPbData.RecvID, - Seq: sendPbData.RecvSeq, - } - bCustomContent, _ := json.Marshal(customContent) - jsonCustomContent := string(bCustomContent) - var content string - switch sendPbData.ContentType { + log.InfoByKv("push_result", pushMsg.OperationID, "result", wsResult, "sendData", pushMsg.MsgData) + count++ + if isOfflinePush && pushMsg.PushToUserID != pushMsg.MsgData.SendID { + for _, v := range wsResult { + if v.ResultCode == 0 { + continue + } + //supported terminal + for _, t := range pushTerminal { + if v.RecvPlatFormID == t { + //Use offline push messaging + var UIDList []string + UIDList = append(UIDList, v.RecvID) + customContent := OpenIMContent{ + SessionType: int(pushMsg.MsgData.SessionType), + From: pushMsg.MsgData.SendID, + To: pushMsg.MsgData.RecvID, + Seq: pushMsg.MsgData.Seq, + } + bCustomContent, _ := json.Marshal(customContent) + jsonCustomContent := string(bCustomContent) + var content string + if pushMsg.MsgData.OfflinePushInfo != nil { + content = pushMsg.MsgData.OfflinePushInfo.Title + + } else { + switch pushMsg.MsgData.ContentType { case constant.Text: content = constant.ContentType2PushContent[constant.Text] case constant.Picture: @@ -88,68 +89,69 @@ func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) { content = constant.ContentType2PushContent[constant.File] case constant.AtText: a := AtContent{} - _ = utils.JsonStringToStruct(sendPbData.Content, &a) + _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) if utils.IsContain(v.RecvID, a.AtUserList) { content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] } else { content = constant.ContentType2PushContent[constant.GroupMsg] } default: + content = constant.ContentType2PushContent[constant.Common] } - pushResult, err := push.JGAccountListPush(UIDList, content, jsonCustomContent, utils.PlatformIDToName(t)) - if err != nil { - log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), t) - } else { - log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, t) - } - } + + pushResult, err := push.JGAccountListPush(UIDList, content, jsonCustomContent, constant.PlatformIDToName(t)) + if err != nil { + log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error(), constant.PlatformIDToName(t)) + } else { + log.NewDebug(pushMsg.OperationID, "offline push return result is ", string(pushResult), pushMsg.MsgData, constant.PlatformIDToName(t)) + } + } } - } - } - -} - -func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) { - m.MsgID = rpcChat.GetMsgID(m.SendID) - m.ClientMsgID = m.MsgID - switch m.SessionType { - case constant.SingleChatType: - sendMsgToKafka(m, m.SendID, "msgKey--sendID") - sendMsgToKafka(m, m.RecvID, "msgKey--recvID") - case constant.GroupChatType: - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pbGroup.NewGroupClient(etcdConn) - req := &pbGroup.GetGroupAllMemberReq{ - GroupID: m.RecvID, - Token: config.Config.Secret, - OperationID: m.OperationID, - } - reply, err := client.GetGroupAllMember(context.Background(), req) - if err != nil { - log.Error(m.Token, m.OperationID, "rpc getGroupInfo failed, err = %s", err.Error()) - return - } - if reply.ErrorCode != 0 { - log.Error(m.Token, m.OperationID, "rpc getGroupInfo failed, err = %s", reply.ErrorMsg) - return - } - groupID := m.RecvID - for i, v := range reply.MemberList { - m.RecvID = v.UserId + " " + groupID - sendMsgToKafka(m, utils.IntToString(i), "msgKey--recvID+\" \"+groupID") - } - default: } - } -func sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string, flag string) { - pid, offset, err := producer.SendMessage(m, key) - if err != nil { - log.ErrorByKv("kafka send failed", m.OperationID, "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), flag, key) - } -} +//func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) { +// m.MsgID = rpcChat.GetMsgID(m.SendID) +// m.ClientMsgID = m.MsgID +// switch m.SessionType { +// case constant.SingleChatType: +// sendMsgToKafka(m, m.SendID, "msgKey--sendID") +// sendMsgToKafka(m, m.RecvID, "msgKey--recvID") +// case constant.GroupChatType: +// etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) +// client := pbGroup.NewGroupClient(etcdConn) +// req := &pbGroup.Req{ +// GroupID: m.RecvID, +// Token: config.Config.Secret, +// OperationID: m.OperationID, +// } +// reply, err := client.(context.Background(), req) +// if err != nil { +// log.Error(m.Token, m.OperationID, "rpc getGroupInfo failed, err = %s", err.Error()) +// return +// } +// if reply.ErrorCode != 0 { +// log.Error(m.Token, m.OperationID, "rpc getGroupInfo failed, err = %s", reply.ErrorMsg) +// return +// } +// groupID := m.RecvID +// for i, v := range reply.MemberList { +// m.RecvID = v.UserId + " " + groupID +// sendMsgToKafka(m, utils.IntToString(i), "msgKey--recvID+\" \"+groupID") +// } +// default: +// +// } +//} +// +//func sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string, flag string) { +// pid, offset, err := producer.SendMessage(m, key) +// if err != nil { +// log.ErrorByKv("kafka send failed", m.OperationID, "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), flag, key) +// } +// +//} diff --git a/internal/rpc/admin_cms/admin_cms.go b/internal/rpc/admin_cms/admin_cms.go new file mode 100644 index 000000000..8d36f3724 --- /dev/null +++ b/internal/rpc/admin_cms/admin_cms.go @@ -0,0 +1,87 @@ +package admin_cms + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAdminCMS "Open_IM/pkg/proto/admin_cms" + "Open_IM/pkg/utils" + "context" + "google.golang.org/grpc" + "net" + "strconv" + "strings" +) + +type adminCMSServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewAdminCMSServer(port int) *adminCMSServer { + log.NewPrivateLog("AdminCMS") + return &adminCMSServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImAdminCMSName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *adminCMSServer) Run() { + log.NewInfo("0", "AdminCMS rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbAdminCMS.RegisterAdminCMSServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "message cms rpc success") +} + +func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLoginReq) (*pbAdminCMS.AdminLoginResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbAdminCMS.AdminLoginResp{} + for i, adminID := range config.Config.Manager.AppManagerUid{ + if adminID == req.AdminID && config.Config.Manager.Secrets[i] == req.Secret { + token, expTime, err := token_verify.CreateToken(adminID, constant.SingleChatType) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "generate token success", "token: ", token, "expTime:", expTime) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "generate token failed", "adminID: ", adminID, err.Error()) + return resp, openIMHttp.WrapError(constant.ErrTokenUnknown) + } + resp.Token = token + break + } + } + + if resp.Token == "" { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "failed") + return resp, openIMHttp.WrapError(constant.ErrTokenMalformed) + } + return resp, nil +} \ No newline at end of file diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go new file mode 100644 index 000000000..bb804d6e2 --- /dev/null +++ b/internal/rpc/auth/auth.go @@ -0,0 +1,104 @@ +package auth + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAuth "Open_IM/pkg/proto/auth" + "Open_IM/pkg/utils" + "context" + "net" + "strconv" + "strings" + + "Open_IM/pkg/common/config" + + "google.golang.org/grpc" +) + +func (rpc *rpcAuth) UserRegister(_ context.Context, req *pbAuth.UserRegisterReq) (*pbAuth.UserRegisterResp, error) { + log.NewInfo(req.OperationID, "UserRegister args ", req.String()) + var user db.User + utils.CopyStructFields(&user, req.UserInfo) + if req.UserInfo.Birth != 0 { + user.Birth = utils.UnixSecondToTime(int64(req.UserInfo.Birth)) + } + err := imdb.UserRegister(user) + if err != nil { + log.NewError(req.OperationID, "UserRegister failed ", err.Error(), user) + return &pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + log.NewInfo(req.OperationID, "rpc UserRegister return") + return &pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{}}, nil +} + +func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbAuth.UserTokenResp, error) { + log.NewInfo(req.OperationID, "UserToken args ", req.String()) + + _, err := imdb.GetUserByUserID(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.FromUserID) + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + tokens, expTime, err := token_verify.CreateToken(req.FromUserID, req.Platform) + if err != nil { + log.NewError(req.OperationID, "CreateToken failed ", err.Error(), req.FromUserID, req.Platform) + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + log.NewInfo(req.OperationID, "rpc UserToken return ") + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}, nil +} + +type rpcAuth struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewRpcAuthServer(port int) *rpcAuth { + log.NewPrivateLog("auth") + return &rpcAuth{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImAuthName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (rpc *rpcAuth) Run() { + log.NewInfo("0", "rpc auth start...") + + address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) + listener, err := net.Listen("tcp", address) + if err != nil { + log.NewError("0", "listen network failed ", err.Error(), address) + return + } + log.NewInfo("0", "listen network success, ", address, listener) + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + + //service registers with etcd + pbAuth.RegisterAuthServer(srv, rpc) + err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error(), + rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) + return + } + log.NewInfo("0", "RegisterAuthServer ok ", rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "rpc auth ok") +} diff --git a/internal/rpc/auth/callback.go b/internal/rpc/auth/callback.go new file mode 100644 index 000000000..8832b06d1 --- /dev/null +++ b/internal/rpc/auth/callback.go @@ -0,0 +1 @@ +package auth diff --git a/internal/rpc/auth/rpcAuth.go b/internal/rpc/auth/rpcAuth.go deleted file mode 100644 index 162f04fd5..000000000 --- a/internal/rpc/auth/rpcAuth.go +++ /dev/null @@ -1,62 +0,0 @@ -package auth - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbAuth "Open_IM/pkg/proto/auth" - "Open_IM/pkg/utils" - "google.golang.org/grpc" - "net" - "strconv" - "strings" -) - -type rpcAuth struct { - rpcPort int - rpcRegisterName string - etcdSchema string - etcdAddr []string -} - -func NewRpcAuthServer(port int) *rpcAuth { - log.NewPrivateLog("auth") - return &rpcAuth{ - rpcPort: port, - rpcRegisterName: config.Config.RpcRegisterName.OpenImAuthName, - etcdSchema: config.Config.Etcd.EtcdSchema, - etcdAddr: config.Config.Etcd.EtcdAddr, - } -} - -func (rpc *rpcAuth) Run() { - log.Info("", "", "rpc get_token init...") - - address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) - listener, err := net.Listen("tcp", address) - if err != nil { - log.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address) - return - } - log.Info("", "", "listen network success, address = %s", address) - - //grpc server - srv := grpc.NewServer() - defer srv.GracefulStop() - - //service registers with etcd - - pbAuth.RegisterAuthServer(srv, rpc) - err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) - if err != nil { - log.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error()) - return - } - - err = srv.Serve(listener) - if err != nil { - log.Info("", "", "rpc get_token fail, err = %s", err.Error()) - return - } - log.Info("", "", "rpc get_token init success") -} diff --git a/internal/rpc/auth/user_register.go b/internal/rpc/auth/user_register.go deleted file mode 100644 index 5f7aa9023..000000000 --- a/internal/rpc/auth/user_register.go +++ /dev/null @@ -1,23 +0,0 @@ -package auth - -import ( - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbAuth "Open_IM/pkg/proto/auth" - "context" -) - -func (rpc *rpcAuth) UserRegister(_ context.Context, pb *pbAuth.UserRegisterReq) (*pbAuth.UserRegisterResp, error) { - log.Info("", "", "rpc user_register start, [data: %s]", pb.String()) - - //if len(pb.UID) == 0 { - // pb.UID = utils.GenID() - //} - if err := im_mysql_model.UserRegister(pb); err != nil { - log.Error("", "", "rpc user_register error, [data: %s] [err: %s]", pb.String(), err.Error()) - return &pbAuth.UserRegisterResp{Success: false}, err - } - log.Info("", "", "rpc user_register success return") - - return &pbAuth.UserRegisterResp{Success: true}, nil -} diff --git a/internal/rpc/auth/user_token.go b/internal/rpc/auth/user_token.go deleted file mode 100644 index 6ebb2900b..000000000 --- a/internal/rpc/auth/user_token.go +++ /dev/null @@ -1,29 +0,0 @@ -package auth - -import ( - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbAuth "Open_IM/pkg/proto/auth" - "Open_IM/pkg/utils" - "context" -) - -func (rpc *rpcAuth) UserToken(_ context.Context, pb *pbAuth.UserTokenReq) (*pbAuth.UserTokenResp, error) { - log.Info("", "", "rpc user_token call start..., [pbTokenReq: %s]", pb.String()) - - _, err := im_mysql_model.FindUserByUID(pb.UID) - if err != nil { - log.Error("", "", "rpc user_token call..., im_mysql_model.AppServerFindFromUserByUserID fail [uid: %s] [err: %s]", pb.UID, err.Error()) - return &pbAuth.UserTokenResp{ErrCode: 500, ErrMsg: err.Error()}, err - } - log.Info("", "", "rpc user_token call..., im_mysql_model.AppServerFindFromUserByUserID") - - tokens, expTime, err := utils.CreateToken(pb.UID, pb.Platform) - if err != nil { - log.Error("", "", "rpc user_token call..., utils.CreateToken fail [uid: %s] [err: %s]", pb.UID, err.Error()) - return &pbAuth.UserTokenResp{ErrCode: 500, ErrMsg: err.Error()}, err - } - log.Info("", "", "rpc user_token success return, [uid: %s] [tokens: %s]", pb.UID, tokens) - - return &pbAuth.UserTokenResp{Token: tokens, ExpiredTime: expTime}, nil -} diff --git a/internal/rpc/chat/pull_message.go b/internal/rpc/chat/pull_message.go deleted file mode 100644 index 725725037..000000000 --- a/internal/rpc/chat/pull_message.go +++ /dev/null @@ -1,159 +0,0 @@ -package chat - -import ( - "context" - "github.com/garyburd/redigo/redis" - - commonDB "Open_IM/pkg/common/db" - "Open_IM/pkg/common/log" - - "sort" - "strings" - - pbMsg "Open_IM/pkg/proto/chat" -) - -func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *pbMsg.GetMaxAndMinSeqReq) (*pbMsg.GetMaxAndMinSeqResp, error) { - log.InfoByKv("rpc getMaxAndMinSeq is arriving", in.OperationID, in.String()) - //seq, err := model.GetBiggestSeqFromReceive(in.UserID) - maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID) - minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) - resp := new(pbMsg.GetMaxAndMinSeqResp) - if err1 == nil { - resp.MaxSeq = maxSeq - } else if err1 == redis.ErrNil { - resp.MaxSeq = 0 - } else { - log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err1.Error()) - resp.MaxSeq = -1 - resp.ErrCode = 200 - resp.ErrMsg = "redis get err" - } - if err2 == nil { - resp.MinSeq = minSeq - } else if err2 == redis.ErrNil { - resp.MinSeq = 0 - } else { - log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err2.Error()) - resp.MinSeq = -1 - resp.ErrCode = 201 - resp.ErrMsg = "redis get err" - } - return resp, nil -} -func (rpc *rpcChat) PullMessage(_ context.Context, in *pbMsg.PullMessageReq) (*pbMsg.PullMessageResp, error) { - log.InfoByKv("rpc pullMessage is arriving", in.OperationID, "args", in.String()) - resp := new(pbMsg.PullMessageResp) - var respSingleMsgFormat []*pbMsg.GatherFormat - var respGroupMsgFormat []*pbMsg.GatherFormat - SingleMsgFormat, GroupMsgFormat, MaxSeq, MinSeq, err := commonDB.DB.GetMsgBySeqRange(in.UserID, in.SeqBegin, in.SeqEnd) - if err != nil { - log.ErrorByKv("pullMsg data error", in.OperationID, in.String()) - resp.ErrCode = 1 - resp.ErrMsg = err.Error() - return resp, nil - } - respSingleMsgFormat = singleMsgHandleByUser(SingleMsgFormat, in.UserID) - respGroupMsgFormat = groupMsgHandleByUser(GroupMsgFormat) - return &pbMsg.PullMessageResp{ - ErrCode: 0, - ErrMsg: "", - MaxSeq: MaxSeq, - MinSeq: MinSeq, - SingleUserMsg: respSingleMsgFormat, - GroupUserMsg: respGroupMsgFormat, - }, nil -} -func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *pbMsg.PullMessageBySeqListReq) (*pbMsg.PullMessageResp, error) { - log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String()) - resp := new(pbMsg.PullMessageResp) - var respSingleMsgFormat []*pbMsg.GatherFormat - var respGroupMsgFormat []*pbMsg.GatherFormat - SingleMsgFormat, GroupMsgFormat, MaxSeq, MinSeq, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList) - if err != nil { - log.ErrorByKv("PullMessageBySeqList data error", in.OperationID, in.String()) - resp.ErrCode = 1 - resp.ErrMsg = err.Error() - return resp, nil - } - respSingleMsgFormat = singleMsgHandleByUser(SingleMsgFormat, in.UserID) - respGroupMsgFormat = groupMsgHandleByUser(GroupMsgFormat) - return &pbMsg.PullMessageResp{ - ErrCode: 0, - ErrMsg: "", - MaxSeq: MaxSeq, - MinSeq: MinSeq, - SingleUserMsg: respSingleMsgFormat, - GroupUserMsg: respGroupMsgFormat, - }, nil -} -func singleMsgHandleByUser(allMsg []*pbMsg.MsgFormat, ownerId string) []*pbMsg.GatherFormat { - var userid string - var respMsgFormat []*pbMsg.GatherFormat - m := make(map[string]MsgFormats) - //Gather messages in the dimension of users - for _, v := range allMsg { - if v.RecvID != ownerId { - userid = v.RecvID - } else { - userid = v.SendID - } - if value, ok := m[userid]; !ok { - var t MsgFormats - m[userid] = append(t, v) - } else { - m[userid] = append(value, v) - } - } - //Return in pb format - for user, msg := range m { - tempUserMsg := new(pbMsg.GatherFormat) - tempUserMsg.ID = user - tempUserMsg.List = msg - sort.Sort(msg) - respMsgFormat = append(respMsgFormat, tempUserMsg) - } - return respMsgFormat -} -func groupMsgHandleByUser(allMsg []*pbMsg.MsgFormat) []*pbMsg.GatherFormat { - var respMsgFormat []*pbMsg.GatherFormat - m := make(map[string]MsgFormats) - //Gather messages in the dimension of users - for _, v := range allMsg { - //Get group ID - groupID := strings.Split(v.RecvID, " ")[1] - if value, ok := m[groupID]; !ok { - var t MsgFormats - m[groupID] = append(t, v) - } else { - m[groupID] = append(value, v) - } - - } - //Return in pb format - for groupID, msg := range m { - tempUserMsg := new(pbMsg.GatherFormat) - tempUserMsg.ID = groupID - tempUserMsg.List = msg - sort.Sort(msg) - respMsgFormat = append(respMsgFormat, tempUserMsg) - } - return respMsgFormat -} - -type MsgFormats []*pbMsg.MsgFormat - -// Implement the sort.Interface interface to get the number of elements method -func (s MsgFormats) Len() int { - return len(s) -} - -//Implement the sort.Interface interface comparison element method -func (s MsgFormats) Less(i, j int) bool { - return s[i].SendTime < s[j].SendTime -} - -//Implement the sort.Interface interface exchange element method -func (s MsgFormats) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go deleted file mode 100644 index 5cfc4ee71..000000000 --- a/internal/rpc/chat/send_msg.go +++ /dev/null @@ -1,186 +0,0 @@ -package chat - -import ( - "Open_IM/internal/api/group" - "Open_IM/internal/push/content_struct" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - http2 "Open_IM/pkg/common/http" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbChat "Open_IM/pkg/proto/chat" - pbGroup "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" - "encoding/json" - "math/rand" - "net/http" - "strconv" - "strings" - "time" -) - -type MsgCallBackReq struct { - SendID string `json:"sendID"` - RecvID string `json:"recvID"` - Content string `json:"content"` - SendTime int64 `json:"sendTime"` - MsgFrom int32 `json:"msgFrom"` - ContentType int32 `json:"contentType"` - SessionType int32 `json:"sessionType"` - PlatformID int32 `json:"senderPlatformID"` -} -type MsgCallBackResp struct { - ErrCode int32 `json:"errCode"` - ErrMsg string `json:"errMsg"` - ResponseErrCode int32 `json:"responseErrCode"` - ResponseResult struct { - ModifiedMsg string `json:"modifiedMsg"` - Ext string `json:"ext"` - } -} - -func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (*pbChat.UserSendMsgResp, error) { - replay := pbChat.UserSendMsgResp{} - log.NewDebug(pb.OperationID, "rpc sendMsg come here", pb.String()) - //if !utils.VerifyToken(pb.Token, pb.SendID) { - // return returnMsg(&replay, pb, http.StatusUnauthorized, "token validate err,not authorized", "", 0) - serverMsgID := GetMsgID(pb.SendID) - pbData := pbChat.WSToMsgSvrChatMsg{} - pbData.MsgFrom = pb.MsgFrom - pbData.SessionType = pb.SessionType - pbData.ContentType = pb.ContentType - pbData.Content = pb.Content - pbData.RecvID = pb.RecvID - pbData.ForceList = pb.ForceList - pbData.OfflineInfo = pb.OffLineInfo - pbData.Options = pb.Options - pbData.PlatformID = pb.PlatformID - pbData.ClientMsgID = pb.ClientMsgID - pbData.SendID = pb.SendID - pbData.SenderNickName = pb.SenderNickName - pbData.SenderFaceURL = pb.SenderFaceURL - pbData.MsgID = serverMsgID - pbData.OperationID = pb.OperationID - pbData.Token = pb.Token - if pb.SendTime == 0 { - pbData.SendTime = utils.GetCurrentTimestampByNano() - } else { - pbData.SendTime = pb.SendTime - } - m := MsgCallBackResp{} - if config.Config.MessageCallBack.CallbackSwitch { - bMsg, err := http2.Post(config.Config.MessageCallBack.CallbackUrl, MsgCallBackReq{ - SendID: pb.SendID, - RecvID: pb.RecvID, - Content: pb.Content, - SendTime: pbData.SendTime, - MsgFrom: pbData.MsgFrom, - ContentType: pb.ContentType, - SessionType: pb.SessionType, - PlatformID: pb.PlatformID, - }, "application/json; charset=utf-8") - if err != nil { - log.ErrorByKv("callback to Business server err", pb.OperationID, "args", pb.String(), "err", err.Error()) - return returnMsg(&replay, pb, http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError), "", 0) - } else if err = json.Unmarshal(bMsg, &m); err != nil { - log.ErrorByKv("ws json Unmarshal err", pb.OperationID, "args", pb.String(), "err", err.Error()) - return returnMsg(&replay, pb, 200, err.Error(), "", 0) - } else { - if m.ErrCode != 0 { - return returnMsg(&replay, pb, m.ResponseErrCode, m.ErrMsg, "", 0) - } else { - pbData.Content = m.ResponseResult.ModifiedMsg - } - } - } - switch pbData.SessionType { - case constant.SingleChatType: - err1 := rpc.sendMsgToKafka(&pbData, pbData.RecvID) - err2 := rpc.sendMsgToKafka(&pbData, pbData.SendID) - if err1 != nil || err2 != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) - } - return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) - case constant.GroupChatType: - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pbGroup.NewGroupClient(etcdConn) - req := &pbGroup.GetGroupAllMemberReq{ - GroupID: pbData.RecvID, - Token: pbData.Token, - OperationID: pbData.OperationID, - } - reply, err := client.GetGroupAllMember(context.Background(), req) - if err != nil { - log.Error(pbData.Token, pbData.OperationID, "rpc send_msg getGroupInfo failed, err = %s", err.Error()) - return returnMsg(&replay, pb, 201, err.Error(), "", 0) - } - if reply.ErrorCode != 0 { - log.Error(pbData.Token, pbData.OperationID, "rpc send_msg getGroupInfo failed, err = %s", reply.ErrorMsg) - return returnMsg(&replay, pb, reply.ErrorCode, reply.ErrorMsg, "", 0) - } - var addUidList []string - switch pbData.ContentType { - case constant.KickGroupMemberTip: - var notification content_struct.NotificationContent - var kickContent group.KickGroupMemberReq - err := utils.JsonStringToStruct(pbData.Content, ¬ification) - if err != nil { - log.ErrorByKv("json unmarshall err", pbData.OperationID, "err", err.Error()) - return returnMsg(&replay, pb, 200, err.Error(), "", 0) - } else { - err := utils.JsonStringToStruct(notification.Detail, &kickContent) - if err != nil { - log.ErrorByKv("json unmarshall err", pbData.OperationID, "err", err.Error()) - return returnMsg(&replay, pb, 200, err.Error(), "", 0) - } - for _, v := range kickContent.UidListInfo { - addUidList = append(addUidList, v.UserId) - } - } - case constant.QuitGroupTip: - addUidList = append(addUidList, pbData.SendID) - default: - } - groupID := pbData.RecvID - for i, v := range reply.MemberList { - pbData.RecvID = v.UserId + " " + groupID - err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i)) - if err != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) - } - } - for i, v := range addUidList { - pbData.RecvID = v + " " + groupID - err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i+1)) - if err != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) - } - } - return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) - default: - return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0) - - } - -} -func (rpc *rpcChat) sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string) error { - pid, offset, err := rpc.producer.SendMessage(m, key) - if err != nil { - log.ErrorByKv("kafka send failed", m.OperationID, "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), "key", key) - } - return err -} -func GetMsgID(sendID string) string { - t := time.Now().Format("2006-01-02 15:04:05") - return t + "-" + sendID + "-" + strconv.Itoa(rand.Int()) -} -func returnMsg(replay *pbChat.UserSendMsgResp, pb *pbChat.UserSendMsgReq, errCode int32, errMsg, serverMsgID string, sendTime int64) (*pbChat.UserSendMsgResp, error) { - replay.ErrCode = errCode - replay.ErrMsg = errMsg - replay.ReqIdentifier = pb.ReqIdentifier - replay.ClientMsgID = pb.ClientMsgID - replay.ServerMsgID = serverMsgID - replay.SendTime = sendTime - return replay, nil -} diff --git a/internal/rpc/friend/add_blacklist.go b/internal/rpc/friend/add_blacklist.go deleted file mode 100644 index f490a2934..000000000 --- a/internal/rpc/friend/add_blacklist.go +++ /dev/null @@ -1,45 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) AddBlacklist(ctx context.Context, req *pbFriend.AddBlacklistReq) (*pbFriend.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc add blacklist is server,args=%s", req.String()) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - - isMagagerFlag := 0 - tokenUid := claims.UID - - if utils.IsContain(tokenUid, config.Config.Manager.AppManagerUid) { - isMagagerFlag = 1 - } - - if isMagagerFlag == 0 { - err = im_mysql_model.InsertInToUserBlackList(claims.UID, req.Uid) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,Failed to add blacklist", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil - } - log.Info(req.Token, req.OperationID, "rpc add blacklist success return,uid=%s", req.Uid) - return &pbFriend.CommonResp{}, nil - } - - err = im_mysql_model.InsertInToUserBlackList(req.OwnerUid, req.Uid) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,Failed to add blacklist", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil - } - log.Info(req.Token, req.OperationID, "rpc add blacklist success return,uid=%s", req.Uid) - return &pbFriend.CommonResp{}, nil -} diff --git a/internal/rpc/friend/add_friend.go b/internal/rpc/friend/add_friend.go deleted file mode 100644 index 615b05170..000000000 --- a/internal/rpc/friend/add_friend.go +++ /dev/null @@ -1,132 +0,0 @@ -package friend - -import ( - "Open_IM/internal/push/content_struct" - "Open_IM/internal/push/logic" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbChat "Open_IM/pkg/proto/chat" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq) (*pbFriend.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc add friend is server,userid=%s", req.Uid) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - //Cannot add non-existent users - if _, err = im_mysql_model.FindUserByUID(req.Uid); err != nil { - log.Error(req.Token, req.OperationID, "this user not exists,cant not add friend") - return &pbFriend.CommonResp{ErrorCode: config.ErrAddFriend.ErrCode, ErrorMsg: config.ErrSearchUserInfo.ErrMsg}, nil - } - - //Establish a latest relationship in the friend request table - err = im_mysql_model.ReplaceIntoFriendReq(claims.UID, req.Uid, constant.ApplicationFriendFlag, req.ReqMessage) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,create friend request record failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrAddFriend.ErrCode, ErrorMsg: config.ErrAddFriend.ErrMsg}, nil - } - log.Info(req.Token, req.OperationID, "rpc add friend is success return,uid=%s", req.Uid) - //Push message when add friend successfully - senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) - receiverInfo, errReceive := im_mysql_model.FindUserByUID(req.Uid) - if errSend == nil && errReceive == nil { - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: senderInfo.UID, - RecvID: receiverInfo.UID, - Content: content_struct.NewContentStructString(0, "", senderInfo.Name+" asked to add you as a friend"), - SendTime: utils.GetCurrentTimestampBySecond(), - MsgFrom: constant.SysMsgType, - ContentType: constant.AddFriendTip, - SessionType: constant.SingleChatType, - OperationID: req.OperationID, - }) - } - return &pbFriend.CommonResp{}, nil -} - -func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.ImportFriendResp, error) { - log.Info(req.Token, req.OperationID, "ImportFriend come here,args=%s", req.String()) - var resp pbFriend.ImportFriendResp - var c pbFriend.CommonResp - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - c.ErrorCode = config.ErrAddFriend.ErrCode - c.ErrorMsg = config.ErrParseToken.ErrMsg - return &pbFriend.ImportFriendResp{CommonResp: &c, FailedUidList: req.UidList}, nil - } - - if !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { - log.Error(req.Token, req.OperationID, "not manager uid", claims.UID) - c.ErrorCode = config.ErrAddFriend.ErrCode - c.ErrorMsg = "not authorized" - return &pbFriend.ImportFriendResp{CommonResp: &c, FailedUidList: req.UidList}, nil - } - if _, err = im_mysql_model.FindUserByUID(req.OwnerUid); err != nil { - log.Error(req.Token, req.OperationID, "this user not exists,cant not add friend", req.OwnerUid) - c.ErrorCode = config.ErrAddFriend.ErrCode - c.ErrorMsg = "this user not exists,cant not add friend" - return &pbFriend.ImportFriendResp{CommonResp: &c, FailedUidList: req.UidList}, nil - } - for _, v := range req.UidList { - if _, fErr := im_mysql_model.FindUserByUID(v); fErr != nil { - c.ErrorMsg = "some uid establish failed" - c.ErrorCode = 408 - resp.CommonResp = &c - resp.FailedUidList = append(resp.FailedUidList, v) - } else { - if _, err = im_mysql_model.FindFriendRelationshipFromFriend(req.OwnerUid, v); err != nil { - //Establish two single friendship - err1 := im_mysql_model.InsertToFriend(req.OwnerUid, v, 1) - if err1 != nil { - resp.FailedUidList = append(resp.FailedUidList, v) - log.NewError(req.OperationID, "err1,create friendship failed", req.OwnerUid, v, err1.Error()) - } - err2 := im_mysql_model.InsertToFriend(v, req.OwnerUid, 1) - if err2 != nil { - log.NewError(req.OperationID, "err2,create friendship failed", v, req.OwnerUid, err2.Error()) - } - if err1 == nil && err2 == nil { - var name, faceUrl string - n := content_struct.NotificationContent{IsDisplay: 1, DefaultTips: constant.FriendAcceptTip} - r, err := im_mysql_model.FindUserByUID(v) - if err != nil { - log.NewError(req.OperationID, "get info failed", err.Error(), v) - } - if r != nil { - name, faceUrl = r.Name, r.Icon - } - - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: v, - RecvID: req.OwnerUid, - SenderFaceURL: faceUrl, - SenderNickName: name, - Content: n.ContentToString(), - SendTime: utils.GetCurrentTimestampByNano(), - MsgFrom: constant.UserMsgType, //Notification message identification - ContentType: constant.AcceptFriendApplicationTip, //Add friend flag - SessionType: constant.SingleChatType, - OperationID: req.OperationID, - }) - } else { - resp.CommonResp.ErrorMsg = "some uid establish failed" - resp.CommonResp.ErrorCode = 408 - resp.FailedUidList = append(resp.FailedUidList, v) - } - } - } - - } - return &resp, nil - -} diff --git a/internal/rpc/friend/add_friend_response.go b/internal/rpc/friend/add_friend_response.go deleted file mode 100644 index 048110a23..000000000 --- a/internal/rpc/friend/add_friend_response.go +++ /dev/null @@ -1,84 +0,0 @@ -package friend - -import ( - "Open_IM/internal/push/content_struct" - "Open_IM/internal/push/logic" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbChat "Open_IM/pkg/proto/chat" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddFriendResponseReq) (*pbFriend.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc add friend response is server,args=%s", req.String()) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - //Check there application before agreeing or refuse to a friend's application - if _, err = im_mysql_model.FindFriendApplyFromFriendReqByUid(req.Uid, claims.UID); err != nil { - log.Error(req.Token, req.OperationID, "No such application record") - return &pbFriend.CommonResp{ErrorCode: config.ErrAgreeToAddFriend.ErrCode, ErrorMsg: config.ErrAgreeToAddFriend.ErrMsg}, nil - } - //Change friend request status flag - err = im_mysql_model.UpdateFriendRelationshipToFriendReq(req.Uid, claims.UID, req.Flag) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,update friend request table failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrAgreeToAddFriend.ErrMsg}, nil - } - log.Info(req.Token, req.OperationID, "rpc add friend response success return,userid=%s,flag=%d", req.Uid, req.Flag) - //Change the status of the friend request form - if req.Flag == constant.FriendFlag { - //Establish friendship after find friend relationship not exists - _, err := im_mysql_model.FindFriendRelationshipFromFriend(claims.UID, req.Uid) - //fixme If there is an error, it means that there is no friend record or database err, if no friend record should be inserted,Continue down execution - if err != nil { - log.Error("", req.OperationID, err.Error()) - } - //Establish two single friendship - err = im_mysql_model.InsertToFriend(claims.UID, req.Uid, req.Flag) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) - } - err = im_mysql_model.InsertToFriend(req.Uid, claims.UID, req.Flag) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) - } - //Push message when establish friends successfully - //senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) - //if errSend == nil { - // logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - // SendID: claims.UID, - // RecvID: req.Uid, - // Content: content_struct.NewContentStructString(1, "", senderInfo.Name+" agreed to add you as a friend."), - // SendTime: utils.GetCurrentTimestampBySecond(), - // MsgFrom: constant.UserMsgType, //Notification message identification - // ContentType: constant.AcceptFriendApplicationTip, //Add friend flag - // SessionType: constant.SingleChatType, - // OperationID: req.OperationID, - // }) - //} - } - if req.Flag == constant.RefuseFriendFlag { - senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) - if errSend == nil { - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, - RecvID: req.Uid, - Content: content_struct.NewContentStructString(0, "", senderInfo.Name+" refuse to add you as a friend."), - SendTime: utils.GetCurrentTimestampBySecond(), - MsgFrom: constant.UserMsgType, //Notification message identification - ContentType: constant.RefuseFriendApplicationTip, //Add friend flag - SessionType: constant.SingleChatType, - OperationID: req.OperationID, - }) - } - } - return &pbFriend.CommonResp{}, nil -} diff --git a/internal/rpc/friend/callback.go b/internal/rpc/friend/callback.go new file mode 100644 index 000000000..cf8ea69c8 --- /dev/null +++ b/internal/rpc/friend/callback.go @@ -0,0 +1 @@ +package friend diff --git a/internal/rpc/friend/delete_friend.go b/internal/rpc/friend/delete_friend.go deleted file mode 100644 index 2b11988b8..000000000 --- a/internal/rpc/friend/delete_friend.go +++ /dev/null @@ -1,27 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) DeleteFriend(ctx context.Context, req *pbFriend.DeleteFriendReq) (*pbFriend.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc delete friend is server,args=%s", req.String()) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - err = im_mysql_model.DeleteSingleFriendInfo(claims.UID, req.Uid) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,delete friend failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil - } - log.Info(req.Token, req.OperationID, "rpc delete friend success return") - return &pbFriend.CommonResp{}, nil -} diff --git a/internal/rpc/friend/firend.go b/internal/rpc/friend/firend.go new file mode 100644 index 000000000..dcea5be2a --- /dev/null +++ b/internal/rpc/friend/firend.go @@ -0,0 +1,519 @@ +package friend + +import ( + chat "Open_IM/internal/rpc/msg" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + cp "Open_IM/pkg/common/utils" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" + sdkws "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "google.golang.org/grpc" + "net" + "strconv" + "strings" + "time" +) + +type friendServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewFriendServer(port int) *friendServer { + log.NewPrivateLog("friend") + return &friendServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *friendServer) Run() { + log.NewInfo("0", "friendServer run...") + + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen ok ", registerAddress) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //User friend related services register to etcd + pbFriend.RegisterFriendServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error(), listener) + return + } +} + +func (s *friendServer) AddBlacklist(ctx context.Context, req *pbFriend.AddBlacklistReq) (*pbFriend.AddBlacklistResp, error) { + log.NewInfo(req.CommID.OperationID, "AddBlacklist args ", req.String()) + ok := token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) + if !ok { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + black := db.Black{OwnerUserID: req.CommID.FromUserID, BlockUserID: req.CommID.ToUserID, OperatorUserID: req.CommID.OpUserID} + + err := imdb.InsertInToUserBlackList(black) + if err != nil { + log.NewError(req.CommID.OperationID, "InsertInToUserBlackList failed ", err.Error()) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + log.NewInfo(req.CommID.OperationID, "AddBlacklist rpc ok ", req.CommID.FromUserID, req.CommID.ToUserID) + chat.BlackAddedNotification(req) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq) (*pbFriend.AddFriendResp, error) { + log.NewInfo(req.CommID.OperationID, "AddFriend args ", req.String()) + ok := token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) + if !ok { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + //Cannot add non-existent users + if _, err := imdb.GetUserByUserID(req.CommID.ToUserID); err != nil { + log.NewError(req.CommID.OperationID, "GetUserByUserID failed ", err.Error(), req.CommID.ToUserID) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + //Establish a latest relationship in the friend request table + friendRequest := db.FriendRequest{ + HandleResult: 0, ReqMsg: req.ReqMsg, CreateTime: time.Now()} + utils.CopyStructFields(&friendRequest, req.CommID) + // {openIM001 openIM002 0 test add friend 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC }] + log.NewDebug(req.CommID.OperationID, "UpdateFriendApplication args ", friendRequest) + //err := imdb.InsertFriendApplication(&friendRequest) + err := imdb.InsertFriendApplication(&friendRequest, + map[string]interface{}{"handle_result": 0, "req_msg": friendRequest.ReqMsg, "create_time": friendRequest.CreateTime, + "handler_user_id": "", "handle_msg": "", "handle_time": utils.UnixSecondToTime(0), "ex": ""}) + if err != nil { + log.NewError(req.CommID.OperationID, "UpdateFriendApplication failed ", err.Error(), friendRequest) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + chat.FriendApplicationNotification(req) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.ImportFriendResp, error) { + log.NewInfo(req.OperationID, "ImportFriend args ", req.String()) + resp := pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{}} + var c pbFriend.CommonResp + + if !utils.IsContain(req.OpUserID, config.Config.Manager.AppManagerUid) { + log.NewError(req.OperationID, "not authorized", req.OpUserID, config.Config.Manager.AppManagerUid) + c.ErrCode = constant.ErrAccess.ErrCode + c.ErrMsg = constant.ErrAccess.ErrMsg + for _, v := range req.FriendUserIDList { + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + } + resp.CommonResp = &c + return &resp, nil + } + if _, err := imdb.GetUserByUserID(req.FromUserID); err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.FromUserID) + c.ErrCode = constant.ErrDB.ErrCode + c.ErrMsg = "this user not exists,cant not add friend" + for _, v := range req.FriendUserIDList { + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + } + resp.CommonResp = &c + return &resp, nil + } + + for _, v := range req.FriendUserIDList { + log.NewDebug(req.OperationID, "FriendUserIDList ", v) + if _, fErr := imdb.GetUserByUserID(v); fErr != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", fErr.Error(), v) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + } else { + if _, err := imdb.GetFriendRelationshipFromFriend(req.FromUserID, v); err != nil { + //Establish two single friendship + toInsertFollow := db.Friend{OwnerUserID: req.FromUserID, FriendUserID: v} + err1 := imdb.InsertToFriend(&toInsertFollow) + if err1 != nil { + log.NewError(req.OperationID, "InsertToFriend failed ", err1.Error(), toInsertFollow) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + continue + } + toInsertFollow = db.Friend{OwnerUserID: v, FriendUserID: req.FromUserID} + err2 := imdb.InsertToFriend(&toInsertFollow) + if err2 != nil { + log.NewError(req.OperationID, "InsertToFriend failed ", err2.Error(), toInsertFollow) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + continue + } + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: 0}) + log.NewDebug(req.OperationID, "UserIDResultList ", resp.UserIDResultList) + chat.FriendAddedNotification(req.OperationID, req.OpUserID, req.FromUserID, v) + } else { + log.NewWarn(req.OperationID, "GetFriendRelationshipFromFriend ok", req.FromUserID, v) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: 0}) + } + } + } + resp.CommonResp.ErrCode = 0 + log.NewInfo(req.OperationID, "ImportFriend rpc ok ", resp.String()) + return &resp, nil +} + +//process Friend application +func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddFriendResponseReq) (*pbFriend.AddFriendResponseResp, error) { + log.NewInfo(req.CommID.OperationID, "AddFriendResponse args ", req.String()) + + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + //Check there application before agreeing or refuse to a friend's application + //req.CommID.FromUserID process req.CommID.ToUserID + friendRequest, err := imdb.GetFriendApplicationByBothUserID(req.CommID.ToUserID, req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetFriendApplicationByBothUserID failed ", err.Error(), req.CommID.ToUserID, req.CommID.FromUserID) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + friendRequest.HandleResult = req.HandleResult + friendRequest.HandleTime = time.Now() + //friendRequest.HandleTime.Unix() + friendRequest.HandleMsg = req.HandleMsg + friendRequest.HandlerUserID = req.CommID.OpUserID + err = imdb.UpdateFriendApplication(friendRequest) + if err != nil { + log.NewError(req.CommID.OperationID, "UpdateFriendApplication failed ", err.Error(), friendRequest) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + //Change the status of the friend request form + if req.HandleResult == constant.FriendFlag { + //Establish friendship after find friend relationship not exists + _, err := imdb.GetFriendRelationshipFromFriend(req.CommID.FromUserID, req.CommID.ToUserID) + if err == nil { + log.NewWarn(req.CommID.OperationID, "GetFriendRelationshipFromFriend exist", req.CommID.FromUserID, req.CommID.ToUserID) + } else { + //Establish two single friendship + toInsertFollow := db.Friend{OwnerUserID: req.CommID.FromUserID, FriendUserID: req.CommID.ToUserID, OperatorUserID: req.CommID.OpUserID} + err = imdb.InsertToFriend(&toInsertFollow) + if err != nil { + log.NewError(req.CommID.OperationID, "InsertToFriend failed ", err.Error(), toInsertFollow) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + } + + _, err = imdb.GetFriendRelationshipFromFriend(req.CommID.ToUserID, req.CommID.FromUserID) + if err == nil { + log.NewWarn(req.CommID.OperationID, "GetFriendRelationshipFromFriend exist", req.CommID.ToUserID, req.CommID.FromUserID) + } else { + toInsertFollow := db.Friend{OwnerUserID: req.CommID.ToUserID, FriendUserID: req.CommID.FromUserID, OperatorUserID: req.CommID.OpUserID} + err = imdb.InsertToFriend(&toInsertFollow) + if err != nil { + log.NewError(req.CommID.OperationID, "InsertToFriend failed ", err.Error(), toInsertFollow) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.FriendAddedNotification(req.CommID.OperationID, req.CommID.OpUserID, req.CommID.FromUserID, req.CommID.ToUserID) + } + } + if req.HandleResult == constant.FriendResponseAgree { + chat.FriendApplicationApprovedNotification(req) + } else if req.HandleResult == constant.FriendResponseRefuse { + chat.FriendApplicationRejectedNotification(req) + } else { + log.Error(req.CommID.OperationID, "HandleResult failed ", req.HandleResult) + } + log.NewInfo(req.CommID.OperationID, "rpc AddFriendResponse ok") + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) DeleteFriend(ctx context.Context, req *pbFriend.DeleteFriendReq) (*pbFriend.DeleteFriendResp, error) { + log.NewInfo(req.CommID.OperationID, "DeleteFriend args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + err := imdb.DeleteSingleFriendInfo(req.CommID.FromUserID, req.CommID.ToUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "DeleteSingleFriendInfo failed", err.Error(), req.CommID.FromUserID, req.CommID.ToUserID) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + log.NewInfo(req.CommID.OperationID, "DeleteFriend rpc ok") + chat.FriendDeletedNotification(req) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) GetBlacklist(ctx context.Context, req *pbFriend.GetBlacklistReq) (*pbFriend.GetBlacklistResp, error) { + log.NewInfo(req.CommID.OperationID, "GetBlacklist args ", req.String()) + + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetBlacklistResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + blackListInfo, err := imdb.GetBlackListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetBlackListByUID failed ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetBlacklistResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + + var ( + userInfoList []*sdkws.PublicUserInfo + ) + for _, blackUser := range blackListInfo { + var blackUserInfo sdkws.PublicUserInfo + //Find black user information + us, err := imdb.GetUserByUserID(blackUser.BlockUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetUserByUserID failed ", err.Error(), blackUser.BlockUserID) + continue + } + utils.CopyStructFields(&blackUserInfo, us) + userInfoList = append(userInfoList, &blackUserInfo) + } + log.NewInfo(req.CommID.OperationID, "rpc GetBlacklist ok ", pbFriend.GetBlacklistResp{BlackUserInfoList: userInfoList}) + return &pbFriend.GetBlacklistResp{BlackUserInfoList: userInfoList}, nil +} + +func (s *friendServer) SetFriendRemark(ctx context.Context, req *pbFriend.SetFriendRemarkReq) (*pbFriend.SetFriendRemarkResp, error) { + log.NewInfo(req.CommID.OperationID, "SetFriendComment args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.SetFriendRemarkResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + err := imdb.UpdateFriendComment(req.CommID.FromUserID, req.CommID.ToUserID, req.Remark) + if err != nil { + log.NewError(req.CommID.OperationID, "UpdateFriendComment failed ", req.CommID.FromUserID, req.CommID.ToUserID, req.Remark) + return &pbFriend.SetFriendRemarkResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + log.NewInfo(req.CommID.OperationID, "rpc SetFriendComment ok") + chat.FriendRemarkSetNotification(req.CommID.OperationID, req.CommID.OpUserID, req.CommID.FromUserID, req.CommID.ToUserID) + return &pbFriend.SetFriendRemarkResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) RemoveBlacklist(ctx context.Context, req *pbFriend.RemoveBlacklistReq) (*pbFriend.RemoveBlacklistResp, error) { + log.NewInfo(req.CommID.OperationID, "RemoveBlacklist args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + err := imdb.RemoveBlackList(req.CommID.FromUserID, req.CommID.ToUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "RemoveBlackList failed", err.Error(), req.CommID.FromUserID, req.CommID.ToUserID) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + } + log.NewInfo(req.CommID.OperationID, "rpc RemoveBlacklist ok ") + chat.BlackDeletedNotification(req) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) IsInBlackList(ctx context.Context, req *pbFriend.IsInBlackListReq) (*pbFriend.IsInBlackListResp, error) { + log.NewInfo("IsInBlackList args ", req.String()) + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.IsInBlackListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + var isInBlacklist = false + err := imdb.CheckBlack(req.CommID.FromUserID, req.CommID.ToUserID) + if err == nil { + isInBlacklist = true + } + log.NewInfo(req.CommID.OperationID, "IsInBlackList rpc ok ", pbFriend.IsInBlackListResp{Response: isInBlacklist}) + return &pbFriend.IsInBlackListResp{Response: isInBlacklist}, nil +} + +func (s *friendServer) IsFriend(ctx context.Context, req *pbFriend.IsFriendReq) (*pbFriend.IsFriendResp, error) { + log.NewInfo("IsFriend args ", req.String()) + var isFriend bool + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.IsFriendResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + _, err := imdb.GetFriendRelationshipFromFriend(req.CommID.FromUserID, req.CommID.ToUserID) + if err == nil { + isFriend = true + } else { + isFriend = false + } + log.NewInfo("IsFriend rpc ok ", pbFriend.IsFriendResp{Response: isFriend}) + return &pbFriend.IsFriendResp{Response: isFriend}, nil +} + +func (s *friendServer) GetFriendList(ctx context.Context, req *pbFriend.GetFriendListReq) (*pbFriend.GetFriendListResp, error) { + log.NewInfo("GetFriendList args ", req.String()) + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetFriendListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + friends, err := imdb.GetFriendListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "FindUserInfoFromFriend failed ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetFriendListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + var userInfoList []*sdkws.FriendInfo + for _, friendUser := range friends { + friendUserInfo := sdkws.FriendInfo{FriendUser: &sdkws.UserInfo{}} + cp.FriendDBCopyOpenIM(&friendUserInfo, &friendUser) + log.NewDebug(req.CommID.OperationID, "friends : ", friendUser, "openim friends: ", friendUserInfo) + userInfoList = append(userInfoList, &friendUserInfo) + } + log.NewInfo(req.CommID.OperationID, "rpc GetFriendList ok", pbFriend.GetFriendListResp{FriendInfoList: userInfoList}) + return &pbFriend.GetFriendListResp{FriendInfoList: userInfoList}, nil +} + +//received +func (s *friendServer) GetFriendApplyList(ctx context.Context, req *pbFriend.GetFriendApplyListReq) (*pbFriend.GetFriendApplyListResp, error) { + log.NewInfo(req.CommID.OperationID, "GetFriendApplyList args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetFriendApplyListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + // Find the current user friend applications received + ApplyUsersInfo, err := imdb.GetReceivedFriendsApplicationListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetReceivedFriendsApplicationListByUserID ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetFriendApplyListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + + var appleUserList []*sdkws.FriendRequest + for _, applyUserInfo := range ApplyUsersInfo { + var userInfo sdkws.FriendRequest + cp.FriendRequestDBCopyOpenIM(&userInfo, &applyUserInfo) + // utils.CopyStructFields(&userInfo, applyUserInfo) + // u, err := imdb.GetUserByUserID(userInfo.FromUserID) + // if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.FromUserID) + // continue + // } + // userInfo.FromNickname = u.Nickname + // userInfo.FromFaceURL = u.FaceURL + // userInfo.FromGender = u.Gender + // + // u, err = imdb.GetUserByUserID(userInfo.ToUserID) + // if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.ToUserID) + // continue + // } + // userInfo.ToNickname = u.Nickname + // userInfo.ToFaceURL = u.FaceURL + // userInfo.ToGender = u.Gender + appleUserList = append(appleUserList, &userInfo) + } + + log.NewInfo(req.CommID.OperationID, "rpc GetFriendApplyList ok", pbFriend.GetFriendApplyListResp{FriendRequestList: appleUserList}) + return &pbFriend.GetFriendApplyListResp{FriendRequestList: appleUserList}, nil +} + +func (s *friendServer) GetSelfApplyList(ctx context.Context, req *pbFriend.GetSelfApplyListReq) (*pbFriend.GetSelfApplyListResp, error) { + log.NewInfo(req.CommID.OperationID, "GetSelfApplyList args ", req.String()) + + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetSelfApplyListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + // Find the self add other userinfo + usersInfo, err := imdb.GetSendFriendApplicationListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetSendFriendApplicationListByUserID failed ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetSelfApplyListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + var selfApplyOtherUserList []*sdkws.FriendRequest + for _, selfApplyOtherUserInfo := range usersInfo { + var userInfo sdkws.FriendRequest // pbFriend.ApplyUserInfo + cp.FriendRequestDBCopyOpenIM(&userInfo, &selfApplyOtherUserInfo) + //u, err := imdb.GetUserByUserID(userInfo.FromUserID) + //if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.FromUserID) + // continue + //} + //userInfo.FromNickname = u.Nickname + //userInfo.FromFaceURL = u.FaceURL + //userInfo.FromGender = u.Gender + // + //u, err = imdb.GetUserByUserID(userInfo.ToUserID) + //if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.ToUserID) + // continue + //} + //userInfo.ToNickname = u.Nickname + //userInfo.ToFaceURL = u.FaceURL + //userInfo.ToGender = u.Gender + + selfApplyOtherUserList = append(selfApplyOtherUserList, &userInfo) + } + log.NewInfo(req.CommID.OperationID, "rpc GetSelfApplyList ok", pbFriend.GetSelfApplyListResp{FriendRequestList: selfApplyOtherUserList}) + return &pbFriend.GetSelfApplyListResp{FriendRequestList: selfApplyOtherUserList}, nil +} + +//// +//func (s *friendServer) GetFriendsInfo(ctx context.Context, req *pbFriend.GetFriendsInfoReq) (*pbFriend.GetFriendInfoResp, error) { +// return nil, nil +//// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo args ", req.String()) +//// var ( +//// isInBlackList int32 +//// // isFriend int32 +//// comment string +//// ) +//// +//// friendShip, err := imdb.FindFriendRelationshipFromFriend(req.CommID.FromUserID, req.CommID.ToUserID) +//// if err != nil { +//// log.NewError(req.CommID.OperationID, "FindFriendRelationshipFromFriend failed ", err.Error()) +//// return &pbFriend.GetFriendInfoResp{ErrCode: constant.ErrSearchUserInfo.ErrCode, ErrMsg: constant.ErrSearchUserInfo.ErrMsg}, nil +//// // isFriend = constant.FriendFlag +//// } +//// comment = friendShip.Remark +//// +//// friendUserInfo, err := imdb.FindUserByUID(req.CommID.ToUserID) +//// if err != nil { +//// log.NewError(req.CommID.OperationID, "FindUserByUID failed ", err.Error()) +//// return &pbFriend.GetFriendInfoResp{ErrCode: constant.ErrSearchUserInfo.ErrCode, ErrMsg: constant.ErrSearchUserInfo.ErrMsg}, nil +//// } +//// +//// err = imdb.FindRelationshipFromBlackList(req.CommID.FromUserID, req.CommID.ToUserID) +//// if err == nil { +//// isInBlackList = constant.BlackListFlag +//// } +//// +//// resp := pbFriend.GetFriendInfoResp{ErrCode: 0, ErrMsg: "",} +//// +//// utils.CopyStructFields(resp.FriendInfoList, friendUserInfo) +//// resp.Data.IsBlack = isInBlackList +//// resp.Data.OwnerUserID = req.CommID.FromUserID +//// resp.Data.Remark = comment +//// resp.Data.CreateTime = friendUserInfo.CreateTime +//// +//// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo ok ", resp) +//// return &resp, nil +//// +//} diff --git a/internal/rpc/friend/get_blacklist.go b/internal/rpc/friend/get_blacklist.go deleted file mode 100644 index 99d57fb25..000000000 --- a/internal/rpc/friend/get_blacklist.go +++ /dev/null @@ -1,55 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) GetBlacklist(ctx context.Context, req *pbFriend.GetBlacklistReq) (*pbFriend.GetBlacklistResp, error) { - log.Info(req.Token, req.OperationID, "rpc get blacklist is server,args=%s", req.String()) - var ( - userInfoList []*pbFriend.UserInfo - comment string - ) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.GetBlacklistResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - blackListInfo, err := im_mysql_model.GetBlackListByUID(claims.UID) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s get blacklist failed", err.Error()) - return &pbFriend.GetBlacklistResp{ErrorCode: config.ErrGetBlackList.ErrCode, ErrorMsg: config.ErrGetBlackList.ErrMsg}, nil - } - for _, blackUser := range blackListInfo { - var blackUserInfo pbFriend.UserInfo - //Find black user information - us, err := im_mysql_model.FindUserByUID(blackUser.BlockId) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s search black list userInfo failed", err.Error()) - continue - } - friendShip, err := im_mysql_model.FindFriendRelationshipFromFriend(claims.UID, blackUser.BlockId) - if err == nil { - comment = friendShip.Comment - } - blackUserInfo.Uid = us.UID - blackUserInfo.Icon = us.Icon - blackUserInfo.Name = us.Name - blackUserInfo.Gender = us.Gender - blackUserInfo.Mobile = us.Mobile - blackUserInfo.Birth = us.Birth - blackUserInfo.Email = us.Email - blackUserInfo.Ex = us.Ex - blackUserInfo.Comment = comment - - userInfoList = append(userInfoList, &blackUserInfo) - } - log.Info(req.Token, req.OperationID, "rpc get blacklist success return") - return &pbFriend.GetBlacklistResp{Data: userInfoList}, nil -} diff --git a/internal/rpc/friend/get_firends_info.go b/internal/rpc/friend/get_firends_info.go deleted file mode 100644 index 1aa34a43b..000000000 --- a/internal/rpc/friend/get_firends_info.go +++ /dev/null @@ -1,112 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" - "fmt" - "google.golang.org/grpc" - "net" - "strconv" - "strings" -) - -type friendServer struct { - rpcPort int - rpcRegisterName string - etcdSchema string - etcdAddr []string -} - -func NewFriendServer(port int) *friendServer { - log.NewPrivateLog("friend") - return &friendServer{ - rpcPort: port, - rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName, - etcdSchema: config.Config.Etcd.EtcdSchema, - etcdAddr: config.Config.Etcd.EtcdAddr, - } -} - -func (s *friendServer) Run() { - log.Info("", "", fmt.Sprintf("rpc friend init....")) - - ip := utils.ServerIP - registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) - //listener network - listener, err := net.Listen("tcp", registerAddress) - if err != nil { - log.InfoByArgs(fmt.Sprintf("Failed to listen rpc friend network,err=%s", err.Error())) - return - } - log.Info("", "", "listen network success, address = %s", registerAddress) - defer listener.Close() - //grpc server - srv := grpc.NewServer() - defer srv.GracefulStop() - //User friend related services register to etcd - pbFriend.RegisterFriendServer(srv, s) - err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) - if err != nil { - log.ErrorByArgs("register rpc fiend service to etcd failed,err=%s", err.Error()) - return - } - err = srv.Serve(listener) - if err != nil { - log.ErrorByArgs("listen rpc friend error,err=%s", err.Error()) - return - } -} - -func (s *friendServer) GetFriendsInfo(ctx context.Context, req *pbFriend.GetFriendsInfoReq) (*pbFriend.GetFriendInfoResp, error) { - log.Info(req.Token, req.OperationID, "rpc search user is server,args=%s", req.String()) - var ( - isInBlackList int32 - isFriend int32 - comment string - ) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.GetFriendInfoResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - friendShip, err := im_mysql_model.FindFriendRelationshipFromFriend(claims.UID, req.Uid) - if err == nil { - isFriend = constant.FriendFlag - comment = friendShip.Comment - } - friendUserInfo, err := im_mysql_model.FindUserByUID(req.Uid) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,no this user", err.Error()) - return &pbFriend.GetFriendInfoResp{ErrorCode: config.ErrSearchUserInfo.ErrCode, ErrorMsg: config.ErrSearchUserInfo.ErrMsg}, nil - } - err = im_mysql_model.FindRelationshipFromBlackList(claims.UID, req.Uid) - if err == nil { - isInBlackList = constant.BlackListFlag - } - log.Info(req.Token, req.OperationID, "rpc search friend success return") - return &pbFriend.GetFriendInfoResp{ - ErrorCode: 0, - ErrorMsg: "", - Data: &pbFriend.GetFriendData{ - Uid: friendUserInfo.UID, - Icon: friendUserInfo.Icon, - Name: friendUserInfo.Name, - Gender: friendUserInfo.Gender, - Mobile: friendUserInfo.Mobile, - Birth: friendUserInfo.Birth, - Email: friendUserInfo.Email, - Ex: friendUserInfo.Ex, - Comment: comment, - IsFriend: isFriend, - IsInBlackList: isInBlackList, - }, - }, nil - -} diff --git a/internal/rpc/friend/get_friend_apply_list.go b/internal/rpc/friend/get_friend_apply_list.go deleted file mode 100644 index 556576f71..000000000 --- a/internal/rpc/friend/get_friend_apply_list.go +++ /dev/null @@ -1,95 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" - "fmt" - "strconv" -) - -func (s *friendServer) GetFriendApplyList(ctx context.Context, req *pbFriend.GetFriendApplyReq) (*pbFriend.GetFriendApplyResp, error) { - log.Info(req.Token, req.OperationID, "rpc get friend apply list is server,args=%s", req.String()) - var appleUserList []*pbFriend.ApplyUserInfo - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.GetFriendApplyResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - // Find the current user friend applications received - ApplyUsersInfo, err := im_mysql_model.FindFriendsApplyFromFriendReq(claims.UID) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,search applyInfo failed", err.Error()) - return &pbFriend.GetFriendApplyResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil - } - for _, applyUserInfo := range ApplyUsersInfo { - var userInfo pbFriend.ApplyUserInfo - //Find friend application status - userInfo.Flag = applyUserInfo.Flag - userInfo.ReqMessage = applyUserInfo.ReqMessage - userInfo.ApplyTime = strconv.FormatInt(applyUserInfo.CreateTime.Unix(), 10) - //Find user information - us, err := im_mysql_model.FindUserByUID(applyUserInfo.ReqId) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,search userInfo failed", err.Error()) - continue - } - userInfo.Uid = us.UID - userInfo.Icon = us.Icon - userInfo.Name = us.Name - userInfo.Gender = us.Gender - userInfo.Mobile = us.Mobile - userInfo.Birth = us.Birth - userInfo.Email = us.Email - userInfo.Ex = us.Ex - appleUserList = append(appleUserList, &userInfo) - - } - log.Info(req.Token, req.OperationID, fmt.Sprintf("rpc get friendapplylist success return")) - return &pbFriend.GetFriendApplyResp{Data: appleUserList}, nil -} - -func (s *friendServer) GetSelfApplyList(ctx context.Context, req *pbFriend.GetFriendApplyReq) (*pbFriend.GetFriendApplyResp, error) { - log.Info(req.Token, req.OperationID, "rpc get self apply list is server,args=%s", req.String()) - var selfApplyOtherUserList []*pbFriend.ApplyUserInfo - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.GetFriendApplyResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - // Find the self add other userinfo - usersInfo, err := im_mysql_model.FindSelfApplyFromFriendReq(claims.UID) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,search self to other user Info failed", err.Error()) - return &pbFriend.GetFriendApplyResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil - } - for _, selfApplyOtherUserInfo := range usersInfo { - var userInfo pbFriend.ApplyUserInfo - //Find friend application status - userInfo.Flag = selfApplyOtherUserInfo.Flag - userInfo.ReqMessage = selfApplyOtherUserInfo.ReqMessage - userInfo.ApplyTime = strconv.FormatInt(selfApplyOtherUserInfo.CreateTime.Unix(), 10) - //Find user information - us, err := im_mysql_model.FindUserByUID(selfApplyOtherUserInfo.Uid) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,search userInfo failed", err.Error()) - continue - } - userInfo.Uid = us.UID - userInfo.Icon = us.Icon - userInfo.Name = us.Name - userInfo.Gender = us.Gender - userInfo.Mobile = us.Mobile - userInfo.Birth = us.Birth - userInfo.Email = us.Email - userInfo.Ex = us.Ex - selfApplyOtherUserList = append(selfApplyOtherUserList, &userInfo) - } - log.Info(req.Token, req.OperationID, fmt.Sprintf("rpc get self apply list success return")) - return &pbFriend.GetFriendApplyResp{Data: selfApplyOtherUserList}, nil -} diff --git a/internal/rpc/friend/get_friend_list.go b/internal/rpc/friend/get_friend_list.go deleted file mode 100644 index 0674cdc53..000000000 --- a/internal/rpc/friend/get_friend_list.go +++ /dev/null @@ -1,58 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) GetFriendList(ctx context.Context, req *pbFriend.GetFriendListReq) (*pbFriend.GetFriendListResp, error) { - log.Info(req.Token, req.OperationID, "rpc get friend list is server,args=%s", req.String()) - var userInfoList []*pbFriend.UserInfo - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.GetFriendListResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - friends, err := im_mysql_model.FindUserInfoFromFriend(claims.UID) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s search friendInfo failed", err.Error()) - return &pbFriend.GetFriendListResp{ErrorCode: config.ErrSearchUserInfo.ErrCode, ErrorMsg: config.ErrSearchUserInfo.ErrMsg}, nil - } - for _, friendUser := range friends { - var friendUserInfo pbFriend.UserInfo - - //find user is in blackList - err = im_mysql_model.FindRelationshipFromBlackList(claims.UID, friendUser.FriendId) - if err == nil { - friendUserInfo.IsInBlackList = constant.BlackListFlag - } else { - friendUserInfo.IsInBlackList = 0 - } - //Find user information - us, err := im_mysql_model.FindUserByUID(friendUser.FriendId) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s search userInfo failed", err.Error()) - continue - } - friendUserInfo.Uid = friendUser.FriendId - friendUserInfo.Comment = friendUser.Comment - friendUserInfo.Icon = us.Icon - friendUserInfo.Name = us.Name - friendUserInfo.Gender = us.Gender - friendUserInfo.Mobile = us.Mobile - friendUserInfo.Birth = us.Birth - friendUserInfo.Email = us.Email - friendUserInfo.Ex = us.Ex - - userInfoList = append(userInfoList, &friendUserInfo) - - } - log.Info(req.Token, req.OperationID, "rpc get friend list success return") - return &pbFriend.GetFriendListResp{Data: userInfoList}, nil -} diff --git a/internal/rpc/friend/is_friend.go b/internal/rpc/friend/is_friend.go deleted file mode 100644 index 3690423e7..000000000 --- a/internal/rpc/friend/is_friend.go +++ /dev/null @@ -1,30 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" - "fmt" -) - -func (s *friendServer) IsFriend(ctx context.Context, req *pbFriend.IsFriendReq) (*pbFriend.IsFriendResp, error) { - log.InfoByArgs("rpc is friend is server,args=%s", req.String()) - var isFriend int32 - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.IsFriendResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - _, err = im_mysql_model.FindFriendRelationshipFromFriend(claims.UID, req.ReceiveUid) - if err == nil { - isFriend = constant.FriendFlag - } else { - isFriend = constant.ApplicationFriendFlag - } - log.InfoByArgs(fmt.Sprintf("rpc is friend success return")) - return &pbFriend.IsFriendResp{ShipType: isFriend}, nil -} diff --git a/internal/rpc/friend/is_in_blacklist.go b/internal/rpc/friend/is_in_blacklist.go deleted file mode 100644 index 6275f5300..000000000 --- a/internal/rpc/friend/is_in_blacklist.go +++ /dev/null @@ -1,20 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "context" - "fmt" -) - -func (s *friendServer) IsInBlackList(ctx context.Context, req *pbFriend.IsInBlackListReq) (*pbFriend.IsInBlackListResp, error) { - log.InfoByArgs("rpc is in blacklist is server,args=%s", req.String()) - var isInBlacklist = false - err := im_mysql_model.FindRelationshipFromBlackList(req.ReceiveUid, req.SendUid) - if err == nil { - isInBlacklist = true - } - log.InfoByArgs(fmt.Sprintf("rpc is in blackList success return")) - return &pbFriend.IsInBlackListResp{Response: isInBlacklist}, nil -} diff --git a/internal/rpc/friend/remove_blacklist.go b/internal/rpc/friend/remove_blacklist.go deleted file mode 100644 index af163e86d..000000000 --- a/internal/rpc/friend/remove_blacklist.go +++ /dev/null @@ -1,27 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) RemoveBlacklist(ctx context.Context, req *pbFriend.RemoveBlacklistReq) (*pbFriend.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc remove blacklist is server,userid=%s", req.Uid) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - err = im_mysql_model.RemoveBlackList(claims.UID, req.Uid) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,remove blacklist failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: config.ErrMysql.ErrMsg}, nil - } - log.Info(req.Token, req.OperationID, "rpc remove blacklist success return,userid=%s", req.Uid) - return &pbFriend.CommonResp{}, nil -} diff --git a/internal/rpc/friend/set_friend_comment.go b/internal/rpc/friend/set_friend_comment.go deleted file mode 100644 index 8b7331935..000000000 --- a/internal/rpc/friend/set_friend_comment.go +++ /dev/null @@ -1,27 +0,0 @@ -package friend - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/utils" - "context" -) - -func (s *friendServer) SetFriendComment(ctx context.Context, req *pbFriend.SetFriendCommentReq) (*pbFriend.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc set friend comment is server,params=%s", req.String()) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - err = im_mysql_model.UpdateFriendComment(claims.UID, req.Uid, req.Comment) - if err != nil { - log.Error(req.Token, req.OperationID, "set friend comment failed,err=%s", err.Error()) - return &pbFriend.CommonResp{ErrorCode: config.ErrSetFriendComment.ErrCode, ErrorMsg: config.ErrSetFriendComment.ErrMsg}, nil - } - log.Info(req.Token, req.OperationID, "rpc set friend comment is success return") - return &pbFriend.CommonResp{}, nil -} diff --git a/internal/rpc/group/callback.go b/internal/rpc/group/callback.go new file mode 100644 index 000000000..8e0fcfb7b --- /dev/null +++ b/internal/rpc/group/callback.go @@ -0,0 +1,9 @@ +package group + +import ( + pbGroup "Open_IM/pkg/proto/group" +) + +func callbackBeforeCreateGroup(req *pbGroup.CreateGroupReq) (bool, error) { + return true, nil +} diff --git a/internal/rpc/group/create_group.go b/internal/rpc/group/create_group.go deleted file mode 100644 index b95394efd..000000000 --- a/internal/rpc/group/create_group.go +++ /dev/null @@ -1,161 +0,0 @@ -package group - -import ( - "Open_IM/internal/push/content_struct" - "Open_IM/internal/push/logic" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbChat "Open_IM/pkg/proto/chat" - pbGroup "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" - "google.golang.org/grpc" - "net" - "strconv" - "strings" - "time" -) - -type groupServer struct { - rpcPort int - rpcRegisterName string - etcdSchema string - etcdAddr []string -} - -func NewGroupServer(port int) *groupServer { - log.NewPrivateLog("group") - return &groupServer{ - rpcPort: port, - rpcRegisterName: config.Config.RpcRegisterName.OpenImGroupName, - etcdSchema: config.Config.Etcd.EtcdSchema, - etcdAddr: config.Config.Etcd.EtcdAddr, - } -} -func (s *groupServer) Run() { - log.Info("", "", "rpc group init....") - - ip := utils.ServerIP - registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) - //listener network - listener, err := net.Listen("tcp", registerAddress) - if err != nil { - log.InfoByArgs("listen network failed,err=%s", err.Error()) - return - } - log.Info("", "", "listen network success, address = %s", registerAddress) - defer listener.Close() - //grpc server - srv := grpc.NewServer() - defer srv.GracefulStop() - //Service registers with etcd - pbGroup.RegisterGroupServer(srv, s) - err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) - if err != nil { - log.ErrorByArgs("get etcd failed,err=%s", err.Error()) - return - } - err = srv.Serve(listener) - if err != nil { - log.ErrorByArgs("listen rpc_group error,err=%s", err.Error()) - return - } - log.Info("", "", "rpc create group init success") -} - -func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq) (*pbGroup.CreateGroupResp, error) { - log.InfoByArgs("rpc create group is server,args=%s", req.String()) - var ( - groupId string - ) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - //Time stamp + MD5 to generate group chat id - groupId = utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10)) - err = im_mysql_model.InsertIntoGroup(groupId, req.GroupName, req.Introduction, req.Notification, req.FaceUrl, req.Ex) - if err != nil { - log.ErrorByKv("create group chat failed", req.OperationID, "err=%s", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil - } - - isMagagerFlag := 0 - tokenUid := claims.UID - - if utils.IsContain(tokenUid, config.Config.Manager.AppManagerUid) { - isMagagerFlag = 1 - } - - if isMagagerFlag == 0 { - //Add the group owner to the group first, otherwise the group creation will fail - us, err := im_mysql_model.FindUserByUID(claims.UID) - if err != nil { - log.Error("", req.OperationID, "find userInfo failed", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil - } - err = im_mysql_model.InsertIntoGroupMember(groupId, claims.UID, us.Name, us.Icon, constant.GroupOwner) - if err != nil { - log.Error("", req.OperationID, "create group chat failed,err=%s", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil - } - - err = db.DB.AddGroupMember(groupId, claims.UID) - if err != nil { - log.Error("", "", "create mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) - return &pbGroup.CreateGroupResp{ErrorCode: config.ErrCreateGroup.ErrCode, ErrorMsg: config.ErrCreateGroup.ErrMsg}, nil - } - } - - //Binding group id and member id - for _, user := range req.MemberList { - us, err := im_mysql_model.FindUserByUID(user.Uid) - if err != nil { - log.Error("", req.OperationID, "find userInfo failed,uid=%s", user.Uid, err.Error()) - continue - } - err = im_mysql_model.InsertIntoGroupMember(groupId, user.Uid, us.Name, us.Icon, user.SetRole) - if err != nil { - log.ErrorByArgs("pull %s to group %s failed,err=%s", user.Uid, groupId, err.Error()) - } - err = db.DB.AddGroupMember(groupId, user.Uid) - if err != nil { - log.Error("", "", "add mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) - } - } - - if isMagagerFlag == 1 { - - //type NotificationContent struct { - // IsDisplay int32 `json:"isDisplay"` - // DefaultTips string `json:"defaultTips"` - // Detail string `json:"detail"` - //} n := NotificationContent{ - // IsDisplay: 1, - // DefaultTips: "You have joined the group chat:" + createGroupResp.Data.GroupName, - // Detail: createGroupResp.Data.GroupId, - // } - - ////Push message when create group chat - n := content_struct.NotificationContent{1, req.GroupName, groupId} - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, - RecvID: groupId, - Content: n.ContentToString(), - SendTime: utils.GetCurrentTimestampByNano(), - MsgFrom: constant.SysMsgType, //Notification message identification - ContentType: constant.CreateGroupTip, //Add friend flag - SessionType: constant.GroupChatType, - OperationID: req.OperationID, - }) - } - - log.Info(req.Token, req.OperationID, "rpc create group success return") - return &pbGroup.CreateGroupResp{GroupID: groupId}, nil -} diff --git a/internal/rpc/group/get_group_applicationList.go b/internal/rpc/group/get_group_applicationList.go deleted file mode 100644 index a08b32f8e..000000000 --- a/internal/rpc/group/get_group_applicationList.go +++ /dev/null @@ -1,21 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/proto/group" - "context" -) - -func (s *groupServer) GetGroupApplicationList(_ context.Context, pb *group.GetGroupApplicationListReq) (*group.GetGroupApplicationListResp, error) { - log.Info("", "", "rpc GetGroupApplicationList call start..., [pb: %s]", pb.String()) - - reply, err := im_mysql_model.GetGroupApplicationList(pb.UID) - if err != nil { - log.Error("", "", "rpc GetGroupApplicationList call..., im_mysql_model.GetGroupApplicationList fail [uid: %s] [err: %s]", pb.UID, err.Error()) - return &group.GetGroupApplicationListResp{ErrCode: 701, ErrMsg: "GetGroupApplicationList failed"}, nil - } - log.Info("", "", "rpc GetGroupApplicationList call..., im_mysql_model.GetGroupApplicationList") - - return reply, nil -} diff --git a/internal/rpc/group/get_groups_info.go b/internal/rpc/group/get_groups_info.go deleted file mode 100644 index 667e3c84f..000000000 --- a/internal/rpc/group/get_groups_info.go +++ /dev/null @@ -1,42 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbGroup "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" -) - -func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsInfoReq) (*pbGroup.GetGroupsInfoResp, error) { - log.Info(req.Token, req.OperationID, "rpc get group info is server,args=%s", req.String()) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.GetGroupsInfoResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - log.Info("", req.OperationID, "args:", req.GroupIDList, claims.UID) - groupsInfoList := make([]*pbGroup.GroupInfo, 0) - for _, groupID := range req.GroupIDList { - groupInfoFromMysql, err := im_mysql_model.FindGroupInfoByGroupId(groupID) - if err != nil { - log.Error(req.Token, req.OperationID, "find group info failed,err=%s", err.Error()) - continue - } - var groupInfo pbGroup.GroupInfo - groupInfo.GroupId = groupID - groupInfo.GroupName = groupInfoFromMysql.Name - groupInfo.Introduction = groupInfoFromMysql.Introduction - groupInfo.Notification = groupInfoFromMysql.Notification - groupInfo.FaceUrl = groupInfoFromMysql.FaceUrl - groupInfo.OwnerId = im_mysql_model.GetGroupOwnerByGroupId(groupID) - groupInfo.MemberCount = uint32(im_mysql_model.GetGroupMemberNumByGroupId(groupID)) - groupInfo.CreateTime = uint64(groupInfoFromMysql.CreateTime.Unix()) - - groupsInfoList = append(groupsInfoList, &groupInfo) - } - log.Info(req.Token, req.OperationID, "rpc get groupsInfo success return") - return &pbGroup.GetGroupsInfoResp{Data: groupsInfoList}, nil -} diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index d7101680f..6b5c872c4 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -1,225 +1,300 @@ package group import ( - "Open_IM/internal/push/content_struct" - "Open_IM/internal/push/logic" + chat "Open_IM/internal/rpc/msg" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" - pbChat "Open_IM/pkg/proto/chat" - "encoding/json" - imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/http" "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + cp "Open_IM/pkg/common/utils" + "Open_IM/pkg/grpc-etcdv3/getcdv3" pbGroup "Open_IM/pkg/proto/group" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "net" + "strconv" + "strings" + "time" - "fmt" + "google.golang.org/grpc" ) -func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJoinedGroupListReq) (*pbGroup.GetJoinedGroupListResp, error) { - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.GetJoinedGroupListResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - log.Info(claims.UID, req.OperationID, "recv req: ", req.String()) +type groupServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} - joinedGroupList, err := imdb.GetJoinedGroupIdListByMemberId(claims.UID) +func NewGroupServer(port int) *groupServer { + log.NewPrivateLog("group") + return &groupServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImGroupName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *groupServer) Run() { + log.NewInfo("0", "group rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) if err != nil { - log.Error(claims.UID, req.OperationID, "GetJoinedGroupIdListByMemberId failed, err: ", err.Error()) - return &pbGroup.GetJoinedGroupListResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbGroup.RegisterGroupServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "group rpc success") +} + +func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq) (*pbGroup.CreateGroupResp, error) { + log.NewInfo(req.OperationID, "CreateGroup, args ", req.String()) + if !token_verify.CheckAccess(req.OpUserID, req.OwnerUserID) { + log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.OwnerUserID) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + canCreate, err := callbackBeforeCreateGroup(req) + if err != nil || !canCreate { + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "callbackBeforeCreateGroup failed") + } + } + //Time stamp + MD5 to generate group chat id + groupId := utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10)) + //to group + groupInfo := db.Group{} + utils.CopyStructFields(&groupInfo, req.GroupInfo) + groupInfo.CreatorUserID = req.OpUserID + groupInfo.GroupID = groupId + err = imdb.InsertIntoGroup(groupInfo) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroup failed, ", err.Error(), groupInfo) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) + } + + us, err := imdb.GetUserByUserID(req.OwnerUserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OwnerUserID) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) + } + + //to group member + groupMember := db.GroupMember{GroupID: groupId, RoleLevel: constant.GroupOwner, OperatorUserID: req.OpUserID} + utils.CopyStructFields(&groupMember, us) + err = imdb.InsertIntoGroupMember(groupMember) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) + } + + err = db.DB.AddGroupMember(groupId, req.OwnerUserID) + if err != nil { + log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), groupId, req.OwnerUserID) + } + var okUserIDList []string + //to group member + for _, user := range req.InitMemberList { + us, err := imdb.GetUserByUserID(user.UserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), user.UserID) + continue + } + if user.RoleLevel == constant.GroupOwner { + log.NewError(req.OperationID, "only one owner, failed ", user) + continue + } + groupMember.RoleLevel = user.RoleLevel + utils.CopyStructFields(&groupMember, us) + err = imdb.InsertIntoGroupMember(groupMember) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) + continue + } + + okUserIDList = append(okUserIDList, user.UserID) + err = db.DB.AddGroupMember(groupId, user.UserID) + if err != nil { + log.NewError(req.OperationID, "add mongo group member failed, db.DB.AddGroupMember failed ", err.Error()) + } + } + + resp := &pbGroup.CreateGroupResp{GroupInfo: &open_im_sdk.GroupInfo{}} + group, err := imdb.GetGroupInfoByGroupID(groupId) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + utils.CopyStructFields(resp.GroupInfo, group) + resp.GroupInfo.MemberCount, err = imdb.GetGroupMemberNumByGroupID(groupId) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberNumByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + resp.GroupInfo.OwnerUserID = req.OwnerUserID + + log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String()) + chat.GroupCreatedNotification(req.OperationID, req.OpUserID, groupId, okUserIDList) + return resp, nil +} + +func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJoinedGroupListReq) (*pbGroup.GetJoinedGroupListResp, error) { + log.NewInfo(req.OperationID, "GetJoinedGroupList, args ", req.String()) + if !token_verify.CheckAccess(req.OpUserID, req.FromUserID) { + log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.FromUserID) + return &pbGroup.GetJoinedGroupListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + //group list + joinedGroupList, err := imdb.GetJoinedGroupIDListByUserID(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GetJoinedGroupIDListByUserID failed ", err.Error(), req.FromUserID) + return &pbGroup.GetJoinedGroupListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } var resp pbGroup.GetJoinedGroupListResp - for _, v := range joinedGroupList { - var groupNode pbGroup.GroupInfo - num := imdb.GetGroupMemberNumByGroupId(v.GroupId) - owner := imdb.GetGroupOwnerByGroupId(v.GroupId) - group, err := imdb.FindGroupInfoByGroupId(v.GroupId) - if num > 0 && owner != "" && err == nil { - groupNode.GroupId = v.GroupId - groupNode.FaceUrl = group.FaceUrl - groupNode.CreateTime = uint64(group.CreateTime.Unix()) - groupNode.GroupName = group.Name - groupNode.Introduction = group.Introduction - groupNode.Notification = group.Notification - groupNode.OwnerId = owner - groupNode.MemberCount = uint32(int32(num)) + var groupNode open_im_sdk.GroupInfo + num, err := imdb.GetGroupMemberNumByGroupID(v) + owner, err2 := imdb.GetGroupOwnerInfoByGroupID(v) + group, err := imdb.GetGroupInfoByGroupID(v) + if num > 0 && owner != nil && err2 == nil && group != nil && err == nil { + utils.CopyStructFields(&groupNode, group) + groupNode.CreateTime = uint32(group.CreateTime.Unix()) + groupNode.MemberCount = uint32(num) + groupNode.OwnerUserID = owner.UserID resp.GroupList = append(resp.GroupList, &groupNode) + } else { + log.NewError(req.OperationID, "check nil ", num, owner, err, group) + continue } - log.Info(claims.UID, req.OperationID, "member num: ", num, "owner: ", owner) + log.NewDebug(req.OperationID, "joinedGroup ", groupNode) } - resp.ErrorCode = 0 + log.NewInfo(req.OperationID, "GetJoinedGroupList rpc return ", resp.String()) return &resp, nil } func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.InviteUserToGroupReq) (*pbGroup.InviteUserToGroupResp, error) { - claims, err := utils.ParseToken(req.Token) + log.NewInfo(req.OperationID, "InviteUserToGroup args ", req.String()) + + if !imdb.IsExistGroupMember(req.GroupID, req.OpUserID) && !token_verify.IsMangerUserID(req.OpUserID) { + log.NewError(req.OperationID, "no permission InviteUserToGroup ", req.GroupID, req.OpUserID) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + _, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.GroupID, err) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil } - log.Info(claims.UID, req.OperationID, "recv req: ", req.String()) - // if !imdb.IsExistGroupMember(req.GroupID, claims.UID) && claims.UID != config.Config.AppManagerUid - - if !imdb.IsExistGroupMember(req.GroupID, claims.UID) && !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { - log.Error(req.Token, req.OperationID, "err= invite user not in group") - return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrAccess.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil - } - - groupInfoFromMysql, err := imdb.FindGroupInfoByGroupId(req.GroupID) - if err != nil || groupInfoFromMysql == nil { - log.NewError(req.OperationID, "get group info error", req.GroupID, req.UidList) - return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrAccess.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil - } - // //from User: invite: applicant //to user: invite: invited - //to application var resp pbGroup.InviteUserToGroupResp - /* - fromUserInfo, err := imdb.FindUserByUID(claims.UID) - if err != nil { - log.Error(claims.UID, req.OperationID, "FindUserByUID failed, err: ", err.Error()) - return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil - }*/ - var nicknameList string - for _, v := range req.UidList { + var okUserIDList []string + for _, v := range req.InvitedUserIDList { var resultNode pbGroup.Id2Result - resultNode.UId = v + resultNode.UserID = v resultNode.Result = 0 - toUserInfo, err := imdb.FindUserByUID(v) + toUserInfo, err := imdb.GetUserByUserID(v) if err != nil { - log.Error(v, req.OperationID, "FindUserByUID failed, err: ", err.Error()) + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), v) resultNode.Result = -1 - resp.Id2Result = append(resp.Id2Result, &resultNode) + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) continue } if imdb.IsExistGroupMember(req.GroupID, v) { - log.Error(v, req.OperationID, "user has already in group") + log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v) resultNode.Result = -1 - resp.Id2Result = append(resp.Id2Result, &resultNode) + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) continue } - - err = imdb.InsertGroupMember(req.GroupID, toUserInfo.UID, toUserInfo.Name, toUserInfo.Icon, 0) + var toInsertInfo db.GroupMember + utils.CopyStructFields(&toInsertInfo, toUserInfo) + toInsertInfo.GroupID = req.GroupID + toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers + toInsertInfo.OperatorUserID = req.OpUserID + err = imdb.InsertIntoGroupMember(toInsertInfo) if err != nil { - log.Error(v, req.OperationID, "InsertGroupMember failed, ", err.Error(), "params: ", - req.GroupID, toUserInfo.UID, toUserInfo.Name, toUserInfo.Icon) + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", req.GroupID, toUserInfo.UserID, toUserInfo.Nickname, toUserInfo.FaceURL) resultNode.Result = -1 - resp.Id2Result = append(resp.Id2Result, &resultNode) + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) continue } - err = db.DB.AddGroupMember(req.GroupID, toUserInfo.UID) + okUserIDList = append(okUserIDList, v) + err = db.DB.AddGroupMember(req.GroupID, toUserInfo.UserID) if err != nil { - log.Error("", "", "add mongo group member failed, db.DB.AddGroupMember fail [err: %s]", err.Error()) + log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), req.GroupID, toUserInfo.UserID) } - nicknameList = nicknameList + toUserInfo.Name + " " - resp.Id2Result = append(resp.Id2Result, &resultNode) - } - resp.ErrorCode = 0 - resp.ErrorMsg = "ok" - - //if claims.UID == config.Config.AppManagerUid - if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { - m, _ := imdb.FindUserByUID(claims.UID) - var iu inviteUserToGroupReq - iu.GroupID = req.GroupID - iu.OperationID = req.OperationID - iu.Reason = req.Reason - iu.UidList = req.UidList - n := content_struct.NotificationContent{1, nicknameList + " invited into the group chat by " + m.Name, iu.ContentToString()} - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, - RecvID: req.GroupID, - Content: n.ContentToString(), - SendTime: utils.GetCurrentTimestampByNano(), - MsgFrom: constant.UserMsgType, - ContentType: constant.InviteUserToGroupTip, - SessionType: constant.GroupChatType, - OperationID: req.OperationID, - }) + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) } + chat.MemberInvitedNotification(req.OperationID, req.GroupID, req.OpUserID, req.Reason, okUserIDList) + resp.ErrCode = 0 + log.NewInfo(req.OperationID, "InviteUserToGroup rpc return ", resp.String()) return &resp, nil } -type inviteUserToGroupReq struct { - GroupID string `json:"groupID"` - UidList []string `json:"uidList"` - Reason string `json:"reason"` - OperationID string `json:"operationID"` -} - -func (c *inviteUserToGroupReq) ContentToString() string { - data, _ := json.Marshal(c) - dataString := string(data) - return dataString -} - func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGroupAllMemberReq) (*pbGroup.GetGroupAllMemberResp, error) { - //claims, err := utils.ParseToken(req.Token) - //if err != nil { - // log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - // if req.Token != config.Config.Secret { - // return &pbGroup.GetGroupAllMemberResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - // } - //} - + log.NewInfo(req.OperationID, "GetGroupAllMember, args ", req.String()) var resp pbGroup.GetGroupAllMemberResp - resp.ErrorCode = 0 - memberList, err := imdb.FindGroupMemberListByGroupId(req.GroupID) + memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) if err != nil { - resp.ErrorCode = config.ErrDb.ErrCode - resp.ErrorMsg = err.Error() - log.NewError(req.OperationID, "FindGroupMemberListByGroupId failed,", err.Error(), req.GroupID) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) return &resp, nil } for _, v := range memberList { - var node pbGroup.GroupMemberFullInfo - node.Role = v.AdministratorLevel - node.NickName = v.NickName - node.UserId = v.Uid - node.FaceUrl = v.UserGroupFaceUrl - node.JoinTime = uint64(v.JoinTime.Unix()) + var node open_im_sdk.GroupMemberFullInfo + cp.GroupMemberDBCopyOpenIM(&node, &v) resp.MemberList = append(resp.MemberList, &node) } - - resp.ErrorCode = 0 + log.NewInfo(req.OperationID, "GetGroupAllMember rpc return ", resp.String()) return &resp, nil } func (s *groupServer) GetGroupMemberList(ctx context.Context, req *pbGroup.GetGroupMemberListReq) (*pbGroup.GetGroupMemberListResp, error) { - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.GetGroupMemberListResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - // log.Info(claims.UID, req.OperationID, "recv req: ", req.String()) - fmt.Println("req: ", req.GroupID) + log.NewInfo(req.OperationID, "GetGroupMemberList args ", req.String()) var resp pbGroup.GetGroupMemberListResp - resp.ErrorCode = 0 - memberList, err := imdb.GetGroupMemberByGroupId(req.GroupID, req.Filter, req.NextSeq, 30) + memberList, err := imdb.GetGroupMemberByGroupID(req.GroupID, req.Filter, req.NextSeq, 30) if err != nil { - resp.ErrorCode = config.ErrDb.ErrCode - resp.ErrorMsg = err.Error() - log.Error(claims.UID, req.OperationID, "GetGroupMemberByGroupId failed, ", err.Error(), "params: ", req.GroupID, req.Filter, req.NextSeq) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + log.NewError(req.OperationID, "GetGroupMemberByGroupId failed,", req.GroupID, req.Filter, req.NextSeq, 30) return &resp, nil } for _, v := range memberList { - var node pbGroup.GroupMemberFullInfo - node.Role = v.AdministratorLevel - node.NickName = v.NickName - node.UserId = v.Uid - // node.FaceUrl = - node.JoinTime = uint64(v.JoinTime.Unix()) + var node open_im_sdk.GroupMemberFullInfo + utils.CopyStructFields(&node, &v) resp.MemberList = append(resp.MemberList, &node) } //db operate get db sorted by join time @@ -229,168 +304,636 @@ func (s *groupServer) GetGroupMemberList(ctx context.Context, req *pbGroup.GetGr resp.NextSeq = req.NextSeq + int32(len(memberList)) } - resp.ErrorCode = 0 + resp.ErrCode = 0 + log.NewInfo(req.OperationID, "GetGroupMemberList rpc return ", resp.String()) return &resp, nil } -type groupMemberFullInfo struct { - GroupId string `json:"groupID"` - UserId string `json:"userId"` - Role int `json:"role"` - JoinTime uint64 `json:"joinTime"` - NickName string `json:"nickName"` - FaceUrl string `json:"faceUrl"` -} - -type kickGroupMemberApiReq struct { - GroupID string `json:"groupID"` - UidListInfo []groupMemberFullInfo `json:"uidListInfo"` - Reason string `json:"reason"` - OperationID string `json:"operationID"` -} - -func (c *kickGroupMemberApiReq) ContentToString() string { - data, _ := json.Marshal(c) - dataString := string(data) - return dataString -} - func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGroupMemberReq) (*pbGroup.KickGroupMemberResp, error) { - claims, err := utils.ParseToken(req.Token) + log.NewInfo(req.OperationID, "KickGroupMember args ", req.String()) + ownerList, err := imdb.GetOwnerManagerByGroupID(req.GroupID) if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.KickGroupMemberResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - log.Info(claims.UID, req.OperationID, "recv req: ", req.String()) - - ownerList, err := imdb.GetOwnerManagerByGroupId(req.GroupID) - if err != nil { - log.Error(claims.UID, req.OperationID, req.GroupID, "GetOwnerManagerByGroupId, ", err.Error()) - return &pbGroup.KickGroupMemberResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil + log.NewError(req.OperationID, "GetOwnerManagerByGroupId failed ", err.Error(), req.GroupID) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } //op is group owner? var flag = 0 for _, v := range ownerList { - if v.Uid == claims.UID { + if v.UserID == req.OpUserID { flag = 1 + log.NewDebug(req.OperationID, "is group owner ", req.OpUserID, req.GroupID) break } } + + //op is app manager if flag != 1 { - // if claims.UID == config.Config.AppManagerUid { - if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { + if token_verify.IsMangerUserID(req.OpUserID) { flag = 1 + log.NewDebug(req.OperationID, "is app manager ", req.OpUserID) } } if flag != 1 { - log.Error(claims.UID, req.OperationID, "no access kick") - return &pbGroup.KickGroupMemberResp{ErrorCode: config.ErrAccess.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil + log.NewError(req.OperationID, "failed, no access kick ", req.OpUserID) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil } - if len(req.UidListInfo) == 0 { - log.Error(claims.UID, req.OperationID, "kick list 0") - return &pbGroup.KickGroupMemberResp{ErrorCode: config.ErrParam.ErrCode, ErrorMsg: config.ErrParam.ErrMsg}, nil + if len(req.KickedUserIDList) == 0 { + log.NewError(req.OperationID, "failed, kick list 0") + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}, nil } + + groupOwnerUserID := "" + for _, v := range ownerList { + if v.RoleLevel == constant.GroupOwner { + groupOwnerUserID = v.UserID + } + } + + var okUserIDList []string //remove var resp pbGroup.KickGroupMemberResp - for _, v := range req.UidListInfo { + for _, v := range req.KickedUserIDList { //owner cant kicked - if v.UserId == claims.UID { - log.Error(claims.UID, req.OperationID, v.UserId, "cant kick owner") - resp.Id2Result = append(resp.Id2Result, &pbGroup.Id2Result{UId: v.UserId, Result: -1}) + if v == groupOwnerUserID { + log.NewError(req.OperationID, "failed, can't kick owner ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) continue } - err := imdb.RemoveGroupMember(req.GroupID, v.UserId) + err := imdb.RemoveGroupMember(req.GroupID, v) if err != nil { - log.Error(claims.UID, req.OperationID, v.UserId, req.GroupID, "RemoveGroupMember failed ", err.Error()) - resp.Id2Result = append(resp.Id2Result, &pbGroup.Id2Result{UId: v.UserId, Result: -1}) + log.NewError(req.OperationID, "RemoveGroupMember failed ", err.Error(), req.GroupID, v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) } else { - resp.Id2Result = append(resp.Id2Result, &pbGroup.Id2Result{UId: v.UserId, Result: 0}) + log.NewDebug(req.OperationID, "kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: 0}) + okUserIDList = append(okUserIDList, v) } - err = db.DB.DelGroupMember(req.GroupID, v.UserId) + err = db.DB.DelGroupMember(req.GroupID, v) if err != nil { - log.Error("", "", "delete mongo group member failed, db.DB.DelGroupMember fail [err: %s]", err.Error()) - } - - } - var kq kickGroupMemberApiReq - - kq.GroupID = req.GroupID - kq.OperationID = req.OperationID - kq.Reason = req.Reason - - var gf groupMemberFullInfo - for _, v := range req.UidListInfo { - gf.UserId = v.UserId - gf.GroupId = req.GroupID - kq.UidListInfo = append(kq.UidListInfo, gf) - } - - n := content_struct.NotificationContent{1, req.GroupID, kq.ContentToString()} - - if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { - log.Info("", req.OperationID, claims.UID, req.GroupID) - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, - RecvID: req.GroupID, - Content: n.ContentToString(), - SendTime: utils.GetCurrentTimestampByNano(), - MsgFrom: constant.UserMsgType, - ContentType: constant.KickGroupMemberTip, - SessionType: constant.GroupChatType, - OperationID: req.OperationID, - }) - - for _, v := range req.UidListInfo { - log.Info("", req.OperationID, claims.UID, v.UserId) - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, - RecvID: v.UserId, - Content: n.ContentToString(), - SendTime: utils.GetCurrentTimestampBySecond(), - MsgFrom: constant.UserMsgType, - ContentType: constant.KickGroupMemberTip, - SessionType: constant.SingleChatType, - OperationID: req.OperationID, - }) + log.NewError(req.OperationID, "DelGroupMember failed ", err.Error(), req.GroupID, v) } } - resp.ErrorCode = 0 + chat.MemberKickedNotification(req, okUserIDList) + log.NewInfo(req.OperationID, "GetGroupMemberList rpc return ", resp.String()) return &resp, nil } func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetGroupMembersInfoReq) (*pbGroup.GetGroupMembersInfoResp, error) { - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.GetGroupMembersInfoResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - log.InfoByKv(claims.UID, req.OperationID, "param: ", req.MemberList) + log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) + var resp pbGroup.GetGroupMembersInfoResp for _, v := range req.MemberList { - var memberNode pbGroup.GroupMemberFullInfo - memberInfo, err := imdb.GetMemberInfoById(req.GroupID, v) - memberNode.UserId = v - fmt.Println("id : ", memberNode.UserId) + var memberNode open_im_sdk.GroupMemberFullInfo + memberInfo, err := imdb.GetMemberInfoByID(req.GroupID, v) + memberNode.UserID = v if err != nil { - log.Error(claims.UID, req.OperationID, req.GroupID, v, "GetMemberInfoById failed, ", err.Error()) - //error occurs, only id is valid - resp.MemberList = append(resp.MemberList, &memberNode) + log.NewError(req.OperationID, "GetMemberInfoById failed ", err.Error(), req.GroupID, v) continue + } else { + utils.CopyStructFields(&memberNode, memberInfo) + memberNode.JoinTime = int32(memberInfo.JoinTime.Unix()) + resp.MemberList = append(resp.MemberList, &memberNode) } - user, err := imdb.FindUserByUID(v) - if err == nil && user != nil { - memberNode.FaceUrl = user.Icon - memberNode.JoinTime = uint64(memberInfo.JoinTime.Unix()) - memberNode.UserId = user.UID - memberNode.NickName = memberInfo.NickName - memberNode.Role = memberInfo.AdministratorLevel - } - resp.MemberList = append(resp.MemberList, &memberNode) } - resp.ErrorCode = 0 + resp.ErrCode = 0 + log.NewInfo(req.OperationID, "GetGroupMembersInfo rpc return ", resp.String()) return &resp, nil } + +func (s *groupServer) GetGroupApplicationList(_ context.Context, req *pbGroup.GetGroupApplicationListReq) (*pbGroup.GetGroupApplicationListResp, error) { + log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) + reply, err := imdb.GetGroupApplicationList(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GetGroupApplicationList failed ", err.Error(), req.FromUserID) + return &pbGroup.GetGroupApplicationListResp{ErrCode: 701, ErrMsg: "GetGroupApplicationList failed"}, nil + } + + log.NewDebug(req.OperationID, "GetGroupApplicationList reply ", reply) + resp := pbGroup.GetGroupApplicationListResp{} + for _, v := range reply { + node := open_im_sdk.GroupRequest{UserInfo: &open_im_sdk.PublicUserInfo{}, GroupInfo: &open_im_sdk.GroupInfo{}} + group, err := imdb.GetGroupInfoByGroupID(v.GroupID) + if err != nil { + log.Error(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), v.GroupID) + continue + } + user, err := imdb.GetUserByUserID(v.UserID) + if err != nil { + log.Error(req.OperationID, "GetUserByUserID failed ", err.Error(), v.UserID) + continue + } + + cp.GroupRequestDBCopyOpenIM(&node, &v) + cp.UserDBCopyOpenIMPublicUser(node.UserInfo, user) + cp.GroupDBCopyOpenIM(node.GroupInfo, group) + log.NewDebug(req.OperationID, "node ", node, "v ", v) + resp.GroupRequestList = append(resp.GroupRequestList, &node) + } + log.NewInfo(req.OperationID, "GetGroupMembersInfo rpc return ", resp) + return &resp, nil +} + +func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsInfoReq) (*pbGroup.GetGroupsInfoResp, error) { + log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) + groupsInfoList := make([]*open_im_sdk.GroupInfo, 0) + for _, groupID := range req.GroupIDList { + groupInfoFromMysql, err := imdb.GetGroupInfoByGroupID(groupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupID) + continue + } + var groupInfo open_im_sdk.GroupInfo + cp.GroupDBCopyOpenIM(&groupInfo, groupInfoFromMysql) + groupsInfoList = append(groupsInfoList, &groupInfo) + } + + resp := pbGroup.GetGroupsInfoResp{GroupInfoList: groupsInfoList} + log.NewInfo(req.OperationID, "GetGroupsInfo rpc return ", resp) + return &resp, nil +} + +func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.GroupApplicationResponseReq) (*pbGroup.GroupApplicationResponseResp, error) { + log.NewInfo(req.OperationID, "GroupApplicationResponse args ", req.String()) + + groupRequest := db.GroupRequest{} + utils.CopyStructFields(&groupRequest, req) + groupRequest.UserID = req.FromUserID + groupRequest.HandleUserID = req.OpUserID + groupRequest.HandledTime = time.Now() + if !token_verify.IsMangerUserID(req.OpUserID) && !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) { + log.NewError(req.OperationID, "IsMangerUserID IsGroupOwnerAdmin false ", req.GroupID, req.OpUserID) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + err := imdb.UpdateGroupRequest(groupRequest) + if err != nil { + //{openIM002 7836e478bc43ce1d3b8889cac983f59b 1 ok 0001-01-01 00:00:00 +0000 UTC openIM001 0001-01-01 00:00:00 +0000 UTC } + log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), groupRequest) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + if req.HandleResult == constant.GroupResponseAgree { + user, err := imdb.GetUserByUserID(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), req.FromUserID) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + member := db.GroupMember{} + member.GroupID = req.GroupID + member.UserID = req.FromUserID + member.RoleLevel = constant.GroupOrdinaryUsers + member.OperatorUserID = req.OpUserID + member.FaceURL = user.FaceURL + member.Nickname = user.Nickname + + err = imdb.InsertIntoGroupMember(member) + if err != nil { + log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), member) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupApplicationAcceptedNotification(req) + chat.MemberEnterNotification(req) + } else if req.HandleResult == constant.GroupResponseRefuse { + chat.GroupApplicationRejectedNotification(req) + } else { + log.Error(req.OperationID, "HandleResult failed ", req.HandleResult) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}}, nil + } + + log.NewInfo(req.OperationID, "rpc GroupApplicationResponse return ", pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}, nil +} + +func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq) (*pbGroup.JoinGroupResp, error) { + log.NewInfo(req.OperationID, "JoinGroup args ", req.String()) + _, err := imdb.GetUserByUserID(req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OpUserID) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + var groupRequest db.GroupRequest + groupRequest.UserID = req.OpUserID + groupRequest.ReqMsg = req.ReqMessage + groupRequest.GroupID = req.GroupID + + err = imdb.InsertIntoGroupRequest(groupRequest) + if err != nil { + log.NewError(req.OperationID, "UpdateGroupRequest ", err.Error(), groupRequest) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + _, err = imdb.GetGroupMemberListByGroupIDAndRoleLevel(req.GroupID, constant.GroupOwner) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberListByGroupIDAndRoleLevel failed ", err.Error(), req.GroupID, constant.GroupOwner) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil + } + + chat.JoinGroupApplicationNotification(req) + + log.NewInfo(req.OperationID, "ReceiveJoinApplicationNotification rpc return ") + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) (*pbGroup.QuitGroupResp, error) { + log.NewError(req.OperationID, "QuitGroup args ", req.String()) + _, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed ", err.Error(), req.GroupID, req.OpUserID) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + err = imdb.DeleteGroupMemberByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupIdAndUserId failed ", err.Error(), req.GroupID, req.OpUserID) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + err = db.DB.DelGroupMember(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "DelGroupMember failed ", req.GroupID, req.OpUserID) + // return &pbGroup.CommonResp{ErrorCode: constant.ErrQuitGroup.ErrCode, ErrorMsg: constant.ErrQuitGroup.ErrMsg}, nil + } + + chat.MemberQuitNotification(req) + log.NewInfo(req.OperationID, "rpc QuitGroup return ", pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +func hasAccess(req *pbGroup.SetGroupInfoReq) bool { + if utils.IsContain(req.OpUserID, config.Config.Manager.AppManagerUid) { + return true + } + groupUserInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupInfo.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed, ", err.Error(), req.GroupInfo.GroupID, req.OpUserID) + return false + + } + if groupUserInfo.RoleLevel == constant.GroupOwner || groupUserInfo.RoleLevel == constant.GroupAdmin { + return true + } + return false +} + +func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) { + log.NewInfo(req.OperationID, "SetGroupInfo args ", req.String()) + if !hasAccess(req) { + log.NewError(req.OperationID, "no access ", req) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + group, err := imdb.GetGroupInfoByGroupID(req.GroupInfo.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), req.GroupInfo.GroupID) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, http.WrapError(constant.ErrDB) + } + + ////bitwise operators: 0001:groupName; 0010:Notification 0100:Introduction; 1000:FaceUrl; 10000:owner + var changedType int32 + if group.GroupName != req.GroupInfo.GroupName && req.GroupInfo.GroupName != "" { + changedType = 1 + } + if group.Notification != req.GroupInfo.Notification && req.GroupInfo.Notification != "" { + changedType = changedType | (1 << 1) + } + if group.Introduction != req.GroupInfo.Introduction && req.GroupInfo.Introduction != "" { + changedType = changedType | (1 << 2) + } + if group.FaceURL != req.GroupInfo.FaceURL && req.GroupInfo.FaceURL != "" { + changedType = changedType | (1 << 3) + } + //only administrators can set group information + var groupInfo db.Group + utils.CopyStructFields(&groupInfo, req.GroupInfo) + err = imdb.SetGroupInfo(groupInfo) + if err != nil { + log.NewError(req.OperationID, "SetGroupInfo failed ", err.Error(), groupInfo) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, http.WrapError(constant.ErrDB) + } + log.NewInfo(req.OperationID, "SetGroupInfo rpc return ", pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}) + if changedType != 0 { + chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfo.GroupID) + } + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil +} + +func (s *groupServer) TransferGroupOwner(_ context.Context, req *pbGroup.TransferGroupOwnerReq) (*pbGroup.TransferGroupOwnerResp, error) { + log.NewInfo(req.OperationID, "TransferGroupOwner ", req.String()) + + if req.OldOwnerUserID == req.NewOwnerUserID { + log.NewError(req.OperationID, "same owner ", req.OldOwnerUserID, req.NewOwnerUserID) + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.OldOwnerUserID, RoleLevel: constant.GroupOrdinaryUsers} + err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + if err != nil { + log.NewError(req.OperationID, "UpdateGroupMemberInfo failed ", groupMemberInfo) + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + groupMemberInfo = db.GroupMember{GroupID: req.GroupID, UserID: req.NewOwnerUserID, RoleLevel: constant.GroupOwner} + err = imdb.UpdateGroupMemberInfo(groupMemberInfo) + if err != nil { + log.NewError(req.OperationID, "UpdateGroupMemberInfo failed ", groupMemberInfo) + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupOwnerTransferredNotification(req) + + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil + +} + +func (s *groupServer) GetGroupById(_ context.Context, req *pbGroup.GetGroupByIdReq) (*pbGroup.GetGroupByIdResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetGroupByIdResp{CMSGroup: &pbGroup.CMSGroup{ + GroupInfo: &open_im_sdk.GroupInfo{}, + }} + group, err := imdb.GetGroupById(req.GroupId) + if err != nil { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetGroupById error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.CMSGroup.GroupInfo = &open_im_sdk.GroupInfo{ + GroupID: group.GroupID, + GroupName: group.GroupName, + FaceURL: group.FaceURL, + OwnerUserID: group.CreatorUserID, + MemberCount: 0, + Status: group.Status, + CreatorUserID: group.CreatorUserID, + GroupType: group.GroupType, + } + groupMember, err := imdb.GetGroupMaster(group.GroupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.CMSGroup.GroupMasterName = groupMember.Nickname + resp.CMSGroup.GroupMasterId = groupMember.UserID + resp.CMSGroup.GroupInfo.CreatorUserID = group.CreatorUserID + return resp, nil +} + +func (s *groupServer) GetGroup(_ context.Context, req *pbGroup.GetGroupReq) (*pbGroup.GetGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetGroupResp{ + CMSGroups: []*pbGroup.CMSGroup{}, + } + groups, err := imdb.GetGroupsByName(req.GroupName, req.Pagination.PageNumber, req.Pagination.ShowNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsByName error", req.String()) + return resp, http.WrapError(constant.ErrDB) + } + nums, err := imdb.GetGroupsCountNum(db.Group{GroupName: req.GroupName}) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsCountNum error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.GroupNums = nums + resp.Pagination = &open_im_sdk.RequestPagination{ + PageNumber: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + for _, v := range groups { + groupMember, err := imdb.GetGroupMaster(v.GroupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster error", err.Error()) + } + resp.CMSGroups = append(resp.CMSGroups, &pbGroup.CMSGroup{ + GroupInfo: &open_im_sdk.GroupInfo{ + GroupID: v.GroupID, + GroupName: v.GroupName, + FaceURL: v.FaceURL, + OwnerUserID: v.CreatorUserID, + Status: v.Status, + CreatorUserID: v.CreatorUserID, + }, + GroupMasterName: groupMember.Nickname, + GroupMasterId: groupMember.UserID, + }) + } + return resp, nil +} + +func (s *groupServer) GetGroups(_ context.Context, req *pbGroup.GetGroupsReq) (*pbGroup.GetGroupsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetGroups ", req.String()) + resp := &pbGroup.GetGroupsResp{ + CMSGroups: []*pbGroup.CMSGroup{}, + Pagination: &open_im_sdk.RequestPagination{}, + } + groups, err := imdb.GetGroups(int(req.Pagination.PageNumber), int(req.Pagination.ShowNumber)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroups error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + groupsCountNum, err := imdb.GetGroupsCountNum(db.Group{}) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "groupsCountNum ", groupsCountNum) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsCountNum", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.GroupNum = int32(groupsCountNum) + resp.Pagination.PageNumber = req.Pagination.PageNumber + resp.Pagination.ShowNumber = req.Pagination.ShowNumber + for _, v := range groups { + groupMember, err := imdb.GetGroupMaster(v.GroupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + resp.CMSGroups = append(resp.CMSGroups, &pbGroup.CMSGroup{ + GroupInfo: &open_im_sdk.GroupInfo{ + GroupID: v.GroupID, + GroupName: v.GroupName, + FaceURL: v.FaceURL, + OwnerUserID: v.CreatorUserID, + Status: v.Status, + CreatorUserID: v.CreatorUserID, + CreateTime: uint32(v.CreateTime.Unix()), + }, + GroupMasterId: groupMember.UserID, + GroupMasterName: groupMember.Nickname, + }) + } + + return resp, nil +} + +func (s *groupServer) OperateGroupStatus(_ context.Context, req *pbGroup.OperateGroupStatusReq) (*pbGroup.OperateGroupStatusResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbGroup.OperateGroupStatusResp{} + if err := imdb.OperateGroupStatus(req.GroupId, req.Status); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *groupServer) DeleteGroup(_ context.Context, req *pbGroup.DeleteGroupReq) (*pbGroup.DeleteGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbGroup.DeleteGroupResp{} + if err := imdb.DeleteGroup(req.GroupId); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteGroup error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *groupServer) OperateUserRole(_ context.Context, req *pbGroup.OperateUserRoleReq) (*pbGroup.OperateUserRoleResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.OperateUserRoleResp{} + oldOwnerUserID, err := imdb.GetGroupMaster(req.GroupId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster failed", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + var reqPb pbGroup.TransferGroupOwnerReq + reqPb.OperationID = req.OperationID + reqPb.NewOwnerUserID = req.UserId + reqPb.GroupID = req.GroupId + reqPb.OpUserID = "cms admin" + reqPb.OldOwnerUserID = oldOwnerUserID.UserID + reply, err := client.TransferGroupOwner(context.Background(), &reqPb) + if reply.CommonResp.ErrCode != 0 || err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "TransferGroupOwner rpc failed") + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + } + return resp, nil +} + +func (s *groupServer) GetGroupMembersCMS(_ context.Context, req *pbGroup.GetGroupMembersCMSReq) (*pbGroup.GetGroupMembersCMSResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.GetGroupMembersCMSResp{} + groupMembers, err := imdb.GetGroupMembersByGroupIdCMS(req.GroupId, req.UserName, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMembersByGroupIdCMS Error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + groupMembersCount, err := imdb.GetGroupMembersCount(req.GroupId, req.UserName) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMembersCMS Error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + log.NewInfo(req.OperationID, groupMembersCount) + resp.MemberNums = groupMembersCount + for _, groupMember := range groupMembers { + resp.Members = append(resp.Members, &open_im_sdk.GroupMemberFullInfo{ + GroupID: req.GroupId, + UserID: groupMember.UserID, + RoleLevel: groupMember.RoleLevel, + JoinTime: int32(groupMember.JoinTime.Unix()), + Nickname: groupMember.Nickname, + FaceURL: groupMember.FaceURL, + JoinSource: groupMember.JoinSource, + }) + } + resp.Pagination = &open_im_sdk.ResponsePagination{ + CurrentPage: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + return resp, nil +} + +func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.RemoveGroupMembersCMSReq) (*pbGroup.RemoveGroupMembersCMSResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.RemoveGroupMembersCMSResp{} + for _, userId := range req.UserIds { + err := imdb.RemoveGroupMember(req.GroupId, userId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + resp.Failed = append(resp.Failed, userId) + } else { + resp.Success = append(resp.Success, userId) + } + } + reqKick := &pbGroup.KickGroupMemberReq{ + GroupID: req.GroupId, + KickedUserIDList: resp.Success, + Reason: "admin kick", + OperationID: req.OperationID, + OpUserID: req.OpUserId, + } + chat.MemberKickedNotification(reqKick, resp.Success) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "success: ", resp.Success) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "failed: ", resp.Failed) + return resp, nil +} + +func (s *groupServer) AddGroupMembersCMS(_ context.Context, req *pbGroup.AddGroupMembersCMSReq) (*pbGroup.AddGroupMembersCMSResp, error) { + log.NewInfo(req.OperationId, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.AddGroupMembersCMSResp{} + for _, userId := range req.UserIds { + if isExist := imdb.IsExistGroupMember(req.GroupId, userId); isExist { + log.NewError(req.OperationId, utils.GetSelfFuncName(), "user is exist in group", userId, req.GroupId) + resp.Failed = append(resp.Failed, userId) + continue + } + user, err := imdb.GetUserByUserID(userId) + if err != nil { + log.NewError(req.OperationId, utils.GetSelfFuncName(), "GetUserByUserID", err.Error()) + resp.Failed = append(resp.Failed, userId) + continue + } + groupMember := db.GroupMember{ + GroupID: req.GroupId, + UserID: userId, + Nickname: user.Nickname, + FaceURL: "", + RoleLevel: 1, + JoinTime: time.Time{}, + JoinSource: constant.JoinByAdmin, + OperatorUserID: "CmsAdmin", + Ex: "", + } + if err := imdb.InsertIntoGroupMember(groupMember); err != nil { + log.NewError(req.OperationId, utils.GetSelfFuncName(), "InsertIntoGroupMember failed", req.String()) + resp.Failed = append(resp.Failed, userId) + } else { + resp.Success = append(resp.Success, userId) + } + } + chat.MemberInvitedNotification(req.OperationId, req.GroupId, req.OpUserId, "admin add you to group", resp.Success) + return resp, nil +} + +func (s *groupServer) GetUserReqApplicationList(_ context.Context, req *pbGroup.GetUserReqApplicationListReq) (*pbGroup.GetUserReqApplicationListResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetUserReqApplicationListResp{} + groupRequests, err := imdb.GetUserReqGroupByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserReqGroupByUserID failed ", err.Error()) + resp.CommonResp = &pbGroup.CommonResp{ + ErrCode: constant.ErrDB.ErrCode, + ErrMsg: constant.ErrDB.ErrMsg, + } + return resp, nil + } + for _, groupReq := range groupRequests { + node := open_im_sdk.GroupRequest{UserInfo: &open_im_sdk.PublicUserInfo{}, GroupInfo: &open_im_sdk.GroupInfo{}} + group, err := imdb.GetGroupInfoByGroupID(groupReq.GroupID) + if err != nil { + log.Error(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupReq.GroupID) + continue + } + user, err := imdb.GetUserByUserID(groupReq.UserID) + if err != nil { + log.Error(req.OperationID, "GetUserByUserID failed ", err.Error(), groupReq.UserID) + continue + } + cp.GroupRequestDBCopyOpenIM(&node, &groupReq) + cp.UserDBCopyOpenIMPublicUser(node.UserInfo, user) + cp.GroupDBCopyOpenIM(node.GroupInfo, group) + resp.GroupRequestList = append(resp.GroupRequestList, &node) + } + resp.CommonResp = &pbGroup.CommonResp{ + ErrCode: 0, + ErrMsg: "", + } + return resp, nil +} diff --git a/internal/rpc/group/group_application_response.go b/internal/rpc/group/group_application_response.go deleted file mode 100644 index 4282de51b..000000000 --- a/internal/rpc/group/group_application_response.go +++ /dev/null @@ -1,39 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/db" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/proto/group" - "context" -) - -func (s *groupServer) GroupApplicationResponse(_ context.Context, pb *group.GroupApplicationResponseReq) (*group.GroupApplicationResponseResp, error) { - log.Info("", "", "rpc GroupApplicationResponse call start..., [pb: %s]", pb.String()) - - reply, err := im_mysql_model.GroupApplicationResponse(pb) - if err != nil { - log.Error("", "", "rpc GroupApplicationResponse call..., im_mysql_model.GroupApplicationResponse fail [pb: %s] [err: %s]", pb.String(), err.Error()) - return &group.GroupApplicationResponseResp{ErrCode: 702, ErrMsg: "rpc GroupApplicationResponse failed"}, nil - } - - if pb.HandleResult == 1 { - if pb.ToUserID == "0" { - err = db.DB.AddGroupMember(pb.GroupID, pb.FromUserID) - if err != nil { - log.Error("", "", "rpc GroupApplicationResponse call..., db.DB.AddGroupMember fail [pb: %s] [err: %s]", pb.String(), err.Error()) - return nil, err - } - } else { - err = db.DB.AddGroupMember(pb.GroupID, pb.ToUserID) - if err != nil { - log.Error("", "", "rpc GroupApplicationResponse call..., db.DB.AddGroupMember fail [pb: %s] [err: %s]", pb.String(), err.Error()) - return nil, err - } - } - } - - log.Info("", "", "rpc GroupApplicationResponse call..., im_mysql_model.GroupApplicationResponse") - - return reply, nil -} diff --git a/internal/rpc/group/join_group.go b/internal/rpc/group/join_group.go deleted file mode 100644 index 4b1c88c89..000000000 --- a/internal/rpc/group/join_group.go +++ /dev/null @@ -1,57 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbGroup "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" -) - -func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq) (*pbGroup.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc join group is server,args=%s", req.String()) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - applicationUserInfo, err := im_mysql_model.FindUserByUID(claims.UID) - if err != nil { - log.Error(req.Token, req.OperationID, "No this user,err=%s", err.Error()) - return &pbGroup.CommonResp{ErrorCode: config.ErrSearchUserInfo.ErrCode, ErrorMsg: config.ErrSearchUserInfo.ErrMsg}, nil - } - - _, err = im_mysql_model.FindGroupRequestUserInfoByGroupIDAndUid(req.GroupID, claims.UID) - if err == nil { - err = im_mysql_model.DelGroupRequest(req.GroupID, claims.UID, "0") - } - - log.Info(req.Token, req.OperationID, "args: ", req.GroupID, claims.UID, "0", req.Message, applicationUserInfo.Name, applicationUserInfo.Icon) - - if err = im_mysql_model.InsertIntoGroupRequest(req.GroupID, claims.UID, "0", req.Message, applicationUserInfo.Name, applicationUserInfo.Icon); err != nil { - log.Error(req.Token, req.OperationID, "Insert into group request failed,er=%s", err.Error()) - return &pbGroup.CommonResp{ErrorCode: config.ErrJoinGroupApplication.ErrCode, ErrorMsg: config.ErrJoinGroupApplication.ErrMsg}, nil - } - ////Find the the group owner - //groupCreatorInfo, err := im_mysql_model.FindGroupMemberListByGroupIdAndFilterInfo(req.GroupID, constant.GroupCreator) - //if err != nil { - // log.Error(req.Token, req.OperationID, "find group creator failed", err.Error()) - //} else { - // //Push message when join group chat - // logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - // SendID: claims.UID, - // RecvID: groupCreatorInfo[0].Uid, - // Content: content_struct.NewContentStructString(0, "", req.String()), - // SendTime: utils.GetCurrentTimestampBySecond(), - // MsgFrom: constant.SysMsgType, - // ContentType: constant.JoinGroupTip, - // SessionType: constant.SingleChatType, - // OperationID: req.OperationID, - // }) - //} - - log.Info(req.Token, req.OperationID, "rpc join group success return") - return &pbGroup.CommonResp{}, nil -} diff --git a/internal/rpc/group/quit_group.go b/internal/rpc/group/quit_group.go deleted file mode 100644 index 5906832a2..000000000 --- a/internal/rpc/group/quit_group.go +++ /dev/null @@ -1,55 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbGroup "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" -) - -func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) (*pbGroup.CommonResp, error) { - log.InfoByArgs("rpc quit group is server,args:", req.String()) - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - log.InfoByKv("args:", req.OperationID, req.GetGroupID(), claims.UID) - //Check to see whether there is a user in the group. - _, err = im_mysql_model.FindGroupMemberInfoByGroupIdAndUserId(req.GroupID, claims.UID) - if err != nil { - log.Error(req.Token, req.OperationID, "no such group or you are not in the group,err=%s", err.Error(), req.OperationID, req.GroupID, claims.UID) - return &pbGroup.CommonResp{ErrorCode: config.ErrQuitGroup.ErrCode, ErrorMsg: config.ErrQuitGroup.ErrMsg}, nil - } - //After the user's verification is successful, user will quit the group chat. - err = im_mysql_model.DeleteGroupMemberByGroupIdAndUserId(req.GroupID, claims.UID) - if err != nil { - log.ErrorByArgs("this user exit the group failed,err=%s", err.Error(), req.OperationID, req.GroupID, claims.UID) - return &pbGroup.CommonResp{ErrorCode: config.ErrQuitGroup.ErrCode, ErrorMsg: config.ErrQuitGroup.ErrMsg}, nil - } - - err = db.DB.DelGroupMember(req.GroupID, claims.UID) - if err != nil { - log.Error("", "", "delete mongo group member failed, db.DB.DelGroupMember fail [err: %s]", err.Error()) - return &pbGroup.CommonResp{ErrorCode: config.ErrQuitGroup.ErrCode, ErrorMsg: config.ErrQuitGroup.ErrMsg}, nil - } - ////Push message when quit group chat - //jsonInfo, _ := json.Marshal(req) - //logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - // SendID: claims.UID, - // RecvID: req.GroupID, - // Content: string(jsonInfo), - // SendTime: utils.GetCurrentTimestampBySecond(), - // MsgFrom: constant.SysMsgType, - // ContentType: constant.QuitGroupTip, - // SessionType: constant.GroupChatType, - // OperationID: req.OperationID, - //}) - log.Info(req.Token, req.OperationID, "rpc quit group is success return") - - return &pbGroup.CommonResp{}, nil -} diff --git a/internal/rpc/group/set_group_info.go b/internal/rpc/group/set_group_info.go deleted file mode 100644 index 046f8bc4f..000000000 --- a/internal/rpc/group/set_group_info.go +++ /dev/null @@ -1,47 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbGroup "Open_IM/pkg/proto/group" - "Open_IM/pkg/utils" - "context" -) - -func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc set group info is server,args=%s", req.String()) - - //Parse token, to find current user information - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbGroup.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - groupUserInfo, err := im_mysql_model.FindGroupMemberInfoByGroupIdAndUserId(req.GroupID, claims.UID) - if err != nil { - log.Error("", req.OperationID, "your are not in the group,can not change this group info,err=%s", err.Error()) - return &pbGroup.CommonResp{ErrorCode: config.ErrSetGroupInfo.ErrCode, ErrorMsg: config.ErrSetGroupInfo.ErrMsg}, nil - } - if groupUserInfo.AdministratorLevel == constant.OrdinaryMember { - return &pbGroup.CommonResp{ErrorCode: config.ErrSetGroupInfo.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil - } - //only administrators can set group information - if err = im_mysql_model.SetGroupInfo(req.GroupID, req.GroupName, req.Introduction, req.Notification, req.FaceUrl, ""); err != nil { - return &pbGroup.CommonResp{ErrorCode: config.ErrSetGroupInfo.ErrCode, ErrorMsg: config.ErrSetGroupInfo.ErrMsg}, nil - } - ////Push message when set group info - //jsonInfo, _ := json.Marshal(req) - //logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - // SendID: claims.UID, - // RecvID: req.GroupID, - // Content: string(jsonInfo), - // SendTime: utils.GetCurrentTimestampBySecond(), - // MsgFrom: constant.SysMsgType, - // ContentType: constant.SetGroupInfoTip, - // SessionType: constant.GroupChatType, - // OperationID: req.OperationID, - //}) - return &pbGroup.CommonResp{}, nil -} diff --git a/internal/rpc/group/transfer_group_owner.go b/internal/rpc/group/transfer_group_owner.go deleted file mode 100644 index 4595fa1f1..000000000 --- a/internal/rpc/group/transfer_group_owner.go +++ /dev/null @@ -1,21 +0,0 @@ -package group - -import ( - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/proto/group" - "context" -) - -func (s *groupServer) TransferGroupOwner(_ context.Context, pb *group.TransferGroupOwnerReq) (*group.TransferGroupOwnerResp, error) { - log.Info("", "", "rpc TransferGroupOwner call start..., [pb: %s]", pb.String()) - - reply, err := im_mysql_model.TransferGroupOwner(pb) - if err != nil { - log.Error("", "", "rpc TransferGroupOwner call..., im_mysql_model.TransferGroupOwner fail [pb: %s] [err: %s]", pb.String(), err.Error()) - return nil, err - } - log.Info("", "", "rpc TransferGroupOwner call..., im_mysql_model.TransferGroupOwner") - - return reply, nil -} diff --git a/internal/rpc/message_cms/message_cms.go b/internal/rpc/message_cms/message_cms.go new file mode 100644 index 000000000..d71394668 --- /dev/null +++ b/internal/rpc/message_cms/message_cms.go @@ -0,0 +1,167 @@ +package messageCMS + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + errors "Open_IM/pkg/common/http" + "context" + + "Open_IM/pkg/common/log" + + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMessageCMS "Open_IM/pkg/proto/message_cms" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + + "Open_IM/pkg/utils" + + "net" + "strconv" + "strings" + + "google.golang.org/grpc" +) + +type messageCMSServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewMessageCMSServer(port int) *messageCMSServer { + log.NewPrivateLog("MessageCMS") + return &messageCMSServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImMessageCMSName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *messageCMSServer) Run() { + log.NewInfo("0", "messageCMS rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbMessageCMS.RegisterMessageCMSServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "message cms rpc success") +} + +func (s *messageCMSServer) BoradcastMessage(_ context.Context, req *pbMessageCMS.BoradcastMessageReq) (*pbMessageCMS.BoradcastMessageResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "BoradcastMessage", req.String()) + resp := &pbMessageCMS.BoradcastMessageResp{} + return resp, errors.WrapError(constant.ErrDB) +} + +func (s *messageCMSServer) GetChatLogs(_ context.Context, req *pbMessageCMS.GetChatLogsReq) (*pbMessageCMS.GetChatLogsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetChatLogs", req.String()) + resp := &pbMessageCMS.GetChatLogsResp{} + time, err := utils.TimeStringToTime(req.Date) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "time string parse error", err.Error()) + } + chatLog := db.ChatLog{ + Content: req.Content, + SendTime: time, + ContentType: req.ContentType, + SessionType: req.SessionType, + } + switch chatLog.SessionType { + case constant.SingleChatType: + chatLog.SendID = req.UserId + case constant.GroupChatType: + chatLog.RecvID = req.GroupId + chatLog.SendID = req.UserId + } + nums, err := imdb.GetChatLogCount(chatLog) + resp.ChatLogsNum = int32(nums) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLogCount", err.Error()) + } + chatLogs, err := imdb.GetChatLog(chatLog, req.Pagination.PageNumber, req.Pagination.ShowNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLog", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, chatLog := range chatLogs { + pbChatLog := &pbMessageCMS.ChatLogs{ + SessionType: chatLog.SessionType, + ContentType: chatLog.ContentType, + SearchContent: req.Content, + WholeContent: chatLog.Content, + Date: chatLog.CreateTime.String(), + SenderNickName: chatLog.SenderNickname, + SenderId: chatLog.SendID, + } + if chatLog.SenderNickname == "" { + sendUser, err := imdb.GetUserByUserID(chatLog.SendID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error()) + continue + } + pbChatLog.SenderNickName = sendUser.Nickname + } + switch chatLog.SessionType { + case constant.SingleChatType: + recvUser, err := imdb.GetUserByUserID(chatLog.RecvID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error()) + continue + } + pbChatLog.ReciverId = recvUser.UserID + pbChatLog.ReciverNickName = recvUser.Nickname + + case constant.GroupChatType: + group, err := imdb.GetGroupById(chatLog.RecvID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupById failed") + continue + } + pbChatLog.GroupId = group.GroupID + pbChatLog.GroupName = group.GroupName + } + resp.ChatLogs = append(resp.ChatLogs, pbChatLog) + } + resp.Pagination = &open_im_sdk.ResponsePagination{ + CurrentPage: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp output: ", resp.String()) + return resp, nil +} + +func (s *messageCMSServer) MassSendMessage(_ context.Context, req *pbMessageCMS.MassSendMessageReq) (*pbMessageCMS.MassSendMessageResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "MassSendMessage", req.String()) + resp := &pbMessageCMS.MassSendMessageResp{} + return resp, nil +} + +func (s *messageCMSServer) WithdrawMessage(_ context.Context, req *pbMessageCMS.WithdrawMessageReq) (*pbMessageCMS.WithdrawMessageResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "WithdrawMessage", req.String()) + resp := &pbMessageCMS.WithdrawMessageResp{} + return resp, nil +} diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go new file mode 100644 index 000000000..bb8ccd700 --- /dev/null +++ b/internal/rpc/msg/callback.go @@ -0,0 +1,159 @@ +package msg + +import ( + cbApi "Open_IM/pkg/call_back_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" +) + +func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq { + return cbApi.CommonCallbackReq{ + SendID: msg.MsgData.SendID, + ServerMsgID: msg.MsgData.ServerMsgID, + ClientMsgID: msg.MsgData.ClientMsgID, + OperationID: msg.OperationID, + SenderPlatformID: msg.MsgData.SenderPlatformID, + SenderNickname: msg.MsgData.SenderNickname, + SessionType: msg.MsgData.SessionType, + MsgFrom: msg.MsgData.MsgFrom, + ContentType: msg.MsgData.ContentType, + Status: msg.MsgData.Status, + CreateTime: msg.MsgData.CreateTime, + Content: string(msg.MsgData.Content), + } +} + +func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { + if !config.Config.Callback.CallbackBeforeSendSingleMsg.Enable { + return true, nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackBeforeSendSingleMsgCommand + req := cbApi.CallbackBeforeSendSingleMsgReq{ + CommonCallbackReq: commonCallbackReq, + RecvID: msg.MsgData.RecvID, + } + resp := &cbApi.CallbackBeforeSendSingleMsgResp{ + CommonCallbackResp: cbApi.CommonCallbackResp{}, + } + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackTimeOut); err != nil { + if !config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue { + return false, err + } else { + return true, err + } + } else { + if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { + return false, nil + } + } + return true, err +} + +func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error { + if !config.Config.Callback.CallbackAfterSendSingleMsg.Enable { + return nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackAfterSendSingleMsgCommand + req := cbApi.CallbackAfterSendSingleMsgReq{ + CommonCallbackReq: commonCallbackReq, + RecvID: msg.MsgData.RecvID, + } + resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendSingleMsg.CallbackTimeOut); err != nil { + return err + } + return nil +} + +func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { + if !config.Config.Callback.CallbackBeforeSendGroupMsg.Enable { + return true, nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackBeforeSendGroupMsgCommand + req := cbApi.CallbackAfterSendGroupMsgReq{ + CommonCallbackReq: commonCallbackReq, + GroupID: msg.MsgData.GroupID, + } + resp := &cbApi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackTimeOut); err != nil { + if !config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackFailedContinue { + return false, err + } else { + return true, err + } + } else { + if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { + return false, nil + } + } + return true, err +} + +func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) error { + if !config.Config.Callback.CallbackAfterSendGroupMsg.Enable { + return nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackAfterSendGroupMsgCommand + req := cbApi.CallbackAfterSendGroupMsgReq{ + CommonCallbackReq: commonCallbackReq, + GroupID: msg.MsgData.GroupID, + } + resp := &cbApi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil { + return err + } + return nil +} + +func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { + if !config.Config.Callback.CallbackWordFilter.Enable || msg.MsgData.ContentType != constant.Text { + return true, nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackWordFilterCommand + req := cbApi.CallbackWordFilterReq{ + CommonCallbackReq: commonCallbackReq, + } + resp := &cbApi.CallbackWordFilterResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + //utils.CopyStructFields(&req., msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackWordFilter.CallbackTimeOut); err != nil { + if !config.Config.Callback.CallbackWordFilter.CallbackFailedContinue { + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), "callback failed and config disable, stop this operation") + return false, err + } else { + return true, err + } + } else { + if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { + return false, nil + } + if resp.ErrCode == constant.CallbackHandleSuccess { + msg.MsgData.Content = []byte(resp.Content) + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) + } + return true, err +} diff --git a/internal/rpc/msg/conversation_notification.go b/internal/rpc/msg/conversation_notification.go new file mode 100644 index 000000000..cd9a7a6be --- /dev/null +++ b/internal/rpc/msg/conversation_notification.go @@ -0,0 +1,54 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +func conversationNotification(contentType int32, m proto.Message, operationID, userID string) { + var err error + var tips open_im_sdk.TipsComm + tips.Detail, err = proto.Marshal(m) + if err != nil { + log.Error(operationID, utils.GetSelfFuncName(), "Marshal failed ", err.Error(), m.String()) + return + } + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + tips.JsonDetail, _ = marshaler.MarshalToString(m) + cn := config.Config.Notification + switch contentType { + case constant.ConversationOptChangeNotification: + tips.DefaultTips = cn.ConversationOptUpdate.DefaultTips.Tips + } + var n NotificationMsg + n.SendID = userID + n.RecvID = userID + n.ContentType = contentType + n.SessionType = constant.SingleChatType + n.MsgFrom = constant.SysMsgType + n.OperationID = operationID + n.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(operationID, utils.GetSelfFuncName(), "Marshal failed ", err.Error(), tips.String()) + return + } + Notification(&n) +} + +// 客户端调用设置opt接口后调用 +func SetReceiveMessageOptNotification(operationID, opUserID, userID string) { + log.NewInfo(operationID, utils.GetSelfFuncName(), "operation user: ", opUserID, "operation id: ", userID) + conversationUpdateTips := open_im_sdk.ConversationUpdateTips{ + UserID: userID, + } + conversationNotification(constant.ConversationOptChangeNotification, &conversationUpdateTips, operationID, userID) +} diff --git a/internal/rpc/msg/friend_notification.go b/internal/rpc/msg/friend_notification.go new file mode 100644 index 000000000..91d926bf9 --- /dev/null +++ b/internal/rpc/msg/friend_notification.go @@ -0,0 +1,165 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + utils2 "Open_IM/pkg/common/utils" + pbFriend "Open_IM/pkg/proto/friend" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +func getFromToUserNickname(fromUserID, toUserID string) (string, string, error) { + from, err := imdb.GetUserByUserID(fromUserID) + if err != nil { + return "", "", utils.Wrap(err, "") + } + to, err := imdb.GetUserByUserID(toUserID) + if err != nil { + return "", "", utils.Wrap(err, "") + } + return from.Nickname, to.Nickname, nil +} + +func friendNotification(commID *pbFriend.CommID, contentType int32, m proto.Message) { + log.Info(commID.OperationID, utils.GetSelfFuncName(), "args: ", commID, contentType) + var err error + var tips open_im_sdk.TipsComm + tips.Detail, err = proto.Marshal(m) + if err != nil { + log.Error(commID.OperationID, "Marshal failed ", err.Error(), m.String()) + return + } + + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + + tips.JsonDetail, _ = marshaler.MarshalToString(m) + + fromUserNickname, toUserNickname, err := getFromToUserNickname(commID.FromUserID, commID.ToUserID) + if err != nil { + log.Error(commID.OperationID, "getFromToUserNickname failed ", err.Error(), commID.FromUserID, commID.ToUserID) + return + } + cn := config.Config.Notification + switch contentType { + case constant.FriendApplicationNotification: + tips.DefaultTips = fromUserNickname + cn.FriendApplication.DefaultTips.Tips + case constant.FriendApplicationApprovedNotification: + tips.DefaultTips = fromUserNickname + cn.FriendApplicationApproved.DefaultTips.Tips + case constant.FriendApplicationRejectedNotification: + tips.DefaultTips = fromUserNickname + cn.FriendApplicationRejected.DefaultTips.Tips + case constant.FriendAddedNotification: + tips.DefaultTips = cn.FriendAdded.DefaultTips.Tips + case constant.FriendDeletedNotification: + tips.DefaultTips = cn.FriendDeleted.DefaultTips.Tips + toUserNickname + case constant.FriendRemarkSetNotification: + tips.DefaultTips = fromUserNickname + cn.FriendRemarkSet.DefaultTips.Tips + case constant.BlackAddedNotification: + tips.DefaultTips = cn.BlackAdded.DefaultTips.Tips + case constant.BlackDeletedNotification: + tips.DefaultTips = cn.BlackDeleted.DefaultTips.Tips + toUserNickname + case constant.UserInfoUpdatedNotification: + tips.DefaultTips = cn.UserInfoUpdated.DefaultTips.Tips + default: + log.Error(commID.OperationID, "contentType failed ", contentType) + return + } + + var n NotificationMsg + n.SendID = commID.FromUserID + n.RecvID = commID.ToUserID + n.ContentType = contentType + n.SessionType = constant.SingleChatType + n.MsgFrom = constant.SysMsgType + n.OperationID = commID.OperationID + n.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(commID.OperationID, "Marshal failed ", err.Error(), tips.String()) + return + } + Notification(&n) +} + +func FriendApplicationNotification(req *pbFriend.AddFriendReq) { + FriendApplicationTips := open_im_sdk.FriendApplicationTips{FromToUserID: &open_im_sdk.FromToUserID{}} + FriendApplicationTips.FromToUserID.FromUserID = req.CommID.FromUserID + FriendApplicationTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.FriendApplicationNotification, &FriendApplicationTips) +} + +func FriendApplicationApprovedNotification(req *pbFriend.AddFriendResponseReq) { + FriendApplicationApprovedTips := open_im_sdk.FriendApplicationApprovedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + FriendApplicationApprovedTips.FromToUserID.FromUserID = req.CommID.FromUserID + FriendApplicationApprovedTips.FromToUserID.ToUserID = req.CommID.ToUserID + FriendApplicationApprovedTips.HandleMsg = req.HandleMsg + friendNotification(req.CommID, constant.FriendApplicationApprovedNotification, &FriendApplicationApprovedTips) +} + +func FriendApplicationRejectedNotification(req *pbFriend.AddFriendResponseReq) { + FriendApplicationApprovedTips := open_im_sdk.FriendApplicationApprovedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + FriendApplicationApprovedTips.FromToUserID.FromUserID = req.CommID.FromUserID + FriendApplicationApprovedTips.FromToUserID.ToUserID = req.CommID.ToUserID + FriendApplicationApprovedTips.HandleMsg = req.HandleMsg + friendNotification(req.CommID, constant.FriendApplicationRejectedNotification, &FriendApplicationApprovedTips) +} + +func FriendAddedNotification(operationID, opUserID, fromUserID, toUserID string) { + friendAddedTips := open_im_sdk.FriendAddedTips{Friend: &open_im_sdk.FriendInfo{}, OpUser: &open_im_sdk.PublicUserInfo{}} + user, err := imdb.GetUserByUserID(opUserID) + if err != nil { + log.NewError(operationID, "GetUserByUserID failed ", err.Error(), opUserID) + return + } + utils2.UserDBCopyOpenIMPublicUser(friendAddedTips.OpUser, user) + friend, err := imdb.GetFriendRelationshipFromFriend(fromUserID, toUserID) + if err != nil { + log.NewError(operationID, "GetFriendRelationshipFromFriend failed ", err.Error(), fromUserID, toUserID) + return + } + utils2.FriendDBCopyOpenIM(friendAddedTips.Friend, friend) + commID := pbFriend.CommID{FromUserID: fromUserID, ToUserID: toUserID, OpUserID: opUserID, OperationID: operationID} + friendNotification(&commID, constant.FriendAddedNotification, &friendAddedTips) +} + +func FriendDeletedNotification(req *pbFriend.DeleteFriendReq) { + friendDeletedTips := open_im_sdk.FriendDeletedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + friendDeletedTips.FromToUserID.FromUserID = req.CommID.FromUserID + friendDeletedTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.FriendDeletedNotification, &friendDeletedTips) +} + +func FriendRemarkSetNotification(operationID, opUserID, fromUserID, toUserID string) { + friendInfoChangedTips := open_im_sdk.FriendInfoChangedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + friendInfoChangedTips.FromToUserID.FromUserID = fromUserID + friendInfoChangedTips.FromToUserID.ToUserID = toUserID + commID := pbFriend.CommID{FromUserID: fromUserID, ToUserID: toUserID, OpUserID: opUserID, OperationID: operationID} + friendNotification(&commID, constant.FriendRemarkSetNotification, &friendInfoChangedTips) +} + +func BlackAddedNotification(req *pbFriend.AddBlacklistReq) { + blackAddedTips := open_im_sdk.BlackAddedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + blackAddedTips.FromToUserID.FromUserID = req.CommID.FromUserID + blackAddedTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.BlackAddedNotification, &blackAddedTips) +} + +func BlackDeletedNotification(req *pbFriend.RemoveBlacklistReq) { + blackDeletedTips := open_im_sdk.BlackDeletedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + blackDeletedTips.FromToUserID.FromUserID = req.CommID.FromUserID + blackDeletedTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.BlackDeletedNotification, &blackDeletedTips) +} + +func UserInfoUpdatedNotification(operationID, userID string, needNotifiedUserID string) { + selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: userID} + commID := pbFriend.CommID{FromUserID: userID, ToUserID: needNotifiedUserID, OpUserID: userID, OperationID: operationID} + friendNotification(&commID, constant.UserInfoUpdatedNotification, &selfInfoUpdatedTips) +} diff --git a/internal/rpc/msg/group_notification.go b/internal/rpc/msg/group_notification.go new file mode 100644 index 000000000..16c81600a --- /dev/null +++ b/internal/rpc/msg/group_notification.go @@ -0,0 +1,420 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + utils2 "Open_IM/pkg/common/utils" + pbGroup "Open_IM/pkg/proto/group" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +//message GroupCreatedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo Creator = 2; +// repeated GroupMemberFullInfo MemberList = 3; +// uint64 OperationTime = 4; +//} creator->group + +func setOpUserInfo(opUserID, groupID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error { + if token_verify.IsMangerUserID(opUserID) { + u, err := imdb.GetUserByUserID(opUserID) + if err != nil { + return utils.Wrap(err, "GetUserByUserID failed") + } + utils.CopyStructFields(groupMemberInfo, u) + groupMemberInfo.GroupID = groupID + } else { + u, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, opUserID) + if err == nil { + if err = utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, u); err != nil { + return utils.Wrap(err, "") + } + } + + user, err := imdb.GetUserByUserID(opUserID) + if err != nil { + return utils.Wrap(err, "") + } + groupMemberInfo.GroupID = groupID + groupMemberInfo.UserID = user.UserID + groupMemberInfo.Nickname = user.Nickname + groupMemberInfo.AppMangerLevel = user.AppMangerLevel + groupMemberInfo.FaceURL = user.FaceURL + } + return nil +} + +func setGroupInfo(groupID string, groupInfo *open_im_sdk.GroupInfo) error { + group, err := imdb.GetGroupInfoByGroupID(groupID) + if err != nil { + return utils.Wrap(err, "GetGroupInfoByGroupID failed") + } + err = utils2.GroupDBCopyOpenIM(groupInfo, group) + if err != nil { + return utils.Wrap(err, "GetGroupMemberNumByGroupID failed") + } + return nil +} + +func setGroupMemberInfo(groupID, userID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error { + groupMember, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID) + if err == nil { + return utils.Wrap(utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember), "") + } + + user, err := imdb.GetUserByUserID(userID) + if err != nil { + return utils.Wrap(err, "") + } + groupMemberInfo.GroupID = groupID + groupMemberInfo.UserID = user.UserID + groupMemberInfo.Nickname = user.Nickname + groupMemberInfo.AppMangerLevel = user.AppMangerLevel + groupMemberInfo.FaceURL = user.FaceURL + return nil +} + +func setGroupOwnerInfo(groupID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error { + groupMember, err := imdb.GetGroupOwnerInfoByGroupID(groupID) + if err != nil { + return utils.Wrap(err, "") + } + if err = utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember); err != nil { + return utils.Wrap(err, "") + } + return nil +} + +func setPublicUserInfo(userID string, publicUserInfo *open_im_sdk.PublicUserInfo) error { + user, err := imdb.GetUserByUserID(userID) + if err != nil { + return utils.Wrap(err, "") + } + utils2.UserDBCopyOpenIMPublicUser(publicUserInfo, user) + return nil +} + +func groupNotification(contentType int32, m proto.Message, sendID, groupID, recvUserID, operationID string) { + log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType) + + var err error + var tips open_im_sdk.TipsComm + tips.Detail, err = proto.Marshal(m) + if err != nil { + log.Error(operationID, "Marshal failed ", err.Error(), m.String()) + return + } + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + + tips.JsonDetail, _ = marshaler.MarshalToString(m) + + from, err := imdb.GetUserByUserID(sendID) + if err != nil { + log.Error(operationID, "GetUserByUserID failed ", err.Error(), sendID) + } + nickname := "" + if from != nil { + nickname = from.Nickname + } + + to, err := imdb.GetUserByUserID(recvUserID) + if err != nil { + log.Error(operationID, "GetUserByUserID failed ", err.Error(), recvUserID) + } + toNickname := "" + if to != nil { + toNickname = to.Nickname + } + + cn := config.Config.Notification + switch contentType { + case constant.GroupCreatedNotification: + tips.DefaultTips = nickname + " " + cn.GroupCreated.DefaultTips.Tips + case constant.GroupInfoSetNotification: + tips.DefaultTips = nickname + " " + cn.GroupInfoSet.DefaultTips.Tips + case constant.JoinGroupApplicationNotification: + tips.DefaultTips = nickname + " " + cn.JoinGroupApplication.DefaultTips.Tips + case constant.MemberQuitNotification: + tips.DefaultTips = nickname + " " + cn.MemberQuit.DefaultTips.Tips + case constant.GroupApplicationAcceptedNotification: // + tips.DefaultTips = toNickname + " " + cn.GroupApplicationAccepted.DefaultTips.Tips + case constant.GroupApplicationRejectedNotification: // + tips.DefaultTips = toNickname + " " + cn.GroupApplicationRejected.DefaultTips.Tips + case constant.GroupOwnerTransferredNotification: // + tips.DefaultTips = toNickname + " " + cn.GroupOwnerTransferred.DefaultTips.Tips + case constant.MemberKickedNotification: // + tips.DefaultTips = toNickname + " " + cn.MemberKicked.DefaultTips.Tips + case constant.MemberInvitedNotification: // + tips.DefaultTips = toNickname + " " + cn.MemberInvited.DefaultTips.Tips + case constant.MemberEnterNotification: + tips.DefaultTips = toNickname + " " + cn.MemberInvited.DefaultTips.Tips + default: + log.Error(operationID, "contentType failed ", contentType) + return + } + + var n NotificationMsg + n.SendID = sendID + if groupID != "" { + n.RecvID = groupID + n.SessionType = constant.GroupChatType + } else { + n.RecvID = recvUserID + n.SessionType = constant.SingleChatType + } + n.ContentType = contentType + n.OperationID = operationID + n.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(operationID, "Marshal failed ", err.Error(), tips.String()) + return + } + Notification(&n) +} + +//创建群后调用 +func GroupCreatedNotification(operationID, opUserID, groupID string, initMemberList []string) { + GroupCreatedTips := open_im_sdk.GroupCreatedTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}, GroupOwnerUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setOpUserInfo(opUserID, groupID, GroupCreatedTips.OpUser); err != nil { + log.NewError(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID, GroupCreatedTips.OpUser) + return + } + err := setGroupInfo(groupID, GroupCreatedTips.Group) + if err != nil { + log.Error(operationID, "setGroupInfo failed ", groupID, GroupCreatedTips.Group) + return + } + imdb.GetGroupOwnerInfoByGroupID(groupID) + if err := setGroupOwnerInfo(groupID, GroupCreatedTips.GroupOwnerUser); err != nil { + log.Error(operationID, "setGroupOwnerInfo failed", err.Error(), groupID) + return + } + for _, v := range initMemberList { + var groupMemberInfo open_im_sdk.GroupMemberFullInfo + if err := setGroupMemberInfo(groupID, v, &groupMemberInfo); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, v) + continue + } + GroupCreatedTips.MemberList = append(GroupCreatedTips.MemberList, &groupMemberInfo) + } + groupNotification(constant.GroupCreatedNotification, &GroupCreatedTips, opUserID, groupID, "", operationID) +} + +//群信息改变后掉用 +func GroupInfoSetNotification(operationID, opUserID, groupID string) { + GroupInfoChangedTips := open_im_sdk.GroupInfoSetTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, GroupInfoChangedTips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, GroupInfoChangedTips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + groupNotification(constant.GroupInfoSetNotification, &GroupInfoChangedTips, opUserID, groupID, "", operationID) +} + +//message ReceiveJoinApplicationTips{ +// GroupInfo Group = 1; +// PublicUserInfo Applicant = 2; +// string Reason = 3; +//} apply->all managers GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` +// ReqMessage string `protobuf:"bytes,2,opt,name=ReqMessage" json:"ReqMessage,omitempty"` +// OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` +// OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` +//申请进群后调用 +func JoinGroupApplicationNotification(req *pbGroup.JoinGroupReq) { + JoinGroupApplicationTips := open_im_sdk.JoinGroupApplicationTips{Group: &open_im_sdk.GroupInfo{}, Applicant: &open_im_sdk.PublicUserInfo{}} + err := setGroupInfo(req.GroupID, JoinGroupApplicationTips.Group) + if err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err = setPublicUserInfo(req.OpUserID, JoinGroupApplicationTips.Applicant); err != nil { + log.Error(req.OperationID, "setPublicUserInfo failed ", err.Error(), req.OpUserID) + return + } + JoinGroupApplicationTips.ReqMsg = req.ReqMessage + + managerList, err := imdb.GetOwnerManagerByGroupID(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetOwnerManagerByGroupId failed ", err.Error(), req.GroupID) + return + } + for _, v := range managerList { + groupNotification(constant.JoinGroupApplicationNotification, &JoinGroupApplicationTips, req.OpUserID, "", v.UserID, req.OperationID) + log.NewInfo(req.OperationID, "Notification ", v) + } +} + +func MemberQuitNotification(req *pbGroup.QuitGroupReq) { + MemberQuitTips := open_im_sdk.MemberQuitTips{Group: &open_im_sdk.GroupInfo{}, QuitUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, MemberQuitTips.Group); err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, MemberQuitTips.QuitUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID, req.GroupID) + return + } + + groupNotification(constant.MemberQuitNotification, &MemberQuitTips, req.OpUserID, req.GroupID, "", req.OperationID) + // groupNotification(constant.MemberQuitNotification, &MemberQuitTips, req.OpUserID, "", req.OpUserID, req.OperationID) + +} + +//message ApplicationProcessedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo OpUser = 2; +// int32 Result = 3; +// string Reason = 4; +//} +//处理进群请求后调用 +func GroupApplicationAcceptedNotification(req *pbGroup.GroupApplicationResponseReq) { + GroupApplicationAcceptedTips := open_im_sdk.GroupApplicationAcceptedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, HandleMsg: req.HandledMsg} + if err := setGroupInfo(req.GroupID, GroupApplicationAcceptedTips.Group); err != nil { + log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, GroupApplicationAcceptedTips.Group) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser) + return + } + groupNotification(constant.GroupApplicationAcceptedNotification, &GroupApplicationAcceptedTips, req.OpUserID, "", req.FromUserID, req.OperationID) +} + +func GroupApplicationRejectedNotification(req *pbGroup.GroupApplicationResponseReq) { + GroupApplicationRejectedTips := open_im_sdk.GroupApplicationRejectedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, HandleMsg: req.HandledMsg} + if err := setGroupInfo(req.GroupID, GroupApplicationRejectedTips.Group); err != nil { + log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, GroupApplicationRejectedTips.Group) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupApplicationRejectedTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationRejectedTips.OpUser) + return + } + groupNotification(constant.GroupApplicationRejectedNotification, &GroupApplicationRejectedTips, req.OpUserID, "", req.FromUserID, req.OperationID) +} + +func GroupOwnerTransferredNotification(req *pbGroup.TransferGroupOwnerReq) { + GroupOwnerTransferredTips := open_im_sdk.GroupOwnerTransferredTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, NewGroupOwner: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, GroupOwnerTransferredTips.Group); err != nil { + log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupOwnerTransferredTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID) + return + } + if err := setGroupMemberInfo(req.GroupID, req.NewOwnerUserID, GroupOwnerTransferredTips.NewGroupOwner); err != nil { + log.Error(req.OperationID, "setGroupMemberInfo failed", req.GroupID, req.NewOwnerUserID) + return + } + groupNotification(constant.GroupOwnerTransferredNotification, &GroupOwnerTransferredTips, req.OpUserID, req.GroupID, "", req.OperationID) +} + +//message MemberKickedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo OpUser = 2; +// GroupMemberFullInfo KickedUser = 3; +// uint64 OperationTime = 4; +//} +//被踢后调用 +func MemberKickedNotification(req *pbGroup.KickGroupMemberReq, kickedUserIDList []string) { + MemberKickedTips := open_im_sdk.MemberKickedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, MemberKickedTips.Group); err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, MemberKickedTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID) + return + } + for _, v := range kickedUserIDList { + var groupMemberInfo open_im_sdk.GroupMemberFullInfo + if err := setGroupMemberInfo(req.GroupID, v, &groupMemberInfo); err != nil { + log.Error(req.OperationID, "setGroupMemberInfo failed ", err.Error(), req.GroupID, v) + continue + } + MemberKickedTips.KickedUserList = append(MemberKickedTips.KickedUserList, &groupMemberInfo) + } + groupNotification(constant.MemberKickedNotification, &MemberKickedTips, req.OpUserID, req.GroupID, "", req.OperationID) + // + //for _, v := range kickedUserIDList { + // groupNotification(constant.MemberKickedNotification, &MemberKickedTips, req.OpUserID, "", v, req.OperationID) + //} +} + +//message MemberInvitedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo OpUser = 2; +// GroupMemberFullInfo InvitedUser = 3; +// uint64 OperationTime = 4; +//} +//被邀请进群后调用 +func MemberInvitedNotification(operationID, groupID, opUserID, reason string, invitedUserIDList []string) { + MemberInvitedTips := open_im_sdk.MemberInvitedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, MemberInvitedTips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, MemberInvitedTips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + for _, v := range invitedUserIDList { + var groupMemberInfo open_im_sdk.GroupMemberFullInfo + if err := setGroupMemberInfo(groupID, v, &groupMemberInfo); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID) + continue + } + MemberInvitedTips.InvitedUserList = append(MemberInvitedTips.InvitedUserList, &groupMemberInfo) + } + + groupNotification(constant.MemberInvitedNotification, &MemberInvitedTips, opUserID, groupID, "", operationID) +} + +//message GroupInfoChangedTips{ +// int32 ChangedType = 1; //bitwise operators: 1:groupName; 10:Notification 100:Introduction; 1000:FaceUrl +// GroupInfo Group = 2; +// GroupMemberFullInfo OpUser = 3; +//} + +//message MemberLeaveTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo LeaverUser = 2; +// uint64 OperationTime = 3; +//} + +//群成员退群后调用 + +//message MemberEnterTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo EntrantUser = 2; +// uint64 OperationTime = 3; +//} +//群成员主动申请进群,管理员同意后调用, +func MemberEnterNotification(req *pbGroup.GroupApplicationResponseReq) { + MemberEnterTips := open_im_sdk.MemberEnterTips{Group: &open_im_sdk.GroupInfo{}, EntrantUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, MemberEnterTips.Group); err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, MemberEnterTips.Group) + return + } + if err := setGroupMemberInfo(req.GroupID, req.FromUserID, MemberEnterTips.EntrantUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID, req.GroupID, MemberEnterTips.EntrantUser) + return + } + groupNotification(constant.MemberEnterNotification, &MemberEnterTips, req.OpUserID, req.GroupID, "", req.OperationID) + +} diff --git a/internal/rpc/msg/pull_message.go b/internal/rpc/msg/pull_message.go new file mode 100644 index 000000000..10a0978aa --- /dev/null +++ b/internal/rpc/msg/pull_message.go @@ -0,0 +1,74 @@ +package msg + +import ( + "context" + "github.com/garyburd/redigo/redis" + + commonDB "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" +) + +func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *pbMsg.GetMaxAndMinSeqReq) (*pbMsg.GetMaxAndMinSeqResp, error) { + log.InfoByKv("rpc getMaxAndMinSeq is arriving", in.OperationID, in.String()) + //seq, err := model.GetBiggestSeqFromReceive(in.UserID) + maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID) + minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) + resp := new(pbMsg.GetMaxAndMinSeqResp) + if err1 == nil { + resp.MaxSeq = uint32(maxSeq) + } else if err1 == redis.ErrNil { + resp.MaxSeq = 0 + } else { + log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err1.Error()) + resp.ErrCode = 200 + resp.ErrMsg = "redis get err" + } + if err2 == nil { + resp.MinSeq = uint32(minSeq) + } else if err2 == redis.ErrNil { + resp.MinSeq = 0 + } else { + log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err2.Error()) + resp.ErrCode = 201 + resp.ErrMsg = "redis get err" + } + return resp, nil +} +func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *open_im_sdk.PullMessageBySeqListReq) (*open_im_sdk.PullMessageBySeqListResp, error) { + log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String()) + resp := new(open_im_sdk.PullMessageBySeqListResp) + //msgList, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList, in.OperationID) + msgList, err := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, in.SeqList, in.OperationID) + if err != nil { + log.ErrorByKv("PullMessageBySeqList data error", in.OperationID, in.String()) + resp.ErrCode = 201 + resp.ErrMsg = err.Error() + return resp, nil + } + //respSingleMsgFormat = singleMsgHandleByUser(SingleMsgFormat, in.UserID) + //respGroupMsgFormat = groupMsgHandleByUser(GroupMsgFormat) + resp.ErrCode = 0 + resp.ErrMsg = "" + resp.List = msgList + return resp, nil + +} + +type MsgFormats []*open_im_sdk.MsgData + +// Implement the sort.Interface interface to get the number of elements method +func (s MsgFormats) Len() int { + return len(s) +} + +//Implement the sort.Interface interface comparison element method +func (s MsgFormats) Less(i, j int) bool { + return s[i].SendTime < s[j].SendTime +} + +//Implement the sort.Interface interface exchange element method +func (s MsgFormats) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} diff --git a/internal/rpc/chat/rpcChat.go b/internal/rpc/msg/rpcChat.go similarity index 99% rename from internal/rpc/chat/rpcChat.go rename to internal/rpc/msg/rpcChat.go index e3d2460dd..43113ae51 100644 --- a/internal/rpc/chat/rpcChat.go +++ b/internal/rpc/msg/rpcChat.go @@ -1,4 +1,4 @@ -package chat +package msg import ( "Open_IM/pkg/common/config" diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go new file mode 100644 index 000000000..af8f40b4f --- /dev/null +++ b/internal/rpc/msg/send_msg.go @@ -0,0 +1,499 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + pbGroup "Open_IM/pkg/proto/group" + sdk_ws "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/garyburd/redigo/redis" + "github.com/golang/protobuf/proto" + "math/rand" + "strconv" + "strings" + "time" +) + +type MsgCallBackReq struct { + SendID string `json:"sendID"` + RecvID string `json:"recvID"` + Content string `json:"content"` + SendTime int64 `json:"sendTime"` + MsgFrom int32 `json:"msgFrom"` + ContentType int32 `json:"contentType"` + SessionType int32 `json:"sessionType"` + PlatformID int32 `json:"senderPlatformID"` + MsgID string `json:"msgID"` + IsOnlineOnly bool `json:"isOnlineOnly"` +} +type MsgCallBackResp struct { + ErrCode int32 `json:"errCode"` + ErrMsg string `json:"errMsg"` + ResponseErrCode int32 `json:"responseErrCode"` + ResponseResult struct { + ModifiedMsg string `json:"modifiedMsg"` + Ext string `json:"ext"` + } +} + +func userRelationshipVerification(data *pbChat.SendMsgReq) { + + //etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + //client := pbChat.NewChatClient(etcdConn) + //reply, err := client.SendMsg(context.Background(), &req) + //if err != nil { + // log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), err.Error()) + //} else if reply.ErrCode != 0 { + // log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String()) + //} +} +func (rpc *rpcChat) encapsulateMsgData(msg *sdk_ws.MsgData) { + msg.ServerMsgID = GetMsgID(msg.SendID) + msg.SendTime = utils.GetCurrentTimestampByMill() + switch msg.ContentType { + case constant.Text: + fallthrough + case constant.Picture: + fallthrough + case constant.Voice: + fallthrough + case constant.Video: + fallthrough + case constant.File: + fallthrough + case constant.AtText: + fallthrough + case constant.Merger: + fallthrough + case constant.Card: + fallthrough + case constant.Location: + fallthrough + case constant.Custom: + fallthrough + case constant.Quote: + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, true) + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, true) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderSync, true) + case constant.Revoke: + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) + case constant.HasReadReceipt: + log.Info("", "this is a test start", msg, msg.Options) + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) + log.Info("", "this is a test end", msg, msg.Options) + case constant.Typing: + utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsPersistent, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderSync, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) + + } +} +func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.SendMsgResp, error) { + replay := pbChat.SendMsgResp{} + log.NewDebug(pb.OperationID, "rpc sendMsg come here", pb.String()) + userRelationshipVerification(pb) + //if !utils.VerifyToken(pb.Token, pb.SendID) { + // return returnMsg(&replay, pb, http.StatusUnauthorized, "token validate err,not authorized", "", 0) + rpc.encapsulateMsgData(pb.MsgData) + log.Info("", "this is a test MsgData ", pb.MsgData) + msgToMQ := pbChat.MsgDataToMQ{Token: pb.Token, OperationID: pb.OperationID} + //options := utils.JsonStringToMap(pbData.Options) + isHistory := utils.GetSwitchFromOptions(pb.MsgData.Options, constant.IsHistory) + mReq := MsgCallBackReq{ + SendID: pb.MsgData.SendID, + RecvID: pb.MsgData.RecvID, + Content: string(pb.MsgData.Content), + SendTime: pb.MsgData.SendTime, + MsgFrom: pb.MsgData.MsgFrom, + ContentType: pb.MsgData.ContentType, + SessionType: pb.MsgData.SessionType, + PlatformID: pb.MsgData.SenderPlatformID, + MsgID: pb.MsgData.ClientMsgID, + } + if !isHistory { + mReq.IsOnlineOnly = true + } + + // callback + canSend, err := callbackWordFilter(pb) + if err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter failed", err.Error(), pb.MsgData) + } + if !canSend { + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter result", canSend, "end rpc and return", pb.MsgData) + return returnMsg(&replay, pb, 201, "callbackWordFilter result stop rpc and return", "", 0) + } + switch pb.MsgData.SessionType { + case constant.SingleChatType: + // callback + canSend, err := callbackBeforeSendSingleMsg(pb) + if err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg failed", err.Error()) + } + if !canSend { + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", canSend, "end rpc and return") + return returnMsg(&replay, pb, 201, "callbackBeforeSendSingleMsg result stop rpc and return", "", 0) + } + isSend := modifyMessageByUserMessageReceiveOpt(pb.MsgData.RecvID, pb.MsgData.SendID, constant.SingleChatType, pb) + if isSend { + msgToMQ.MsgData = pb.MsgData + log.NewInfo(msgToMQ.OperationID, msgToMQ) + err1 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.RecvID) + if err1 != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:RecvID", msgToMQ.MsgData.RecvID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + if msgToMQ.MsgData.SendID != msgToMQ.MsgData.RecvID { //Filter messages sent to yourself + err2 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.SendID) + if err2 != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:SendID", msgToMQ.MsgData.SendID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + // callback + if err := callbackAfterSendSingleMsg(pb); err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSingleMsg failed", err.Error()) + } + return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime) + case constant.GroupChatType: + // callback + canSend, err := callbackBeforeSendGroupMsg(pb) + if err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg failed", err.Error()) + } + if !canSend { + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg result", canSend, "end rpc and return") + return returnMsg(&replay, pb, 201, "callbackBeforeSendGroupMsg result stop rpc and return", "", 0) + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + req := &pbGroup.GetGroupAllMemberReq{ + GroupID: pb.MsgData.GroupID, + OperationID: pb.OperationID, + } + reply, err := client.GetGroupAllMember(context.Background(), req) + if err != nil { + log.Error(pb.Token, pb.OperationID, "rpc send_msg getGroupInfo failed, err = %s", err.Error()) + return returnMsg(&replay, pb, 201, err.Error(), "", 0) + } + if reply.ErrCode != 0 { + log.Error(pb.Token, pb.OperationID, "rpc send_msg getGroupInfo failed, err = %s", reply.ErrMsg) + return returnMsg(&replay, pb, reply.ErrCode, reply.ErrMsg, "", 0) + } + var addUidList []string + switch pb.MsgData.ContentType { + case constant.MemberKickedNotification: + var tips sdk_ws.TipsComm + var memberKickedTips sdk_ws.MemberKickedTips + err := proto.Unmarshal(pb.MsgData.Content, &tips) + if err != nil { + log.Error(pb.OperationID, "Unmarshal err", err.Error()) + } + err = proto.Unmarshal(tips.Detail, &memberKickedTips) + if err != nil { + log.Error(pb.OperationID, "Unmarshal err", err.Error()) + } + log.Info(pb.OperationID, "data is ", memberKickedTips) + for _, v := range memberKickedTips.KickedUserList { + addUidList = append(addUidList, v.UserID) + } + case constant.MemberQuitNotification: + addUidList = append(addUidList, pb.MsgData.SendID) + default: + } + groupID := pb.MsgData.GroupID + for _, v := range reply.MemberList { + pb.MsgData.RecvID = v.UserID + isSend := modifyMessageByUserMessageReceiveOpt(v.UserID, groupID, constant.GroupChatType, pb) + if isSend { + msgToMQ.MsgData = pb.MsgData + err := rpc.sendMsgToKafka(&msgToMQ, v.UserID) + if err != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:UserId", v.UserID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + + } + log.Info(msgToMQ.OperationID, "addUidList", addUidList) + for _, v := range addUidList { + pb.MsgData.RecvID = v + isSend := modifyMessageByUserMessageReceiveOpt(v, groupID, constant.GroupChatType, pb) + log.Info(msgToMQ.OperationID, "isSend", isSend) + if isSend { + msgToMQ.MsgData = pb.MsgData + err := rpc.sendMsgToKafka(&msgToMQ, v) + if err != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:UserId", v, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + } + // callback + if err := callbackAfterSendGroupMsg(pb); err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg failed", err.Error()) + } + return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime) + default: + return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0) + } +} + +func (rpc *rpcChat) sendMsgToKafka(m *pbChat.MsgDataToMQ, key string) error { + pid, offset, err := rpc.producer.SendMessage(m, key) + if err != nil { + log.ErrorByKv("kafka send failed", m.OperationID, "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), "key", key) + } + return err +} +func GetMsgID(sendID string) string { + t := time.Now().Format("2006-01-02 15:04:05") + return utils.Md5(t + "-" + sendID + "-" + strconv.Itoa(rand.Int())) +} + +func returnMsg(replay *pbChat.SendMsgResp, pb *pbChat.SendMsgReq, errCode int32, errMsg, serverMsgID string, sendTime int64) (*pbChat.SendMsgResp, error) { + replay.ErrCode = errCode + replay.ErrMsg = errMsg + replay.ServerMsgID = serverMsgID + replay.ClientMsgID = pb.MsgData.ClientMsgID + replay.SendTime = sendTime + return replay, nil +} + +func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType int, pb *pbChat.SendMsgReq) bool { + conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) + opt, err := db.DB.GetSingleConversationMsgOpt(userID, conversationID) + if err != nil && err != redis.ErrNil { + log.NewError(pb.OperationID, "GetSingleConversationMsgOpt from redis err", conversationID, pb.String(), err.Error()) + return true + } + switch opt { + case constant.ReceiveMessage: + return true + case constant.NotReceiveMessage: + return false + case constant.ReceiveNotNotifyMessage: + if pb.MsgData.Options == nil { + pb.MsgData.Options = make(map[string]bool, 10) + } + utils.SetSwitchFromOptions(pb.MsgData.Options, constant.IsOfflinePush, false) + return true + } + + return true +} + +type NotificationMsg struct { + SendID string + RecvID string + Content []byte // open_im_sdk.TipsComm + MsgFrom int32 + ContentType int32 + SessionType int32 + OperationID string +} + +func Notification(n *NotificationMsg) { + var req pbChat.SendMsgReq + var msg sdk_ws.MsgData + var offlineInfo sdk_ws.OfflinePushInfo + var title, desc, ex string + var pushSwitch, unReadCount bool + var reliabilityLevel int + req.OperationID = n.OperationID + msg.SendID = n.SendID + msg.RecvID = n.RecvID + msg.Content = n.Content + msg.MsgFrom = n.MsgFrom + msg.ContentType = n.ContentType + msg.SessionType = n.SessionType + msg.CreateTime = utils.GetCurrentTimestampByMill() + msg.ClientMsgID = utils.GetMsgID(n.SendID) + msg.Options = make(map[string]bool, 7) + switch n.SessionType { + case constant.GroupChatType: + msg.RecvID = "" + msg.GroupID = n.RecvID + } + offlineInfo.IOSBadgeCount = config.Config.IOSPush.BadgeCount + offlineInfo.IOSPushSound = config.Config.IOSPush.PushSound + switch msg.ContentType { + case constant.GroupCreatedNotification: + pushSwitch = config.Config.Notification.GroupCreated.OfflinePush.PushSwitch + title = config.Config.Notification.GroupCreated.OfflinePush.Title + desc = config.Config.Notification.GroupCreated.OfflinePush.Desc + ex = config.Config.Notification.GroupCreated.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupCreated.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupCreated.Conversation.UnreadCount + case constant.GroupInfoSetNotification: + pushSwitch = config.Config.Notification.GroupInfoSet.OfflinePush.PushSwitch + title = config.Config.Notification.GroupInfoSet.OfflinePush.Title + desc = config.Config.Notification.GroupInfoSet.OfflinePush.Desc + ex = config.Config.Notification.GroupInfoSet.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupInfoSet.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupInfoSet.Conversation.UnreadCount + case constant.JoinGroupApplicationNotification: + pushSwitch = config.Config.Notification.JoinGroupApplication.OfflinePush.PushSwitch + title = config.Config.Notification.JoinGroupApplication.OfflinePush.Title + desc = config.Config.Notification.JoinGroupApplication.OfflinePush.Desc + ex = config.Config.Notification.JoinGroupApplication.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.JoinGroupApplication.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.JoinGroupApplication.Conversation.UnreadCount + case constant.MemberQuitNotification: + pushSwitch = config.Config.Notification.MemberQuit.OfflinePush.PushSwitch + title = config.Config.Notification.MemberQuit.OfflinePush.Title + desc = config.Config.Notification.MemberQuit.OfflinePush.Desc + ex = config.Config.Notification.MemberQuit.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberQuit.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberQuit.Conversation.UnreadCount + case constant.GroupApplicationAcceptedNotification: + pushSwitch = config.Config.Notification.GroupApplicationAccepted.OfflinePush.PushSwitch + title = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Title + desc = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Desc + ex = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupApplicationAccepted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupApplicationAccepted.Conversation.UnreadCount + case constant.GroupApplicationRejectedNotification: + pushSwitch = config.Config.Notification.GroupApplicationRejected.OfflinePush.PushSwitch + title = config.Config.Notification.GroupApplicationRejected.OfflinePush.Title + desc = config.Config.Notification.GroupApplicationRejected.OfflinePush.Desc + ex = config.Config.Notification.GroupApplicationRejected.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupApplicationRejected.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupApplicationRejected.Conversation.UnreadCount + case constant.GroupOwnerTransferredNotification: + pushSwitch = config.Config.Notification.GroupOwnerTransferred.OfflinePush.PushSwitch + title = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Title + desc = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Desc + ex = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupOwnerTransferred.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupOwnerTransferred.Conversation.UnreadCount + case constant.MemberKickedNotification: + pushSwitch = config.Config.Notification.MemberKicked.OfflinePush.PushSwitch + title = config.Config.Notification.MemberKicked.OfflinePush.Title + desc = config.Config.Notification.MemberKicked.OfflinePush.Desc + ex = config.Config.Notification.MemberKicked.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberKicked.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberKicked.Conversation.UnreadCount + case constant.MemberInvitedNotification: + pushSwitch = config.Config.Notification.MemberInvited.OfflinePush.PushSwitch + title = config.Config.Notification.MemberInvited.OfflinePush.Title + desc = config.Config.Notification.MemberInvited.OfflinePush.Desc + ex = config.Config.Notification.MemberInvited.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberInvited.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberInvited.Conversation.UnreadCount + case constant.MemberEnterNotification: + pushSwitch = config.Config.Notification.MemberEnter.OfflinePush.PushSwitch + title = config.Config.Notification.MemberEnter.OfflinePush.Title + desc = config.Config.Notification.MemberEnter.OfflinePush.Desc + ex = config.Config.Notification.MemberEnter.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberEnter.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberEnter.Conversation.UnreadCount + case constant.UserInfoUpdatedNotification: + pushSwitch = config.Config.Notification.UserInfoUpdated.OfflinePush.PushSwitch + title = config.Config.Notification.UserInfoUpdated.OfflinePush.Title + desc = config.Config.Notification.UserInfoUpdated.OfflinePush.Desc + ex = config.Config.Notification.UserInfoUpdated.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.UserInfoUpdated.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.UserInfoUpdated.Conversation.UnreadCount + case constant.FriendApplicationNotification: + pushSwitch = config.Config.Notification.FriendApplication.OfflinePush.PushSwitch + title = config.Config.Notification.FriendApplication.OfflinePush.Title + desc = config.Config.Notification.FriendApplication.OfflinePush.Desc + ex = config.Config.Notification.FriendApplication.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendApplication.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendApplication.Conversation.UnreadCount + case constant.FriendApplicationApprovedNotification: + pushSwitch = config.Config.Notification.FriendApplicationApproved.OfflinePush.PushSwitch + title = config.Config.Notification.FriendApplicationApproved.OfflinePush.Title + desc = config.Config.Notification.FriendApplicationApproved.OfflinePush.Desc + ex = config.Config.Notification.FriendApplicationApproved.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendApplicationApproved.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendApplicationApproved.Conversation.UnreadCount + case constant.FriendApplicationRejectedNotification: + pushSwitch = config.Config.Notification.FriendApplicationRejected.OfflinePush.PushSwitch + title = config.Config.Notification.FriendApplicationRejected.OfflinePush.Title + desc = config.Config.Notification.FriendApplicationRejected.OfflinePush.Desc + ex = config.Config.Notification.FriendApplicationRejected.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendApplicationRejected.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendApplicationRejected.Conversation.UnreadCount + case constant.FriendAddedNotification: + pushSwitch = config.Config.Notification.FriendAdded.OfflinePush.PushSwitch + title = config.Config.Notification.FriendAdded.OfflinePush.Title + desc = config.Config.Notification.FriendAdded.OfflinePush.Desc + ex = config.Config.Notification.FriendAdded.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendAdded.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendAdded.Conversation.UnreadCount + case constant.FriendDeletedNotification: + pushSwitch = config.Config.Notification.FriendDeleted.OfflinePush.PushSwitch + title = config.Config.Notification.FriendDeleted.OfflinePush.Title + desc = config.Config.Notification.FriendDeleted.OfflinePush.Desc + ex = config.Config.Notification.FriendDeleted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendDeleted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendDeleted.Conversation.UnreadCount + case constant.FriendRemarkSetNotification: + pushSwitch = config.Config.Notification.FriendRemarkSet.OfflinePush.PushSwitch + title = config.Config.Notification.FriendRemarkSet.OfflinePush.Title + desc = config.Config.Notification.FriendRemarkSet.OfflinePush.Desc + ex = config.Config.Notification.FriendRemarkSet.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendRemarkSet.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendRemarkSet.Conversation.UnreadCount + case constant.BlackAddedNotification: + pushSwitch = config.Config.Notification.BlackAdded.OfflinePush.PushSwitch + title = config.Config.Notification.BlackAdded.OfflinePush.Title + desc = config.Config.Notification.BlackAdded.OfflinePush.Desc + ex = config.Config.Notification.BlackAdded.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.BlackAdded.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.BlackAdded.Conversation.UnreadCount + case constant.BlackDeletedNotification: + pushSwitch = config.Config.Notification.BlackDeleted.OfflinePush.PushSwitch + title = config.Config.Notification.BlackDeleted.OfflinePush.Title + desc = config.Config.Notification.BlackDeleted.OfflinePush.Desc + ex = config.Config.Notification.BlackDeleted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.BlackDeleted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.BlackDeleted.Conversation.UnreadCount + case constant.ConversationOptChangeNotification: + pushSwitch = config.Config.Notification.ConversationOptUpdate.OfflinePush.PushSwitch + title = config.Config.Notification.ConversationOptUpdate.OfflinePush.Title + desc = config.Config.Notification.ConversationOptUpdate.OfflinePush.Desc + ex = config.Config.Notification.ConversationOptUpdate.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.ConversationOptUpdate.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.ConversationOptUpdate.Conversation.UnreadCount + } + switch reliabilityLevel { + case constant.UnreliableNotification: + utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsPersistent, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + case constant.ReliableNotificationNoMsg: + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + case constant.ReliableNotificationMsg: + + } + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, unReadCount) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, pushSwitch) + offlineInfo.Title = title + offlineInfo.Desc = desc + offlineInfo.Ex = ex + msg.OfflinePushInfo = &offlineInfo + req.MsgData = &msg + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + reply, err := client.SendMsg(context.Background(), &req) + if err != nil { + log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), err.Error()) + } else if reply.ErrCode != 0 { + log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String()) + } +} diff --git a/internal/rpc/statistics/statistics.go b/internal/rpc/statistics/statistics.go new file mode 100644 index 000000000..e8b1383f9 --- /dev/null +++ b/internal/rpc/statistics/statistics.go @@ -0,0 +1,378 @@ +package statistics + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "context" + "sync" + "time" + + //"Open_IM/pkg/common/constant" + //"Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + + //cp "Open_IM/pkg/common/utils" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbStatistics "Open_IM/pkg/proto/statistics" + + //open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + //"context" + "net" + "strconv" + "strings" + errors "Open_IM/pkg/common/http" + + "google.golang.org/grpc" +) + +type statisticsServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewStatisticsServer(port int) *statisticsServer { + log.NewPrivateLog("Statistics") + return &statisticsServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImStatisticsName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *statisticsServer) Run() { + log.NewInfo("0", "Statistics rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbStatistics.RegisterUserServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "statistics rpc success") +} + +func (s *statisticsServer) GetActiveGroup(_ context.Context, req *pbStatistics.GetActiveGroupReq) (*pbStatistics.GetActiveGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetActiveGroupResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + activeGroups, err := imdb.GetActiveGroups(fromTime, toTime, 12) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveGroups failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, activeGroup := range activeGroups { + resp.Groups = append(resp.Groups, + &pbStatistics.GroupResp{ + GroupName: activeGroup.Name, + GroupId: activeGroup.Id, + MessageNum: int32(activeGroup.MessageNum), + }) + } + return resp, nil +} + +func (s *statisticsServer) GetActiveUser(_ context.Context, req *pbStatistics.GetActiveUserReq) (*pbStatistics.GetActiveUserResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetActiveUserResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + activeUsers, err := imdb.GetActiveUsers(fromTime, toTime, 12) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveUsers failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, activeUser := range activeUsers { + resp.Users = append(resp.Users, + &pbStatistics.UserResp{ + UserId: activeUser.Id, + NickName: activeUser.Name, + MessageNum: int32(activeUser.MessageNum), + }, + ) + } + return resp, nil +} + +func ParseTimeFromTo(from, to string) (time.Time, time.Time, error) { + var fromTime time.Time + var toTime time.Time + fromTime, err := utils.TimeStringToTime(from) + if err != nil { + return fromTime, toTime, err + } + toTime, err = utils.TimeStringToTime(to) + if err != nil { + return fromTime, toTime, err + } + return fromTime, toTime, nil +} + +func isInOneMonth(from, to time.Time) bool { + return from.Month() == to.Month() && from.Year() == to.Year() +} + +func GetRangeDate(from, to time.Time) [][2]time.Time { + interval := to.Sub(from) + var times [][2]time.Time + switch { + // today + case interval == 0: + times = append(times, [2]time.Time{ + from, from.Add(time.Hour * 24), + }) + // days + case isInOneMonth(from, to): + for i := 0; ; i++ { + fromTime := from.Add(time.Hour * 24 * time.Duration(i)) + toTime := from.Add(time.Hour * 24 * time.Duration(i+1)) + if toTime.After(to.Add(time.Hour * 24)) { + break + } + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } + // month + case !isInOneMonth(from, to): + if to.Sub(from) < time.Hour * 24 * 30 { + for i := 0; ; i++ { + fromTime := from.Add(time.Hour * 24 * time.Duration(i)) + toTime := from.Add(time.Hour * 24 * time.Duration(i+1)) + if toTime.After(to.Add(time.Hour * 24)) { + break + } + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } + } else { + for i := 0; ; i++ { + if i == 0 { + fromTime := from + toTime := getFirstDateOfNextNMonth(fromTime, 1) + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } else { + fromTime := getFirstDateOfNextNMonth(from, i) + toTime := getFirstDateOfNextNMonth(fromTime, 1) + if toTime.After(to) { + toTime = to + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + break + } + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } + + } + } + } + return times +} + +func getFirstDateOfNextNMonth(currentTime time.Time, n int) time.Time { + lastOfMonth := time.Date(currentTime.Year(), currentTime.Month(), 1, 0, 0, 0, 0, currentTime.Location()).AddDate(0, n, 0) + return lastOfMonth +} + +func (s *statisticsServer) GetGroupStatistics(_ context.Context, req *pbStatistics.GetGroupStatisticsReq) (*pbStatistics.GetGroupStatisticsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetGroupStatisticsResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupStatistics failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + increaseGroupNum, err := imdb.GetIncreaseGroupNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + totalGroupNum, err := imdb.GetTotalGroupNum() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.IncreaseGroupNum = increaseGroupNum + resp.TotalGroupNum = totalGroupNum + times := GetRangeDate(fromTime, toTime) + log.NewInfo(req.OperationID, "times:", times) + wg := &sync.WaitGroup{} + resp.IncreaseGroupNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.TotalGroupNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + wg.Add(len(times)) + for i, v := range times { + go func(wg *sync.WaitGroup, index int, v [2]time.Time) { + defer wg.Done() + num, err := imdb.GetIncreaseGroupNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.IncreaseGroupNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + num, err = imdb.GetGroupNum(v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.TotalGroupNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + }(wg, i, v) + } + wg.Wait() + return resp, nil +} + +func (s *statisticsServer) GetMessageStatistics(_ context.Context, req *pbStatistics.GetMessageStatisticsReq) (*pbStatistics.GetMessageStatisticsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetMessageStatisticsResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + privateMessageNum, err := imdb.GetPrivateMessageNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetPrivateMessageNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + groupMessageNum, err := imdb.GetGroupMessageNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMessageNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.PrivateMessageNum = privateMessageNum + resp.GroupMessageNum = groupMessageNum + times := GetRangeDate(fromTime, toTime) + resp.GroupMessageNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.PrivateMessageNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + wg := &sync.WaitGroup{} + wg.Add(len(times)) + for i, v := range times { + go func(wg *sync.WaitGroup, index int, v [2]time.Time) { + defer wg.Done() + + num, err := imdb.GetPrivateMessageNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.PrivateMessageNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + num, err = imdb.GetGroupMessageNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.GroupMessageNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + }(wg, i, v) + } + wg.Wait() + return resp, nil +} + +func (s *statisticsServer) GetUserStatistics(_ context.Context, req *pbStatistics.GetUserStatisticsReq) (*pbStatistics.GetUserStatisticsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetUserStatisticsResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + activeUserNum, err := imdb.GetActiveUserNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveUserNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + increaseUserNum, err := imdb.GetIncreaseUserNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseUserNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + totalUserNum, err := imdb.GetTotalUserNum() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTotalUserNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.ActiveUserNum = activeUserNum + resp.TotalUserNum = totalUserNum + resp.IncreaseUserNum = increaseUserNum + times := GetRangeDate(fromTime, toTime) + resp.TotalUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.ActiveUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.IncreaseUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + wg := &sync.WaitGroup{} + wg.Add(len(times)) + for i, v := range times { + go func(wg *sync.WaitGroup, index int, v [2]time.Time) { + defer wg.Done() + num, err := imdb.GetActiveUserNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.ActiveUserNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + + num, err = imdb.GetTotalUserNumByDate(v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTotalUserNumByDate", v, err.Error()) + } + resp.TotalUserNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + num, err = imdb.GetIncreaseUserNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseUserNum", v, err.Error()) + } + resp.IncreaseUserNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + }(wg, i, v) + } + wg.Wait() + return resp, nil +} diff --git a/internal/rpc/user/callback.go b/internal/rpc/user/callback.go new file mode 100644 index 000000000..a00006b65 --- /dev/null +++ b/internal/rpc/user/callback.go @@ -0,0 +1 @@ +package user diff --git a/internal/rpc/user/get_user_info.go b/internal/rpc/user/get_user_info.go deleted file mode 100644 index 3f9cec00f..000000000 --- a/internal/rpc/user/get_user_info.go +++ /dev/null @@ -1,97 +0,0 @@ -package user - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/utils" - "context" - "google.golang.org/grpc" - "net" - "strconv" - "strings" -) - -type userServer struct { - rpcPort int - rpcRegisterName string - etcdSchema string - etcdAddr []string -} - -func NewUserServer(port int) *userServer { - log.NewPrivateLog("user") - return &userServer{ - rpcPort: port, - rpcRegisterName: config.Config.RpcRegisterName.OpenImUserName, - etcdSchema: config.Config.Etcd.EtcdSchema, - etcdAddr: config.Config.Etcd.EtcdAddr, - } -} - -func (s *userServer) Run() { - log.Info("", "", "rpc user init....") - - ip := utils.ServerIP - registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) - //listener network - listener, err := net.Listen("tcp", registerAddress) - if err != nil { - log.InfoByArgs("listen network failed,err=%s", err.Error()) - return - } - log.Info("", "", "listen network success, address = %s", registerAddress) - defer listener.Close() - //grpc server - srv := grpc.NewServer() - defer srv.GracefulStop() - //Service registers with etcd - pbUser.RegisterUserServer(srv, s) - err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) - if err != nil { - log.ErrorByArgs("register rpc token to etcd failed,err=%s", err.Error()) - return - } - err = srv.Serve(listener) - if err != nil { - log.ErrorByArgs("listen token failed,err=%s", err.Error()) - return - } - log.Info("", "", "rpc token init success") -} - -func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) { - log.InfoByKv("rpc get_user_info is server", req.OperationID) - - var userInfoList []*pbUser.UserInfo - //Obtain user information according to userID - if len(req.UserIDList) > 0 { - for _, userID := range req.UserIDList { - var userInfo pbUser.UserInfo - user, err := im_mysql_model.FindUserByUID(userID) - if err != nil { - log.ErrorByKv("search userinfo failed", req.OperationID, "userID", userID, "err=%s", err.Error()) - continue - } - userInfo.Uid = user.UID - userInfo.Icon = user.Icon - userInfo.Name = user.Name - userInfo.Gender = user.Gender - userInfo.Mobile = user.Mobile - userInfo.Birth = user.Birth - userInfo.Email = user.Email - userInfo.Ex = user.Ex - userInfoList = append(userInfoList, &userInfo) - } - } else { - return &pbUser.GetUserInfoResp{ErrorCode: 999, ErrorMsg: "uidList is nil"}, nil - } - log.InfoByKv("rpc get userInfo return success", req.OperationID, "token", req.Token) - return &pbUser.GetUserInfoResp{ - ErrorCode: 0, - ErrorMsg: "", - Data: userInfoList, - }, nil -} diff --git a/internal/rpc/user/internal_service/get_user_info_to_client.go b/internal/rpc/user/internal_service/get_user_info_to_client.go deleted file mode 100644 index 4cd0d0d2d..000000000 --- a/internal/rpc/user/internal_service/get_user_info_to_client.go +++ /dev/null @@ -1,16 +0,0 @@ -package internal_service - -import ( - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/common/config" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - "context" - "strings" -) - -func GetUserInfoClient(req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) { - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - RpcResp, err := client.GetUserInfo(context.Background(), req) - return RpcResp, err -} diff --git a/internal/rpc/user/management_user.go b/internal/rpc/user/management_user.go deleted file mode 100644 index f9d5b75a1..000000000 --- a/internal/rpc/user/management_user.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -** description(""). -** copyright('open-im,www.open-im.io'). -** author("fg,Gordon@tuoyun.net"). -** time(2021/9/15 10:28). - */ -package user - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/utils" - "context" -) - -func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq) (*pbUser.DeleteUsersResp, error) { - log.InfoByKv("rpc DeleteUsers arrived server", req.OperationID, "args", req.String()) - var resp pbUser.DeleteUsersResp - c, err := utils.ParseToken(req.Token) - if err != nil { - log.ErrorByKv("parse token failed", req.OperationID, "err", err.Error()) - return &pbUser.DeleteUsersResp{CommonResp: &pbUser.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: err.Error()}, FailedUidList: req.DeleteUidList}, nil - } - if !utils.IsContain(c.UID, config.Config.Manager.AppManagerUid) { - log.ErrorByKv(" Authentication failed", req.OperationID, "args", c) - return &pbUser.DeleteUsersResp{CommonResp: &pbUser.CommonResp{ErrorCode: 401, ErrorMsg: "not authorized"}, FailedUidList: req.DeleteUidList}, nil - } - for _, uid := range req.DeleteUidList { - err = im_mysql_model.UserDelete(uid) - if err != nil { - resp.CommonResp.ErrorCode = 201 - resp.CommonResp.ErrorMsg = "some uid deleted failed" - resp.FailedUidList = append(resp.FailedUidList, uid) - } - } - return &resp, nil - -} - -func (s *userServer) GetAllUsersUid(_ context.Context, req *pbUser.GetAllUsersUidReq) (*pbUser.GetAllUsersUidResp, error) { - log.InfoByKv("rpc GetAllUsersUid arrived server", req.OperationID, "args", req.String()) - c, err := utils.ParseToken(req.Token) - if err != nil { - log.InfoByKv("parse token failed", req.OperationID, "err", err.Error()) - return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: err.Error()}}, nil - } - if !utils.IsContain(c.UID, config.Config.Manager.AppManagerUid) { - log.ErrorByKv(" Authentication failed", req.OperationID, "args", c) - return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: 401, ErrorMsg: "not authorized"}}, nil - } - uidList, err := im_mysql_model.SelectAllUID() - if err != nil { - log.ErrorByKv("db get failed", req.OperationID, "err", err.Error()) - return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: config.ErrMysql.ErrCode, ErrorMsg: err.Error()}}, nil - } else { - return &pbUser.GetAllUsersUidResp{CommonResp: &pbUser.CommonResp{ErrorCode: 0, ErrorMsg: ""}, UidList: uidList}, nil - } - -} diff --git a/internal/rpc/user/update_user_info.go b/internal/rpc/user/update_user_info.go deleted file mode 100644 index 14fe9f0db..000000000 --- a/internal/rpc/user/update_user_info.go +++ /dev/null @@ -1,81 +0,0 @@ -package user - -import ( - "Open_IM/internal/push/logic" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbChat "Open_IM/pkg/proto/chat" - pbFriend "Open_IM/pkg/proto/friend" - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/utils" - "context" - "strings" -) - -func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserInfoReq) (*pbUser.CommonResp, error) { - log.Info(req.Token, req.OperationID, "rpc modify user is server,args=%s", req.String()) - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbUser.CommonResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: err.Error()}, nil - } - - ownerUid := "" - //if claims.UID == config.Config.AppManagerUid { - if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { - ownerUid = req.Uid - } else { - ownerUid = claims.UID - } - - err = im_mysql_model.UpDateUserInfo(ownerUid, req.Name, req.Icon, req.Mobile, req.Birth, req.Email, req.Ex, req.Gender) - if err != nil { - log.Error(req.Token, req.OperationID, "update user some attribute failed,err=%s", err.Error()) - return &pbUser.CommonResp{ErrorCode: config.ErrModifyUserInfo.ErrCode, ErrorMsg: config.ErrModifyUserInfo.ErrMsg}, nil - } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) - client := pbFriend.NewFriendClient(etcdConn) - newReq := &pbFriend.GetFriendListReq{ - OperationID: req.OperationID, - Token: req.Token, - } - - RpcResp, err := client.GetFriendList(context.Background(), newReq) - if err != nil { - log.ErrorByKv("get friend list rpc server failed", req.OperationID, "err", err.Error(), "req", req.String()) - return &pbUser.CommonResp{}, nil - } - if RpcResp.ErrorCode != 0 { - log.ErrorByKv("get friend list rpc server failed", req.OperationID, "err", err.Error(), "req", req.String()) - return &pbUser.CommonResp{}, nil - } - self, err := im_mysql_model.FindUserByUID(ownerUid) - if err != nil { - log.ErrorByKv("get self info failed", req.OperationID, "err", err.Error(), "req", req.String()) - return &pbUser.CommonResp{}, nil - } - var name, faceUrl string - if self != nil { - name, faceUrl = self.Name, self.Icon - } - for _, v := range RpcResp.Data { - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: ownerUid, - RecvID: v.Uid, - SenderNickName: name, - SenderFaceURL: faceUrl, - Content: ownerUid + "'s info has changed", - SendTime: utils.GetCurrentTimestampByNano(), - MsgFrom: constant.SysMsgType, - ContentType: constant.SetSelfInfoTip, - SessionType: constant.SingleChatType, - OperationID: req.OperationID, - Token: req.Token, - }) - - } - return &pbUser.CommonResp{}, nil -} diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go new file mode 100644 index 000000000..b0ebf593a --- /dev/null +++ b/internal/rpc/user/user.go @@ -0,0 +1,459 @@ +package user + +import ( + chat "Open_IM/internal/rpc/msg" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + errors "Open_IM/pkg/common/http" + + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" + sdkws "Open_IM/pkg/proto/sdk_ws" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "fmt" + "net" + "strconv" + "strings" + + "google.golang.org/grpc" +) + +type userServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewUserServer(port int) *userServer { + log.NewPrivateLog("user") + return &userServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImUserName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *userServer) Run() { + log.NewInfo("0", "", "rpc user start...") + + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "listen network failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, address ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbUser.RegisterUserServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "rpc user success") +} + +func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) { + log.NewInfo(req.OperationID, "GetUserInfo args ", req.String()) + var userInfoList []*sdkws.UserInfo + if len(req.UserIDList) > 0 { + for _, userID := range req.UserIDList { + var userInfo sdkws.UserInfo + user, err := imdb.GetUserByUserID(userID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), userID) + continue + } + utils.CopyStructFields(&userInfo, user) + userInfo.Birth = uint32(user.Birth.Unix()) + userInfoList = append(userInfoList, &userInfo) + } + } else { + + return &pbUser.GetUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}}, nil + } + log.NewInfo(req.OperationID, "GetUserInfo rpc return ", pbUser.GetUserInfoResp{CommonResp: &pbUser.CommonResp{}, UserInfoList: userInfoList}) + return &pbUser.GetUserInfoResp{CommonResp: &pbUser.CommonResp{}, UserInfoList: userInfoList}, nil +} + +func (s *userServer) SetReceiveMessageOpt(ctx context.Context, req *pbUser.SetReceiveMessageOptReq) (*pbUser.SetReceiveMessageOptResp, error) { + log.NewInfo(req.OperationID, "SetReceiveMessageOpt args ", req.String()) + m := make(map[string]int, len(req.ConversationIDList)) + for _, v := range req.ConversationIDList { + m[v] = int(req.Opt) + } + err := db.DB.SetMultiConversationMsgOpt(req.FromUserID, m) + if err != nil { + log.NewError(req.OperationID, "SetMultiConversationMsgOpt failed ", err.Error(), req) + return &pbUser.SetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + resp := pbUser.SetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{}} + + for _, v := range req.ConversationIDList { + resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: v, Result: req.Opt}) + } + chat.SetReceiveMessageOptNotification(req.OperationID, req.OpUserID, req.FromUserID) + log.NewInfo(req.OperationID, "SetReceiveMessageOpt rpc return ", resp.String()) + return &resp, nil +} + +func (s *userServer) GetReceiveMessageOpt(ctx context.Context, req *pbUser.GetReceiveMessageOptReq) (*pbUser.GetReceiveMessageOptResp, error) { + log.NewInfo(req.OperationID, "GetReceiveMessageOpt args ", req.String()) + m, err := db.DB.GetMultiConversationMsgOpt(req.FromUserID, req.ConversationIDList) + if err != nil { + log.NewError(req.OperationID, "GetMultiConversationMsgOpt failed ", err.Error(), req.FromUserID, req.ConversationIDList) + return &pbUser.GetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + resp := pbUser.GetReceiveMessageOptResp{CommonResp: &pbUser.CommonResp{}} + for k, v := range m { + resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: k, Result: int32(v)}) + } + log.NewInfo(req.OperationID, "GetReceiveMessageOpt rpc return ", resp.String()) + return &resp, nil +} + +func (s *userServer) GetAllConversationMsgOpt(ctx context.Context, req *pbUser.GetAllConversationMsgOptReq) (*pbUser.GetAllConversationMsgOptResp, error) { + log.NewInfo(req.OperationID, "GetAllConversationMsgOpt args ", req.String()) + m, err := db.DB.GetAllConversationMsgOpt(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GetAllConversationMsgOpt failed ", err.Error(), req.FromUserID) + return &pbUser.GetAllConversationMsgOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + resp := pbUser.GetAllConversationMsgOptResp{CommonResp: &pbUser.CommonResp{}} + for k, v := range m { + resp.ConversationOptResultList = append(resp.ConversationOptResultList, &pbUser.OptResult{ConversationID: k, Result: int32(v)}) + } + log.NewInfo(req.OperationID, "GetAllConversationMsgOpt rpc return ", resp.String()) + return &resp, nil +} +func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq) (*pbUser.DeleteUsersResp, error) { + log.NewInfo(req.OperationID, "DeleteUsers args ", req.String()) + if !token_verify.IsMangerUserID(req.OpUserID) { + log.NewError(req.OperationID, "IsMangerUserID false ", req.OpUserID) + return &pbUser.DeleteUsersResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, FailedUserIDList: req.DeleteUserIDList}, nil + } + var common pbUser.CommonResp + resp := pbUser.DeleteUsersResp{CommonResp: &common} + for _, userID := range req.DeleteUserIDList { + i := imdb.DeleteUser(userID) + if i == 0 { + log.NewError(req.OperationID, "delete user error", userID) + common.ErrCode = 201 + common.ErrMsg = "some uid deleted failed" + resp.FailedUserIDList = append(resp.FailedUserIDList, userID) + } + } + log.NewInfo(req.OperationID, "DeleteUsers rpc return ", resp.String()) + return &resp, nil +} + +func (s *userServer) GetAllUserID(_ context.Context, req *pbUser.GetAllUserIDReq) (*pbUser.GetAllUserIDResp, error) { + log.NewInfo(req.OperationID, "GetAllUserID args ", req.String()) + if !token_verify.IsMangerUserID(req.OpUserID) { + log.NewError(req.OperationID, "IsMangerUserID false ", req.OpUserID) + return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + uidList, err := imdb.SelectAllUserID() + if err != nil { + log.NewError(req.OperationID, "SelectAllUserID false ", err.Error()) + return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } else { + log.NewInfo(req.OperationID, "GetAllUserID rpc return ", pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{}, UserIDList: uidList}) + return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{}, UserIDList: uidList}, nil + } +} + +func (s *userServer) AccountCheck(_ context.Context, req *pbUser.AccountCheckReq) (*pbUser.AccountCheckResp, error) { + log.NewInfo(req.OperationID, "AccountCheck args ", req.String()) + if !token_verify.IsMangerUserID(req.OpUserID) { + log.NewError(req.OperationID, "IsMangerUserID false ", req.OpUserID) + return &pbUser.AccountCheckResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + uidList, err := imdb.SelectSomeUserID(req.CheckUserIDList) + log.NewDebug(req.OperationID, "from db uid list is:", uidList) + if err != nil { + log.NewError(req.OperationID, "SelectSomeUserID failed ", err.Error(), req.CheckUserIDList) + return &pbUser.AccountCheckResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } else { + var r []*pbUser.AccountCheckResp_SingleUserStatus + for _, v := range req.CheckUserIDList { + temp := new(pbUser.AccountCheckResp_SingleUserStatus) + temp.UserID = v + if utils.IsContain(v, uidList) { + temp.AccountStatus = constant.Registered + } else { + temp.AccountStatus = constant.UnRegistered + } + r = append(r, temp) + } + resp := pbUser.AccountCheckResp{CommonResp: &pbUser.CommonResp{ErrCode: 0, ErrMsg: ""}, ResultList: r} + log.NewInfo(req.OperationID, "AccountCheck rpc return ", resp.String()) + return &resp, nil + } + +} + +func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserInfoReq) (*pbUser.UpdateUserInfoResp, error) { + log.NewInfo(req.OperationID, "UpdateUserInfo args ", req.String()) + if !token_verify.CheckAccess(req.OpUserID, req.UserInfo.UserID) { + log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.UserInfo.UserID) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + var user db.User + utils.CopyStructFields(&user, req.UserInfo) + if req.UserInfo.Birth != 0 { + user.Birth = utils.UnixSecondToTime(int64(req.UserInfo.Birth)) + } + err := imdb.UpdateUserInfo(user) + if err != nil { + log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), user) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := pbFriend.NewFriendClient(etcdConn) + newReq := &pbFriend.GetFriendListReq{ + CommID: &pbFriend.CommID{OperationID: req.OperationID, FromUserID: req.UserInfo.UserID, OpUserID: req.OpUserID}, + } + + RpcResp, err := client.GetFriendList(context.Background(), newReq) + if err != nil { + log.NewError(req.OperationID, "GetFriendList failed ", err.Error(), newReq) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil + } + for _, v := range RpcResp.FriendInfoList { + log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, v.FriendUser.UserID) + chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID) + } + chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, req.OpUserID) + log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil +} + +func (s *userServer) GetUsersByName(ctx context.Context, req *pbUser.GetUsersByNameReq) (*pbUser.GetUsersByNameResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) + resp := &pbUser.GetUsersByNameResp{} + users, err := imdb.GetUserByName(req.UserName, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByName failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, user := range users { + isBlock, err := imdb.UserIsBlock(user.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + continue + } + resp.Users = append(resp.Users, &pbUser.User{ + ProfilePhoto: user.FaceURL, + Nickname: user.Nickname, + UserId: user.UserID, + CreateTime: user.CreateTime.String(), + IsBlock: isBlock, + }) + } + user := db.User{Nickname: req.UserName} + userNums, err := imdb.GetUsersCount(user) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.UserNums = userNums + resp.Pagination = &sdkws.ResponsePagination{ + CurrentPage: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + return resp, nil +} + +func (s *userServer) GetUserById(ctx context.Context, req *pbUser.GetUserByIdReq) (*pbUser.GetUserByIdResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) + resp := &pbUser.GetUserByIdResp{User: &pbUser.User{}} + user, err := imdb.GetUserByUserID(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + return resp, errors.WrapError(constant.ErrDB) + } + isBlock, err := imdb.UserIsBlock(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.User = &pbUser.User{ + ProfilePhoto: user.FaceURL, + Nickname: user.Nickname, + UserId: user.UserID, + CreateTime: user.CreateTime.String(), + IsBlock: isBlock, + } + return resp, nil +} + +func (s *userServer) GetUsers(ctx context.Context, req *pbUser.GetUsersReq) (*pbUser.GetUsersResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbUser.GetUsersResp{User: []*pbUser.User{}} + users, err := imdb.GetUsers(req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + return resp, errors.WrapError(constant.ErrDB) + } + for _, v := range users { + isBlock, err := imdb.UserIsBlock(v.UserID) + if err == nil { + user := &pbUser.User{ + ProfilePhoto: v.FaceURL, + UserId: v.UserID, + CreateTime: v.CreateTime.String(), + Nickname: v.Nickname, + IsBlock: isBlock, + } + resp.User = append(resp.User, user) + } + } + user := db.User{} + nums, err := imdb.GetUsersCount(user) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUsersCount failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.UserNums = nums + resp.Pagination = &sdkws.ResponsePagination{ShowNumber: req.Pagination.ShowNumber, CurrentPage: req.Pagination.PageNumber} + return resp, nil +} + +func (s *userServer) ResignUser(ctx context.Context, req *pbUser.ResignUserReq) (*pbUser.ResignUserResp, error) { + log.NewInfo(req.OperationID, "ResignUser args ", req.String()) + return &pbUser.ResignUserResp{}, nil +} + +func (s *userServer) AlterUser(ctx context.Context, req *pbUser.AlterUserReq) (*pbUser.AlterUserResp, error) { + log.NewInfo(req.OperationID, "AlterUser args ", req.String()) + resp := &pbUser.AlterUserResp{} + user := db.User{ + PhoneNumber: strconv.FormatInt(req.PhoneNumber, 10), + Nickname: req.Nickname, + Email: req.Email, + UserID: req.UserId, + } + if err := imdb.UpdateUserInfo(user); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateUserInfo", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + chat.UserInfoUpdatedNotification(req.OperationID, req.UserId, req.OpUserId) + return resp, nil +} + +func (s *userServer) AddUser(ctx context.Context, req *pbUser.AddUserReq) (*pbUser.AddUserResp, error) { + log.NewInfo(req.OperationID, "AddUser args ", req.String()) + resp := &pbUser.AddUserResp{} + err := imdb.AddUser(req.UserId, req.PhoneNumber, req.Name) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "AddUser", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *userServer) BlockUser(ctx context.Context, req *pbUser.BlockUserReq) (*pbUser.BlockUserResp, error) { + log.NewInfo(req.OperationID, "BlockUser args ", req.String()) + fmt.Println("BlockUser args ", req.String()) + resp := &pbUser.BlockUserResp{} + err := imdb.BlockUser(req.UserId, req.EndDisableTime) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "BlockUser", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *userServer) UnBlockUser(ctx context.Context, req *pbUser.UnBlockUserReq) (*pbUser.UnBlockUserResp, error) { + log.NewInfo(req.OperationID, "UnBlockUser args ", req.String()) + resp := &pbUser.UnBlockUserResp{} + err := imdb.UnBlockUser(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "unBlockUser", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *userServer) GetBlockUsers(ctx context.Context, req *pbUser.GetBlockUsersReq) (*pbUser.GetBlockUsersResp, error) { + log.NewInfo(req.OperationID, "GetBlockUsers args ", req.String()) + resp := &pbUser.GetBlockUsersResp{} + blockUsers, err := imdb.GetBlockUsers(req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.Error(req.OperationID, utils.GetSelfFuncName(), "GetBlockUsers", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, v := range blockUsers { + resp.BlockUsers = append(resp.BlockUsers, &pbUser.BlockUser{ + User: &pbUser.User{ + ProfilePhoto: v.User.FaceURL, + Nickname: v.User.Nickname, + UserId: v.User.UserID, + IsBlock: true, + }, + BeginDisableTime: (v.BeginDisableTime).String(), + EndDisableTime: (v.EndDisableTime).String(), + }) + } + resp.Pagination = &sdkws.ResponsePagination{} + resp.Pagination.ShowNumber = req.Pagination.ShowNumber + resp.Pagination.CurrentPage = req.Pagination.PageNumber + nums, err := imdb.GetBlockUsersNumCount() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetBlockUsersNumCount failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.UserNums = nums + return resp, nil +} + +func (s *userServer) GetBlockUserById(_ context.Context, req *pbUser.GetBlockUserByIdReq) (*pbUser.GetBlockUserByIdResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetBlockUserById args ", req.String()) + resp := &pbUser.GetBlockUserByIdResp{} + user, err := imdb.GetBlockUserById(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetBlockUserById", err) + return resp, errors.WrapError(constant.ErrDB) + } + resp.BlockUser = &pbUser.BlockUser{ + User: &pbUser.User{ + ProfilePhoto: user.User.FaceURL, + Nickname: user.User.Nickname, + UserId: user.User.UserID, + IsBlock: true, + }, + BeginDisableTime: (user.BeginDisableTime).String(), + EndDisableTime: (user.EndDisableTime).String(), + } + return resp, nil +} + +func (s *userServer) DeleteUser(_ context.Context, req *pbUser.DeleteUserReq) (*pbUser.DeleteUserResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbUser.DeleteUserResp{} + if row := imdb.DeleteUser(req.UserId); row == 0 { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "delete failed", "delete rows:", row) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} diff --git a/internal/timed_task/timed_task.go b/internal/timed_task/timed_task.go index bda907ea7..5b0264123 100644 --- a/internal/timed_task/timed_task.go +++ b/internal/timed_task/timed_task.go @@ -17,7 +17,7 @@ func (t *TimeTask) timedDeleteUserChat() { for i := 0; i < count; i++ { time.Sleep(10 * time.Millisecond) uid, _ := db.DB.MgoSkipUID(i) - db.DB.DelUserChat(uid) + db.DB.DelUserChatMongo2(uid) } go func() { diff --git a/internal/utils/callback.go b/internal/utils/callback.go new file mode 100644 index 000000000..d4b585bf7 --- /dev/null +++ b/internal/utils/callback.go @@ -0,0 +1 @@ +package utils diff --git a/internal/utils/jwt_token_test.go b/internal/utils/jwt_token_test.go index 5b8cdb607..571836d39 100644 --- a/internal/utils/jwt_token_test.go +++ b/internal/utils/jwt_token_test.go @@ -2,7 +2,8 @@ package utils import ( "Open_IM/pkg/common/config" - "Open_IM/pkg/utils" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/token_verify" "testing" "time" @@ -13,7 +14,7 @@ func Test_BuildClaims(t *testing.T) { uid := "1" platform := "PC" ttl := int64(-1) - claim := utils.BuildClaims(uid, platform, ttl) + claim := token_verify.BuildClaims(uid, platform, ttl) now := time.Now().Unix() assert.Equal(t, claim.UID, uid, "uid should equal") @@ -25,7 +26,7 @@ func Test_BuildClaims(t *testing.T) { ttl = int64(60) now = time.Now().Unix() - claim = utils.BuildClaims(uid, platform, ttl) + claim = token_verify.BuildClaims(uid, platform, ttl) // time difference within 1s assert.Equal(t, claim.RegisteredClaims.ExpiresAt, int64(60)+now, "StandardClaims.ExpiresAt should be equal") assert.Equal(t, claim.RegisteredClaims.IssuedAt, now, "StandardClaims.IssuedAt should be equal") @@ -37,7 +38,7 @@ func Test_CreateToken(t *testing.T) { platform := int32(1) now := time.Now().Unix() - tokenString, expiresAt, err := utils.CreateToken(uid, platform) + tokenString, expiresAt, err := token_verify.CreateToken(uid, platform) assert.NotEmpty(t, tokenString) assert.Equal(t, expiresAt, 604800+now) @@ -47,36 +48,42 @@ func Test_CreateToken(t *testing.T) { func Test_VerifyToken(t *testing.T) { uid := "1" platform := int32(1) - tokenString, _, _ := utils.CreateToken(uid, platform) - result := utils.VerifyToken(tokenString, uid) + tokenString, _, _ := token_verify.CreateToken(uid, platform) + result, _ := token_verify.VerifyToken(tokenString, uid) assert.True(t, result) - result = utils.VerifyToken(tokenString, "2") + result, _ = token_verify.VerifyToken(tokenString, "2") assert.False(t, result) } func Test_ParseRedisInterfaceToken(t *testing.T) { uid := "1" platform := int32(1) - tokenString, _, _ := utils.CreateToken(uid, platform) + tokenString, _, _ := token_verify.CreateToken(uid, platform) - claims, err := utils.ParseRedisInterfaceToken([]uint8(tokenString)) + claims, err := token_verify.ParseRedisInterfaceToken([]uint8(tokenString)) assert.Nil(t, err) assert.Equal(t, claims.UID, uid) // timeout config.Config.TokenPolicy.AccessExpire = -80 - tokenString, _, _ = utils.CreateToken(uid, platform) - claims, err = utils.ParseRedisInterfaceToken([]uint8(tokenString)) - assert.Equal(t, err, utils.TokenExpired) + tokenString, _, _ = token_verify.CreateToken(uid, platform) + claims, err = token_verify.ParseRedisInterfaceToken([]uint8(tokenString)) + assert.Equal(t, err, constant.ExpiredToken) assert.Nil(t, claims) } func Test_ParseToken(t *testing.T) { uid := "1" platform := int32(1) - tokenString, _, _ := utils.CreateToken(uid, platform) - claims, err := utils.ParseToken(tokenString) + tokenString, _, _ := token_verify.CreateToken(uid, platform) + claims, err := token_verify.ParseToken(tokenString) if err == nil { assert.Equal(t, claims.UID, uid) } } +func Test_GetClaimFromToken(t *testing.T) { + token := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVSUQiOiJvcGVuSU0xMjM0NTYiLCJQbGF0Zm9ybSI6IiIsImV4cCI6MTYzODg0NjQ3NiwibmJmIjoxNjM4MjQxNjc2LCJpYXQiOjE2MzgyNDE2NzZ9.W8RZB7ec5ySFj-rGE2Aho2z32g3MprQMdCyPiQu_C2I" + c, err := token_verify.GetClaimFromToken(token) + assert.Nil(t, c) + assert.Nil(t, err) +} diff --git a/internal/utils/platform_number_id_to_name_test.go b/internal/utils/platform_number_id_to_name_test.go index 9fd888f44..8a956bfac 100644 --- a/internal/utils/platform_number_id_to_name_test.go +++ b/internal/utils/platform_number_id_to_name_test.go @@ -1,46 +1,46 @@ package utils import ( - "Open_IM/pkg/utils" + "Open_IM/pkg/common/constant" "testing" "github.com/stretchr/testify/assert" ) func Test_PlatformIDToName(t *testing.T) { - assert.Equal(t, utils.PlatformIDToName(1), "IOS") - assert.Equal(t, utils.PlatformIDToName(2), "Android") - assert.Equal(t, utils.PlatformIDToName(3), "Windows") - assert.Equal(t, utils.PlatformIDToName(4), "OSX") - assert.Equal(t, utils.PlatformIDToName(5), "Web") - assert.Equal(t, utils.PlatformIDToName(6), "MiniWeb") - assert.Equal(t, utils.PlatformIDToName(7), "Linux") + assert.Equal(t, constant.PlatformIDToName(1), "IOS") + assert.Equal(t, constant.PlatformIDToName(2), "Android") + assert.Equal(t, constant.PlatformIDToName(3), "Windows") + assert.Equal(t, constant.PlatformIDToName(4), "OSX") + assert.Equal(t, constant.PlatformIDToName(5), "Web") + assert.Equal(t, constant.PlatformIDToName(6), "MiniWeb") + assert.Equal(t, constant.PlatformIDToName(7), "Linux") - assert.Equal(t, utils.PlatformIDToName(0), "") + assert.Equal(t, constant.PlatformIDToName(0), "") } func Test_PlatformNameToID(t *testing.T) { - assert.Equal(t, utils.PlatformNameToID("IOS"), int32(1)) - assert.Equal(t, utils.PlatformNameToID("Android"), int32(2)) - assert.Equal(t, utils.PlatformNameToID("Windows"), int32(3)) - assert.Equal(t, utils.PlatformNameToID("OSX"), int32(4)) - assert.Equal(t, utils.PlatformNameToID("Web"), int32(5)) - assert.Equal(t, utils.PlatformNameToID("MiniWeb"), int32(6)) - assert.Equal(t, utils.PlatformNameToID("Linux"), int32(7)) + assert.Equal(t, constant.PlatformNameToID("IOS"), int32(1)) + assert.Equal(t, constant.PlatformNameToID("Android"), int32(2)) + assert.Equal(t, constant.PlatformNameToID("Windows"), int32(3)) + assert.Equal(t, constant.PlatformNameToID("OSX"), int32(4)) + assert.Equal(t, constant.PlatformNameToID("Web"), int32(5)) + assert.Equal(t, constant.PlatformNameToID("MiniWeb"), int32(6)) + assert.Equal(t, constant.PlatformNameToID("Linux"), int32(7)) - assert.Equal(t, utils.PlatformNameToID("UnknownDevice"), int32(0)) - assert.Equal(t, utils.PlatformNameToID(""), int32(0)) + assert.Equal(t, constant.PlatformNameToID("UnknownDevice"), int32(0)) + assert.Equal(t, constant.PlatformNameToID(""), int32(0)) } func Test_PlatformNameToClass(t *testing.T) { - assert.Equal(t, utils.PlatformNameToClass("IOS"), "Mobile") - assert.Equal(t, utils.PlatformNameToClass("Android"), "Mobile") - assert.Equal(t, utils.PlatformNameToClass("OSX"), "PC") - assert.Equal(t, utils.PlatformNameToClass("Windows"), "PC") - assert.Equal(t, utils.PlatformNameToClass("Web"), "PC") - assert.Equal(t, utils.PlatformNameToClass("MiniWeb"), "Mobile") - assert.Equal(t, utils.PlatformNameToClass("Linux"), "PC") + assert.Equal(t, constant.PlatformNameToClass("IOS"), "Mobile") + assert.Equal(t, constant.PlatformNameToClass("Android"), "Mobile") + assert.Equal(t, constant.PlatformNameToClass("OSX"), "PC") + assert.Equal(t, constant.PlatformNameToClass("Windows"), "PC") + assert.Equal(t, constant.PlatformNameToClass("Web"), "PC") + assert.Equal(t, constant.PlatformNameToClass("MiniWeb"), "Mobile") + assert.Equal(t, constant.PlatformNameToClass("Linux"), "PC") - assert.Equal(t, utils.PlatformNameToClass("UnknownDevice"), "") - assert.Equal(t, utils.PlatformNameToClass(""), "") + assert.Equal(t, constant.PlatformNameToClass("UnknownDevice"), "") + assert.Equal(t, constant.PlatformNameToClass(""), "") } diff --git a/internal/utils/utils.go b/internal/utils/utils.go new file mode 100644 index 000000000..73ebbf127 --- /dev/null +++ b/internal/utils/utils.go @@ -0,0 +1,49 @@ +package utils + +import ( + "encoding/json" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "reflect" +) + +func JsonDataList(resp interface{}) []map[string]interface{} { + var list []proto.Message + if reflect.TypeOf(resp).Kind() == reflect.Slice { + s := reflect.ValueOf(resp) + for i := 0; i < s.Len(); i++ { + ele := s.Index(i) + list = append(list, ele.Interface().(proto.Message)) + } + } + + result := make([]map[string]interface{}, 0) + for _, v := range list { + m := ProtoToMap(v, false) + result = append(result, m) + } + return result +} + +func JsonDataOne(pb proto.Message) map[string]interface{} { + return ProtoToMap(pb, false) +} + +func ProtoToMap(pb proto.Message, idFix bool) map[string]interface{} { + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + + s, _ := marshaler.MarshalToString(pb) + out := make(map[string]interface{}) + json.Unmarshal([]byte(s), &out) + if idFix { + if _, ok := out["id"]; ok { + out["_id"] = out["id"] + delete(out, "id") + } + } + return out +} diff --git a/pkg/base_info/auth_api_struct.go b/pkg/base_info/auth_api_struct.go new file mode 100644 index 000000000..13d6e140b --- /dev/null +++ b/pkg/base_info/auth_api_struct.go @@ -0,0 +1,39 @@ +package base_info + +//UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` +// Nickname string `protobuf:"bytes,2,opt,name=Nickname" json:"Nickname,omitempty"` +// FaceUrl string `protobuf:"bytes,3,opt,name=FaceUrl" json:"FaceUrl,omitempty"` +// Gender int32 `protobuf:"varint,4,opt,name=Gender" json:"Gender,omitempty"` +// PhoneNumber string `protobuf:"bytes,5,opt,name=PhoneNumber" json:"PhoneNumber,omitempty"` +// Birth string `protobuf:"bytes,6,opt,name=Birth" json:"Birth,omitempty"` +// Email string `protobuf:"bytes,7,opt,name=Email" json:"Email,omitempty"` +// Ex string `protobuf:"bytes,8,opt,name=Ex" json:"Ex,omitempty"` + +type UserRegisterReq struct { + Secret string `json:"secret" binding:"required,max=32"` + Platform int32 `json:"platform" binding:"required,min=1,max=7"` + ApiUserInfo + OperationID string `json:"operationID" binding:"required"` +} + +type UserTokenInfo struct { + UserID string `json:"userID"` + Token string `json:"token"` + ExpiredTime int64 `json:"expiredTime"` +} +type UserRegisterResp struct { + CommResp + UserToken UserTokenInfo `json:"data"` +} + +type UserTokenReq struct { + Secret string `json:"secret" binding:"required,max=32"` + Platform int32 `json:"platform" binding:"required,min=1,max=8"` + UserID string `json:"userID" binding:"required,min=1,max=64"` + OperationID string `json:"operationID" binding:"required"` +} + +type UserTokenResp struct { + CommResp + UserToken UserTokenInfo `json:"data"` +} diff --git a/pkg/base_info/conversation_api_struct.go b/pkg/base_info/conversation_api_struct.go new file mode 100644 index 000000000..95aa8527f --- /dev/null +++ b/pkg/base_info/conversation_api_struct.go @@ -0,0 +1,48 @@ +package base_info + +type OptResult struct { + ConversationID string `json:"conversationID"` + Result *int32 `json:"result"` +} +type GetAllConversationMessageOptReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetAllConversationMessageOptResp struct { + CommResp + ConversationOptResultList []*OptResult `json:"data"` +} +type GetReceiveMessageOptReq struct { + ConversationIDList []string `json:"conversationIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetReceiveMessageOptResp struct { + CommResp + ConversationOptResultList []*OptResult `json:"data"` +} +type SetReceiveMessageOptReq struct { + FromUserID string `json:"fromUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + Opt *int32 `json:"opt" binding:"required"` + ConversationIDList []string `json:"conversationIDList" binding:"required"` +} +type SetReceiveMessageOptResp struct { + CommResp + ConversationOptResultList []*OptResult `json:"data"` +} + +//type Conversation struct { +// OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"` +// ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"` +// ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"` +// UserID string `gorm:"column:user_id;type:char(64)" json:"userID"` +// GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"` +// RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"` +// UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"` +// DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"` +// IsPinned bool `gorm:"column:is_pinned" json:"isPinned"` +// AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"` +// Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +//} + diff --git a/pkg/base_info/cos_api_struct.go b/pkg/base_info/cos_api_struct.go new file mode 100644 index 000000000..e35931ad9 --- /dev/null +++ b/pkg/base_info/cos_api_struct.go @@ -0,0 +1,20 @@ +package base_info + +import sts "github.com/tencentyun/qcloud-cos-sts-sdk/go" + +type TencentCloudStorageCredentialReq struct { + OperationID string `json:"operationID"` +} + +type TencentCloudStorageCredentialRespData struct { + *sts.CredentialResult + Region string `json:"region"` + Bucket string `json:"bucket"` +} + +type TencentCloudStorageCredentialResp struct { + CommResp + CosData TencentCloudStorageCredentialRespData `json:"-"` + + Data map[string]interface{} `json:"data"` +} diff --git a/pkg/base_info/friend_api_struct.go b/pkg/base_info/friend_api_struct.go new file mode 100644 index 000000000..3c45c393e --- /dev/null +++ b/pkg/base_info/friend_api_struct.go @@ -0,0 +1,136 @@ +package base_info + +import open_im_sdk "Open_IM/pkg/proto/sdk_ws" + +type ParamsCommFriend struct { + OperationID string `json:"operationID" binding:"required"` + ToUserID string `json:"toUserID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} + +type AddBlacklistReq struct { + ParamsCommFriend +} +type AddBlacklistResp struct { + CommResp +} + +type ImportFriendReq struct { + FriendUserIDList []string `json:"friendUserIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type UserIDResult struct { + UserID string `json:"userID"` + Result int32 `json:"result"` +} +type ImportFriendResp struct { + CommResp + UserIDResultList []UserIDResult `json:"data"` +} + +type AddFriendReq struct { + ParamsCommFriend + ReqMsg string `json:"reqMsg"` +} +type AddFriendResp struct { + CommResp +} + +type AddFriendResponseReq struct { + ParamsCommFriend + Flag int32 `json:"flag" binding:"required,oneof=-1 0 1"` + HandleMsg string `json:"handleMsg"` +} +type AddFriendResponseResp struct { + CommResp +} + +type DeleteFriendReq struct { + ParamsCommFriend +} +type DeleteFriendResp struct { + CommResp +} + +type GetBlackListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetBlackListResp struct { + CommResp + BlackUserInfoList []*open_im_sdk.PublicUserInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +//type PublicUserInfo struct { +// UserID string `json:"userID"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// Gender int32 `json:"gender"` +//} + +type SetFriendRemarkReq struct { + ParamsCommFriend + Remark string `json:"remark" binding:"required"` +} +type SetFriendRemarkResp struct { + CommResp +} + +type RemoveBlackListReq struct { + ParamsCommFriend +} +type RemoveBlackListResp struct { + CommResp +} + +type IsFriendReq struct { + ParamsCommFriend +} +type Response struct { + Friend bool `json:"isFriend"` +} +type IsFriendResp struct { + CommResp + Response Response `json:"data"` +} + +type GetFriendsInfoReq struct { + ParamsCommFriend +} +type GetFriendsInfoResp struct { + CommResp + FriendInfoList []*open_im_sdk.FriendInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetFriendListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetFriendListResp struct { + CommResp + FriendInfoList []*open_im_sdk.FriendInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetFriendApplyListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetFriendApplyListResp struct { + CommResp + FriendRequestList []*open_im_sdk.FriendRequest `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetSelfApplyListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetSelfApplyListResp struct { + CommResp + FriendRequestList []*open_im_sdk.FriendRequest `json:"-"` + Data []map[string]interface{} `json:"data"` +} diff --git a/pkg/base_info/group_api_struct.go b/pkg/base_info/group_api_struct.go new file mode 100644 index 000000000..6dc9668c6 --- /dev/null +++ b/pkg/base_info/group_api_struct.go @@ -0,0 +1,179 @@ +package base_info + +import ( + open_im_sdk "Open_IM/pkg/proto/sdk_ws" +) + +type CommResp struct { + ErrCode int32 `json:"errCode"` + ErrMsg string `json:"errMsg"` +} + +type CommDataResp struct { + CommResp + Data []map[string]interface{} `json:"data"` +} + +type KickGroupMemberReq struct { + GroupID string `json:"groupID" binding:"required"` + KickedUserIDList []string `json:"kickedUserIDList" binding:"required"` + Reason string `json:"reason"` + OperationID string `json:"operationID" binding:"required"` +} +type KickGroupMemberResp struct { + CommResp + UserIDResultList []*UserIDResult `json:"data"` +} + +type GetGroupMembersInfoReq struct { + GroupID string `json:"groupID" binding:"required"` + MemberList []string `json:"memberList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type GetGroupMembersInfoResp struct { + CommResp + MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type InviteUserToGroupReq struct { + GroupID string `json:"groupID" binding:"required"` + InvitedUserIDList []string `json:"invitedUserIDList" binding:"required"` + Reason string `json:"reason"` + OperationID string `json:"operationID" binding:"required"` +} +type InviteUserToGroupResp struct { + CommResp + UserIDResultList []*UserIDResult `json:"data"` +} + +type GetJoinedGroupListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetJoinedGroupListResp struct { + CommResp + GroupInfoList []*open_im_sdk.GroupInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetGroupMemberListReq struct { + GroupID string `json:"groupID"` + Filter int32 `json:"filter"` + NextSeq int32 `json:"nextSeq"` + OperationID string `json:"operationID"` +} +type GetGroupMemberListResp struct { + CommResp + NextSeq int32 `json:"nextSeq"` + MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetGroupAllMemberReq struct { + GroupID string `json:"groupID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type GetGroupAllMemberResp struct { + CommResp + MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type CreateGroupReq struct { + MemberList []*GroupAddMemberInfo `json:"memberList" binding:"required"` + OwnerUserID string `json:"ownerUserID" binding:"required"` + GroupType int32 `json:"groupType"` + GroupName string `json:"groupName"` + Notification string `json:"notification"` + Introduction string `json:"introduction"` + FaceURL string `json:"faceURL"` + Ex string `json:"ex"` + OperationID string `json:"operationID" binding:"required"` +} +type CreateGroupResp struct { + CommResp + GroupInfo open_im_sdk.GroupInfo `json:"-"` + Data map[string]interface{} `json:"data"` +} + +type GetGroupApplicationListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` //作为管理员或群主收到的 进群申请 +} +type GetGroupApplicationListResp struct { + CommResp + GroupRequestList []*open_im_sdk.GroupRequest `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetUserReqGroupApplicationListReq struct { + OperationID string `json:"operationID" binding:"required"` + UserID string `json:"userID" binding:"required"` +} + +type GetUserRespGroupApplicationResp struct { + CommResp + GroupRequestList []*open_im_sdk.GroupRequest `json:"-"` +} + +type GetGroupInfoReq struct { + GroupIDList []string `json:"groupIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type GetGroupInfoResp struct { + CommResp + GroupInfoList []*open_im_sdk.GroupInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type ApplicationGroupResponseReq struct { + OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` //application from FromUserID + HandledMsg string `json:"handledMsg"` + HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"` +} +type ApplicationGroupResponseResp struct { + CommResp +} + +type JoinGroupReq struct { + GroupID string `json:"groupID" binding:"required"` + ReqMessage string `json:"reqMessage"` + OperationID string `json:"operationID" binding:"required"` +} +type JoinGroupResp struct { + CommResp +} + +type QuitGroupReq struct { + GroupID string `json:"groupID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type QuitGroupResp struct { + CommResp +} + +type SetGroupInfoReq struct { + GroupID string `json:"groupID" binding:"required"` + GroupName string `json:"groupName"` + Notification string `json:"notification"` + Introduction string `json:"introduction"` + FaceURL string `json:"faceURL"` + Ex string `json:"ex"` + OperationID string `json:"operationID" binding:"required"` +} +type SetGroupInfoResp struct { + CommResp +} + +type TransferGroupOwnerReq struct { + GroupID string `json:"groupID" binding:"required"` + OldOwnerUserID string `json:"oldOwnerUserID" binding:"required"` + NewOwnerUserID string `json:"newOwnerUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type TransferGroupOwnerResp struct { + CommResp +} diff --git a/pkg/base_info/manage_api_struct.go b/pkg/base_info/manage_api_struct.go new file mode 100644 index 000000000..4b2061b57 --- /dev/null +++ b/pkg/base_info/manage_api_struct.go @@ -0,0 +1,44 @@ +package base_info + +import ( + pbRelay "Open_IM/pkg/proto/relay" + "Open_IM/pkg/proto/sdk_ws" + pbUser "Open_IM/pkg/proto/user" +) + +type DeleteUsersReq struct { + OperationID string `json:"operationID" binding:"required"` + DeleteUserIDList []string `json:"deleteUserIDList" binding:"required"` +} +type DeleteUsersResp struct { + CommResp + FailedUserIDList []string `json:"data"` +} +type GetAllUsersUidReq struct { + OperationID string `json:"operationID" binding:"required"` +} +type GetAllUsersUidResp struct { + CommResp + UserIDList []string `json:"data"` +} +type GetUsersOnlineStatusReq struct { + OperationID string `json:"operationID" binding:"required"` + UserIDList []string `json:"userIDList" binding:"required,lte=200"` +} +type GetUsersOnlineStatusResp struct { + CommResp + SuccessResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult `json:"data"` +} +type AccountCheckReq struct { + OperationID string `json:"operationID" binding:"required"` + CheckUserIDList []string `json:"checkUserIDList" binding:"required,lte=100"` +} +type AccountCheckResp struct { + CommResp + ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"` +} + +type ManagementSendMsgResp struct { + CommResp + ResultList server_api_params.UserSendMsgResp `json:"data"` +} diff --git a/pkg/base_info/minio_api_struct.go b/pkg/base_info/minio_api_struct.go new file mode 100644 index 000000000..f15997053 --- /dev/null +++ b/pkg/base_info/minio_api_struct.go @@ -0,0 +1,13 @@ +package base_info + +type MinioStorageCredentialReq struct { + OperationID string `json:"operationID"` +} + +type MiniostorageCredentialResp struct { + SecretAccessKey string `json:"secretAccessKey"` + AccessKeyID string `json:"accessKeyID"` + SessionToken string `json:"sessionToken"` + BucketName string `json:"bucketName"` + StsEndpointURL string `json:"stsEndpointURL"` +} diff --git a/pkg/base_info/oss_api_struct.go b/pkg/base_info/oss_api_struct.go new file mode 100644 index 000000000..621d18820 --- /dev/null +++ b/pkg/base_info/oss_api_struct.go @@ -0,0 +1,22 @@ +package base_info + +type OSSCredentialReq struct { + OperationID string `json:"operationID"` + Filename string `json:"filename"` + FileType string `json:"file_type"` +} + +type OSSCredentialRespData struct { + Endpoint string `json:"endpoint"` + AccessKeyId string `json:"access_key_id"` + AccessKeySecret string `json:"access_key_secret"` + Token string `json:"token"` + Bucket string `json:"bucket"` + FinalHost string `json:"final_host"` +} + +type OSSCredentialResp struct { + CommResp + OssData OSSCredentialRespData `json:"-"` + Data map[string]interface{} `json:"data"` +} diff --git a/pkg/base_info/public_struct.go b/pkg/base_info/public_struct.go new file mode 100644 index 000000000..2950dbea8 --- /dev/null +++ b/pkg/base_info/public_struct.go @@ -0,0 +1,139 @@ +package base_info + +import ( + "github.com/gin-gonic/gin" + "net/http" +) + +type ApiUserInfo struct { + UserID string `json:"userID" binding:"required,min=1,max=64"` + Nickname string `json:"nickname" binding:"omitempty,min=1,max=64"` + FaceURL string `json:"faceURL" binding:"omitempty,max=1024"` + Gender int32 `json:"gender" binding:"omitempty,oneof=0 1 2"` + PhoneNumber string `json:"phoneNumber" binding:"omitempty,max=32"` + Birth uint32 `json:"birth" binding:"omitempty"` + Email string `json:"email" binding:"omitempty,max=64"` + Ex string `json:"ex" binding:"omitempty,max=1024"` +} + +//type Conversation struct { +// OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"` +// ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"` +// ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"` +// UserID string `gorm:"column:user_id;type:char(64)" json:"userID"` +// GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"` +// RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"` +// UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"` +// DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"` +// IsPinned bool `gorm:"column:is_pinned" json:"isPinned"` +// AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"` +// Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +//} + +type GroupAddMemberInfo struct { + UserID string `json:"userID" binding:"required"` + RoleLevel int32 `json:"roleLevel" binding:"required"` +} + +func SetErrCodeMsg(c *gin.Context, status int) *CommResp { + resp := CommResp{ErrCode: int32(status), ErrMsg: http.StatusText(status)} + c.JSON(status, resp) + return &resp +} + +//GroupName string `json:"groupName"` +// Introduction string `json:"introduction"` +// Notification string `json:"notification"` +// FaceUrl string `json:"faceUrl"` +// OperationID string `json:"operationID" binding:"required"` +// GroupType int32 `json:"groupType"` +// Ex string `json:"ex"` + +//type GroupInfo struct { +// GroupID string `json:"groupID"` +// GroupName string `json:"groupName"` +// Notification string `json:"notification"` +// Introduction string `json:"introduction"` +// FaceUrl string `json:"faceUrl"` +// OwnerUserID string `json:"ownerUserID"` +// Ex string `json:"ex"` +// GroupType int32 `json:"groupType"` +//} + +//type GroupMemberFullInfo struct { +// GroupID string `json:"groupID"` +// UserID string `json:"userID"` +// RoleLevel int32 `json:"roleLevel"` +// JoinTime uint64 `json:"joinTime"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// FriendRemark string `json:"friendRemark"` +// AppMangerLevel int32 `json:"appMangerLevel"` +// JoinSource int32 `json:"joinSource"` +// OperatorUserID string `json:"operatorUserID"` +// Ex string `json:"ex"` +//} +// +//type PublicUserInfo struct { +// UserID string `json:"userID"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// Gender int32 `json:"gender"` +//} +// +//type UserInfo struct { +// UserID string `json:"userID"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// Gender int32 `json:"gender"` +// Mobile string `json:"mobile"` +// Birth string `json:"birth"` +// Email string `json:"email"` +// Ex string `json:"ex"` +//} +// +//type FriendInfo struct { +// OwnerUserID string `json:"ownerUserID"` +// Remark string `json:"remark"` +// CreateTime int64 `json:"createTime"` +// FriendUser UserInfo `json:"friendUser"` +// AddSource int32 `json:"addSource"` +// OperatorUserID string `json:"operatorUserID"` +// Ex string `json:"ex"` +//} +// +//type BlackInfo struct { +// OwnerUserID string `json:"ownerUserID"` +// CreateTime int64 `json:"createTime"` +// BlackUser PublicUserInfo `json:"friendUser"` +// AddSource int32 `json:"addSource"` +// OperatorUserID string `json:"operatorUserID"` +// Ex string `json:"ex"` +//} +// +//type GroupRequest struct { +// UserID string `json:"userID"` +// GroupID string `json:"groupID"` +// HandleResult string `json:"handleResult"` +// ReqMsg string `json:"reqMsg"` +// HandleMsg string `json:"handleMsg"` +// ReqTime int64 `json:"reqTime"` +// HandleUserID string `json:"handleUserID"` +// HandleTime int64 `json:"handleTime"` +// Ex string `json:"ex"` +//} +// +//type FriendRequest struct { +// FromUserID string `json:"fromUserID"` +// ToUserID string `json:"toUserID"` +// HandleResult int32 `json:"handleResult"` +// ReqMessage string `json:"reqMessage"` +// CreateTime int64 `json:"createTime"` +// HandlerUserID string `json:"handlerUserID"` +// HandleMsg string `json:"handleMsg"` +// HandleTime int64 `json:"handleTime"` +// Ex string `json:"ex"` +//} +// +// +// diff --git a/pkg/base_info/user_api_struct.go b/pkg/base_info/user_api_struct.go new file mode 100644 index 000000000..10f20376c --- /dev/null +++ b/pkg/base_info/user_api_struct.go @@ -0,0 +1,34 @@ +package base_info + +import ( + open_im_sdk "Open_IM/pkg/proto/sdk_ws" +) + +type GetUsersInfoReq struct { + OperationID string `json:"operationID" binding:"required"` + UserIDList []string `json:"userIDList" binding:"required"` +} +type GetUsersInfoResp struct { + CommResp + UserInfoList []*open_im_sdk.PublicUserInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type UpdateSelfUserInfoReq struct { + ApiUserInfo + OperationID string `json:"operationID" binding:"required"` +} + +type UpdateUserInfoResp struct { + CommResp +} + +type GetSelfUserInfoReq struct { + OperationID string `json:"operationID" binding:"required"` + UserID string `json:"userID" binding:"required"` +} +type GetSelfUserInfoResp struct { + CommResp + UserInfo *open_im_sdk.UserInfo `json:"-"` + Data map[string]interface{} `json:"data"` +} diff --git a/pkg/call_back_struct/common.go b/pkg/call_back_struct/common.go new file mode 100644 index 000000000..e2bf510f4 --- /dev/null +++ b/pkg/call_back_struct/common.go @@ -0,0 +1,26 @@ +package call_back_struct + +type CommonCallbackReq struct { + SendID string `json:"sendID"` + CallbackCommand string `json:"callbackCommand"` + ServerMsgID string `json:"serverMsgID"` + ClientMsgID string `json:"clientMsgID"` + OperationID string `json:"operationID"` + SenderPlatformID int32 `json:"senderPlatformID"` + SenderNickname string `json:"senderNickname"` + SessionType int32 `json:"sessionType"` + MsgFrom int32 `json:"msgFrom"` + ContentType int32 `json:"contentType"` + Status int32 `json:"status"` + CreateTime int64 `json:"createTime"` + Content string `json:"content"` +} + +type CommonCallbackResp struct { + ActionCode int `json:"actionCode"` + ErrCode int `json:"errCode"` + ErrMsg string `json:"errMsg"` + OperationID string `json:"operationID"` +} + + diff --git a/pkg/call_back_struct/group.go b/pkg/call_back_struct/group.go new file mode 100644 index 000000000..3681dddcc --- /dev/null +++ b/pkg/call_back_struct/group.go @@ -0,0 +1,9 @@ +package call_back_struct + +type CallbackBeforeCreateGroupReq struct { + CommonCallbackReq +} + +type CallbackAfterCreateGroupResp struct { + CommonCallbackResp +} \ No newline at end of file diff --git a/pkg/call_back_struct/message.go b/pkg/call_back_struct/message.go new file mode 100644 index 000000000..31c215ea2 --- /dev/null +++ b/pkg/call_back_struct/message.go @@ -0,0 +1,47 @@ +package call_back_struct + + +type CallbackBeforeSendSingleMsgReq struct { + CommonCallbackReq + RecvID string `json:"recvID"` +} + +type CallbackBeforeSendSingleMsgResp struct { + CommonCallbackResp +} + +type CallbackAfterSendSingleMsgReq struct { + CommonCallbackReq + RecvID string `json:"recvID"` +} + +type CallbackAfterSendSingleMsgResp struct { + CommonCallbackResp +} + +type CallbackBeforeSendGroupMsgReq struct { + CommonCallbackReq + GroupID string `json:"groupID"` +} + +type CallbackBeforeSendGroupMsgResp struct { + CommonCallbackResp +} + +type CallbackAfterSendGroupMsgReq struct { + CommonCallbackReq + GroupID string `json:"groupID"` +} + +type CallbackAfterSendGroupMsgResp struct { + CommonCallbackResp +} + +type CallbackWordFilterReq struct { + CommonCallbackReq +} + +type CallbackWordFilterResp struct { + CommonCallbackResp + Content string `json:"content"` +} diff --git a/pkg/cms_api_struct/admin.go b/pkg/cms_api_struct/admin.go new file mode 100644 index 000000000..54674662e --- /dev/null +++ b/pkg/cms_api_struct/admin.go @@ -0,0 +1,10 @@ +package cms_api_struct + +type AdminLoginRequest struct { + AdminName string `json:"admin_name" binding:"required"` + Secret string `json:"secret" binding:"required"` +} + +type AdminLoginResponse struct { + Token string `json:"token"` +} \ No newline at end of file diff --git a/pkg/cms_api_struct/common.go b/pkg/cms_api_struct/common.go new file mode 100644 index 000000000..7d160f543 --- /dev/null +++ b/pkg/cms_api_struct/common.go @@ -0,0 +1,11 @@ +package cms_api_struct + +type RequestPagination struct { + PageNumber int `form:"page_number" binding:"required"` + ShowNumber int `form:"show_number" binding:"required"` +} + +type ResponsePagination struct { + CurrentPage int `json:"current_number" binding:"required"` + ShowNumber int `json:"show_number" binding:"required"` +} \ No newline at end of file diff --git a/pkg/cms_api_struct/group.go b/pkg/cms_api_struct/group.go new file mode 100644 index 000000000..9d161b622 --- /dev/null +++ b/pkg/cms_api_struct/group.go @@ -0,0 +1,146 @@ +package cms_api_struct + +type GroupResponse struct { + GroupName string `json:"group_name"` + GroupID string `json:"group_id"` + GroupMasterName string `json:"group_master_name"` + GroupMasterId string `json:"group_master_id"` + CreateTime string `json:"create_time"` + IsBanChat bool `json:"is_ban_chat"` + IsBanPrivateChat bool `json:"is_ban_private_chat"` + ProfilePhoto string `json:"profile_photo"` +} + +type GetGroupByIdRequest struct { + GroupId string `form:"group_id" binding:"required"` +} + +type GetGroupByIdResponse struct { + GroupResponse +} + +type GetGroupRequest struct { + GroupName string `form:"group_name" binding:"required"` + RequestPagination +} + +type GetGroupResponse struct { + Groups []GroupResponse `json:"groups"` + GroupNums int `json:"group_nums"` + ResponsePagination +} + +type GetGroupsRequest struct { + RequestPagination +} + +type GetGroupsResponse struct { + Groups []GroupResponse `json:"groups"` + GroupNums int `json:"group_nums"` + ResponsePagination +} + +type CreateGroupRequest struct { + GroupName string `json:"group_name" binding:"required"` + GroupMasterId string `json:"group_master_id" binding:"required"` + GroupMembers []string `json:"group_members" binding:"required"` +} + +type CreateGroupResponse struct { +} + +type SetGroupMasterRequest struct { + GroupId string `json:"group_id" binding:"required"` + UserId string `json:"user_id" binding:"required"` +} + +type SetGroupMasterResponse struct { +} + +type SetGroupMemberRequest struct { + GroupId string `json:"group_id" binding:"required"` + UserId string `json:"user_id" binding:"required"` +} + +type SetGroupMemberRespones struct { + +} + +type BanGroupChatRequest struct { + GroupId string `json:"group_id" binding:"required"` +} + +type BanGroupChatResponse struct { +} + +type BanPrivateChatRequest struct { + GroupId string `json:"group_id" binding:"required"` +} + +type BanPrivateChatResponse struct { +} + +type DeleteGroupRequest struct { + GroupId string `json:"group_id" binding:"required"` +} + +type DeleteGroupResponse struct { +} + +type GetGroupMembersRequest struct { + GroupId string `form:"group_id" binding:"required"` + UserName string `form:"user_name"` + RequestPagination +} + +type GroupMemberResponse struct { + MemberPosition int `json:"member_position"` + MemberNickName string `json:"member_nick_name"` + MemberId string `json:"member_id"` + JoinTime string `json:"join_time"` +} + +type GetGroupMembersResponse struct { + GroupMembers []GroupMemberResponse `json:"group_members"` + ResponsePagination + MemberNums int `json:"member_nums"` +} + +type GroupMemberRequest struct { + GroupId string `json:"group_id" binding:"required"` + Members []string `json:"members" binding:"required"` +} + +type GroupMemberOperateResponse struct { + Success []string `json:"success"` + Failed []string `json:"failed"` +} + +type AddGroupMembersRequest struct { + GroupMemberRequest +} + +type AddGroupMembersResponse struct { + GroupMemberOperateResponse +} + +type RemoveGroupMembersRequest struct { + GroupMemberRequest +} + +type RemoveGroupMembersResponse struct{ + GroupMemberOperateResponse +} + +type AlterGroupInfoRequest struct { + GroupID string `json:"group_id"` + GroupName string `json:"group_name"` + Notification string `json:"notification"` + Introduction string `json:"introduction"` + ProfilePhoto string `json:"profile_photo"` + GroupType int `json:"group_type"` +} + +type AlterGroupInfoResponse struct { + +} diff --git a/pkg/cms_api_struct/message_cms.go b/pkg/cms_api_struct/message_cms.go new file mode 100644 index 000000000..164c75011 --- /dev/null +++ b/pkg/cms_api_struct/message_cms.go @@ -0,0 +1,50 @@ +package cms_api_struct + +type BroadcastRequest struct { + Message string `json:"message"` +} + +type BroadcastResponse struct { +} + +type MassSendMassageRequest struct { + Message string `json:"message"` + Users []string `json:"users"` +} + +type MassSendMassageResponse struct { +} + +type GetChatLogsRequest struct { + SessionType int `form:"session_type"` + ContentType int `form:"content_type"` + Content string `form:"content"` + UserId string `form:"user_id"` + GroupId string `form:"group_id"` + Date string `form:"date"` + + RequestPagination +} + +type ChatLog struct { + SessionType int `json:"session_type"` + ContentType int `json:"content_type"` + SenderNickName string `json:"sender_nick_name"` + SenderId string `json:"sender_id"` + SearchContent string `json:"search_content"` + WholeContent string `json:"whole_content"` + + ReceiverNickName string `json:"receiver_nick_name,omitempty"` + ReceiverID string `json:"receiver_id,omitempty"` + + GroupName string `json:"group_name,omitempty"` + GroupId string `json:"group_id,omitempty"` + + Date string `json:"date"` +} + +type GetChatLogsResponse struct { + ChatLogs []ChatLog `json:"chat_logs"` + ChatLogsNum int `json:"log_nums"` + ResponsePagination +} diff --git a/pkg/cms_api_struct/organization.go b/pkg/cms_api_struct/organization.go new file mode 100644 index 000000000..825d41aa1 --- /dev/null +++ b/pkg/cms_api_struct/organization.go @@ -0,0 +1,25 @@ +package cms_api_struct + +type GetStaffsResponse struct { + StaffsList []struct { + ProfilePhoto string `json:"profile_photo"` + NickName string `json:"nick_name"` + StaffId int `json:"staff_id"` + Position string `json:"position"` + EntryTime string `json:"entry_time"` + } `json:"staffs_list"` +} + +type GetOrganizationsResponse struct { + OrganizationList []struct { + OrganizationId int `json:"organization_id"` + OrganizationName string `json:"organization_name"` + } `json:"organization_list"` +} + +type SquadResponse struct { + SquadList []struct { + SquadId int `json:"squad_id"` + SquadName string `json:"squad_name"` + } `json:"squad_list"` +} diff --git a/pkg/cms_api_struct/statistics.go b/pkg/cms_api_struct/statistics.go new file mode 100644 index 000000000..2ff1efffa --- /dev/null +++ b/pkg/cms_api_struct/statistics.go @@ -0,0 +1,89 @@ +package cms_api_struct + +type GetStatisticsRequest struct { + From string `form:"from" binding:"required"` + To string `form:"to" binding:"required"` +} + +type GetMessageStatisticsRequest struct { + GetStatisticsRequest +} + +type GetMessageStatisticsResponse struct { + PrivateMessageNum int `json:"private_message_num"` + GroupMessageNum int `json:"group_message_num"` + PrivateMessageNumList []struct { + Date string `json:"date"` + MessageNum int `json:"message_num"` + } `json:"private_message_num_list"` + GroupMessageNumList []struct { + Date string `json:"date"` + MessageNum int `json:"message_num"` + } `json:"group_message_num_list"` +} + +type GetUserStatisticsRequest struct { + GetStatisticsRequest +} + +type GetUserStatisticsResponse struct { + IncreaseUserNum int `json:"increase_user_num"` + ActiveUserNum int `json:"active_user_num"` + TotalUserNum int `json:"total_user_num"` + IncreaseUserNumList []struct { + Date string `json:"date"` + IncreaseUserNum int `json:"increase_user_num"` + } `json:"increase_user_num_list"` + ActiveUserNumList []struct { + Date string `json:"date"` + ActiveUserNum int `json:"active_user_num"` + } `json:"active_user_num_list"` + TotalUserNumList []struct { + Date string `json:"date"` + TotalUserNum int `json:"total_user_num"` + } `json:"total_user_num_list"` +} + +type GetGroupStatisticsRequest struct { + GetStatisticsRequest +} + +// 群聊统计 +type GetGroupStatisticsResponse struct { + IncreaseGroupNum int `json:"increase_group_num"` + TotalGroupNum int `json:"total_group_num"` + IncreaseGroupNumList []struct { + Date string `json:"date"` + IncreaseGroupNum int `json:"increase_group_num"` + } `json:"increase_group_num_list"` + TotalGroupNumList []struct { + Date string `json:"date"` + TotalGroupNum int `json:"total_group_num"` + } `json:"total_group_num_list"` +} + +type GetActiveUserRequest struct { + GetStatisticsRequest + // RequestPagination +} + +type GetActiveUserResponse struct { + ActiveUserList []struct { + NickName string `json:"nick_name"` + UserId string `json:"user_id"` + MessageNum int `json:"message_num"` + } `json:"active_user_list"` +} + +type GetActiveGroupRequest struct { + GetStatisticsRequest + // RequestPagination +} + +type GetActiveGroupResponse struct { + ActiveGroupList []struct { + GroupName string `json:"group_name"` + GroupId string `json:"group_id"` + MessageNum int `json:"message_num"` + } `json:"active_group_list"` +} diff --git a/pkg/cms_api_struct/user.go b/pkg/cms_api_struct/user.go new file mode 100644 index 000000000..2c0b004b0 --- /dev/null +++ b/pkg/cms_api_struct/user.go @@ -0,0 +1,110 @@ +package cms_api_struct + +type UserResponse struct { + ProfilePhoto string `json:"profile_photo"` + Nickname string `json:"nick_name"` + UserId string `json:"user_id"` + CreateTime string `json:"create_time,omitempty"` + IsBlock bool `json:"is_block"` +} + +type GetUserRequest struct { + UserId string `form:"user_id" binding:"required"` +} + +type GetUserResponse struct { + UserResponse +} + +type GetUsersRequest struct { + RequestPagination +} + +type GetUsersResponse struct { + Users []*UserResponse `json:"users"` + ResponsePagination + UserNums int32 `json:"user_nums"` +} + +type GetUsersByNameRequest struct { + UserName string `form:"user_name" binding:"required"` + RequestPagination +} + +type GetUsersByNameResponse struct { + Users []*UserResponse `json:"users"` + ResponsePagination + UserNums int32 `json:"user_nums"` +} + +type ResignUserRequest struct { + UserId string `json:"user_id"` +} + +type ResignUserResponse struct { +} + +type AlterUserRequest struct { + UserId string `json:"user_id" binding:"required"` + Nickname string `json:"nickname"` + PhoneNumber int `json:"phone_number" validate:"len=11"` + Email string `json:"email"` +} + +type AlterUserResponse struct { +} + +type AddUserRequest struct { + PhoneNumber string `json:"phone_number" binding:"required"` + UserId string `json:"user_id" binding:"required"` + Name string `json:"name" binding:"required"` +} + +type AddUserResponse struct { +} + +type BlockUser struct { + UserResponse + BeginDisableTime string `json:"begin_disable_time"` + EndDisableTime string `json:"end_disable_time"` +} + +type BlockUserRequest struct { + UserId string `json:"user_id" binding:"required"` + EndDisableTime string `json:"end_disable_time" binding:"required"` +} + +type BlockUserResponse struct { +} + +type UnblockUserRequest struct { + UserId string `json:"user_id" binding:"required"` +} + +type UnBlockUserResponse struct { +} + +type GetBlockUsersRequest struct { + RequestPagination +} + +type GetBlockUsersResponse struct { + BlockUsers []BlockUser `json:"block_users"` + ResponsePagination + UserNums int32 `json:"user_nums"` +} + +type GetBlockUserRequest struct { + UserId string `form:"user_id" binding:"required"` +} + +type GetBlockUserResponse struct { + BlockUser +} + +type DeleteUserRequest struct { + UserId string `json:"user_id" binding:"required"` +} + +type DeleteUserResponse struct { +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index f30000781..deb7f98fd 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -1,10 +1,14 @@ package config import ( - "gopkg.in/yaml.v3" + "fmt" "io/ioutil" + "os" "path/filepath" "runtime" + + "github.com/spf13/viper" + "gopkg.in/yaml.v3" ) var ( @@ -15,12 +19,21 @@ var ( var Config config +type callBackConfig struct { + Enable bool `yaml:"enable"` + CallbackTimeOut int `yaml:"callbackTimeOut"` + CallbackFailedContinue bool `CallbackFailedContinue` +} + type config struct { ServerIP string `yaml:"serverip"` ServerVersion string `yaml:"serverversion"` Api struct { GinPort []int `yaml:"openImApiPort"` } + CmsApi struct { + GinPort []int `yaml:"openImCmsApiPort"` + } Sdk struct { WsPort []int `yaml:"openImSdkWsPort"` } @@ -32,16 +45,25 @@ type config struct { SecretID string `yaml:"secretID"` SecretKey string `yaml:"secretKey"` } - Aliyun struct { - AccessKeyId string `yaml:"accessKeyId"` - AccessKeySecret string `yaml:"accessKeySecret"` - RoleArn string `yaml:"roleArn"` - RegionId string `yaml:"regionId"` - Region string `yaml:"region"` - Bucket string `yaml:"bucket"` + Ali struct { + RegionID string `yaml:"regionID"` + AccessKeyID string `yaml:"accessKeyID"` + AccessKeySecret string `yaml:"accessKeySecret"` + StsEndpoint string `yaml:"stsEndpoint"` + OssEndpoint string `yaml:"ossEndpoint"` + Bucket string `yaml:"bucket"` + FinalHost string `yaml:"finalHost"` + StsDurationSeconds int64 `yaml:"stsDurationSeconds"` + OssRoleArn string `yaml:"OssRoleArn"` } + Minio struct { + Bucket string `yaml:"bucket"` + Location string `yaml:"location"` + Endpoint string `yaml:"endpoint"` + AccessKeyID string `yaml:"accessKeyID"` + SecretAccessKey string `yaml:"secretAccessKey"` + } `yaml:"minio"` } - Mysql struct { DBAddress []string `yaml:"dbMysqlAddress"` DBUserName string `yaml:"dbMysqlUserName"` @@ -54,6 +76,7 @@ type config struct { DBMaxLifeTime int `yaml:"dbMaxLifeTime"` } Mongo struct { + DBUri string `yaml:"dbUri"` // 当dbUri值不为空则直接使用该值 DBAddress []string `yaml:"dbAddress"` DBDirect bool `yaml:"dbDirect"` DBTimeout int `yaml:"dbTimeout"` @@ -81,6 +104,7 @@ type config struct { RpcGetTokenPort []int `yaml:"rpcGetTokenPort"` } RpcRegisterName struct { + OpenImStatisticsName string `yaml:"OpenImStatisticsName"` OpenImUserName string `yaml:"openImUserName"` OpenImFriendName string `yaml:"openImFriendName"` OpenImOfflineMessageName string `yaml:"openImOfflineMessageName"` @@ -88,6 +112,8 @@ type config struct { OpenImOnlineMessageRelayName string `yaml:"openImOnlineMessageRelayName"` OpenImGroupName string `yaml:"openImGroupName"` OpenImAuthName string `yaml:"openImAuthName"` + OpenImMessageCMSName string `yaml:"openImMessageCMSName"` + OpenImAdminCMSName string `yaml:"openImAdminCMSName"` } Etcd struct { EtcdSchema string `yaml:"etcdSchema"` @@ -130,6 +156,7 @@ type config struct { AppKey string `yaml:"appKey"` MasterSecret string `yaml:"masterSecret"` PushUrl string `yaml:"pushUrl"` + PushIntent string `yaml:"pushIntent"` } } Manager struct { @@ -152,19 +179,177 @@ type config struct { } } Secret string `yaml:"secret"` - MultiLoginPolicy struct { - OnlyOneTerminalAccess bool `yaml:"onlyOneTerminalAccess"` - MobileAndPCTerminalAccessButOtherTerminalKickEachOther bool `yaml:"mobileAndPCTerminalAccessButOtherTerminalKickEachOther"` - AllTerminalAccess bool `yaml:"allTerminalAccess"` - } - TokenPolicy struct { + MultiLoginPolicy int `yaml:"multiloginpolicy"` + TokenPolicy struct { AccessSecret string `yaml:"accessSecret"` AccessExpire int64 `yaml:"accessExpire"` } - MessageCallBack struct { - CallbackSwitch bool `yaml:"callbackSwitch"` - CallbackUrl string `yaml:"callbackUrl"` + MessageJudge struct { + IsJudgeFriend bool `yaml:"isJudgeFriend"` } + IOSPush struct { + PushSound string `yaml:"pushSound"` + BadgeCount bool `yaml:"badgeCount"` + } + + Callback struct { + CallbackUrl string `yaml:"callbackUrl"` + CallbackBeforeSendSingleMsg callBackConfig `yaml:"callbackbeforeSendSingleMsg"` + CallbackAfterSendSingleMsg callBackConfig `yaml:"callbackAfterSendSingleMsg"` + CallbackBeforeSendGroupMsg callBackConfig `yaml:"callbackBeforeSendGroupMsg"` + CallbackAfterSendGroupMsg callBackConfig `yaml:"callbackAfterSendGroupMsg"` + CallbackWordFilter callBackConfig `yaml:"callbackWordFilter"` + } `yaml:"callback"` + Notification struct { + ///////////////////////group///////////////////////////// + GroupCreated struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupCreated"` + + GroupInfoSet struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupInfoSet"` + + JoinGroupApplication struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"joinGroupApplication"` + + MemberQuit struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberQuit"` + + GroupApplicationAccepted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupApplicationAccepted"` + + GroupApplicationRejected struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupApplicationRejected"` + + GroupOwnerTransferred struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupOwnerTransferred"` + + MemberKicked struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberKicked"` + + MemberInvited struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberInvited"` + + MemberEnter struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberEnter"` + ////////////////////////user/////////////////////// + UserInfoUpdated struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"userInfoUpdated"` + + //////////////////////friend/////////////////////// + FriendApplication struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendApplicationAdded"` + FriendApplicationApproved struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendApplicationApproved"` + + FriendApplicationRejected struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendApplicationRejected"` + + FriendAdded struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendAdded"` + + FriendDeleted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendDeleted"` + FriendRemarkSet struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendRemarkSet"` + BlackAdded struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"blackAdded"` + BlackDeleted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"blackDeleted"` + ConversationOptUpdate struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"conversationOptUpdate"` + } + Demo struct { + Port []int `yaml:"openImDemoPort"` + AliSMSVerify struct { + AccessKeyID string `yaml:"accessKeyId"` + AccessKeySecret string `yaml:"accessKeySecret"` + SignName string `yaml:"signName"` + VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"` + } + SuperCode string `yaml:"superCode"` + CodeTTL int `yaml:"codeTTL"` + Mail struct { + Title string `yaml:"title"` + SenderMail string `yaml:"senderMail"` + SenderAuthorizationCode string `yaml:"senderAuthorizationCode"` + SmtpAddr string `yaml:"smtpAddr"` + SmtpPort int `yaml:"smtpPort"` + } + } +} +type PConversation struct { + ReliabilityLevel int `yaml:"reliabilityLevel"` + UnreadCount bool `yaml:"unreadCount"` +} + +type POfflinePush struct { + PushSwitch bool `yaml:"switch"` + Title string `yaml:"title"` + Desc string `yaml:"desc"` + Ext string `yaml:"ext"` +} +type PDefaultTips struct { + Tips string `yaml:"tips"` } func init() { @@ -172,12 +357,23 @@ func init() { //bytes, err := ioutil.ReadFile(path + "/config/config.yaml") // if we cd Open-IM-Server/src/utils and run go test // it will panic cannot find config/config.yaml - bytes, err := ioutil.ReadFile(Root + "/config/config.yaml") - if err != nil { - panic(err) - } - if err = yaml.Unmarshal(bytes, &Config); err != nil { - panic(err) + + cfgName := os.Getenv("CONFIG_NAME") + if len(cfgName) == 0 { + cfgName = Root + "/config/config.yaml" } + viper.SetConfigFile(cfgName) + err := viper.ReadInConfig() + if err != nil { + panic(err.Error()) + } + bytes, err := ioutil.ReadFile(cfgName) + if err != nil { + panic(err.Error()) + } + if err = yaml.Unmarshal(bytes, &Config); err != nil { + panic(err.Error()) + } + fmt.Println("load config: ", Config) } diff --git a/pkg/common/config/error.go b/pkg/common/config/error.go deleted file mode 100644 index 4d99251f0..000000000 --- a/pkg/common/config/error.go +++ /dev/null @@ -1,48 +0,0 @@ -package config - -// key = errCode, string = errMsg -type ErrInfo struct { - ErrCode int32 - ErrMsg string -} - -var ( - OK = ErrInfo{0, ""} - - ErrMysql = ErrInfo{100, ""} - ErrMongo = ErrInfo{110, ""} - ErrRedis = ErrInfo{120, ""} - ErrParseToken = ErrInfo{200, "Parse token failed"} - ErrCreateToken = ErrInfo{201, "Create token failed"} - ErrAppServerKey = ErrInfo{300, "key error"} - ErrTencentCredential = ErrInfo{400, ""} - - ErrorUserRegister = ErrInfo{600, "User registration failed"} - ErrAccountExists = ErrInfo{601, "The account is already registered and cannot be registered again"} - ErrUserPassword = ErrInfo{602, "User password error"} - ErrTokenIncorrect = ErrInfo{603, "Invalid token"} - ErrTokenExpired = ErrInfo{604, "Expired token"} - ErrRefreshToken = ErrInfo{605, "Failed to refresh token"} - ErrAddFriend = ErrInfo{606, "Failed to add friends"} - ErrAgreeToAddFriend = ErrInfo{607, "Failed to agree application"} - ErrAddFriendToBlack = ErrInfo{608, "Failed to add friends to the blacklist"} - ErrGetBlackList = ErrInfo{609, "Failed to get blacklist"} - ErrDeleteFriend = ErrInfo{610, "Failed to delete friend"} - ErrGetFriendApplyList = ErrInfo{611, "Failed to get friend application list"} - ErrGetFriendList = ErrInfo{612, "Failed to get friend list"} - ErrRemoveBlackList = ErrInfo{613, "Failed to remove blacklist"} - ErrSearchUserInfo = ErrInfo{614, "Can't find the user information"} - ErrDelAppleDeviceToken = ErrInfo{615, ""} - ErrModifyUserInfo = ErrInfo{616, "update user some attribute failed"} - ErrSetFriendComment = ErrInfo{617, "set friend comment failed"} - ErrSearchUserInfoFromTheGroup = ErrInfo{618, "There is no such group or the user not in the group"} - ErrCreateGroup = ErrInfo{619, "create group chat failed"} - ErrJoinGroupApplication = ErrInfo{620, "Failed to apply to join the group"} - ErrQuitGroup = ErrInfo{621, "Failed to quit the group"} - ErrSetGroupInfo = ErrInfo{622, "Failed to set group info"} - ErrParam = ErrInfo{ErrCode: 700, ErrMsg: "param failed"} - - ErrAccess = ErrInfo{ErrCode: 800, ErrMsg: "no permission"} - - ErrDb = ErrInfo{ErrCode: 900, ErrMsg: "db failed"} -) diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 8a1aa4029..7e1971c64 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -3,14 +3,14 @@ package constant const ( //group admin - OrdinaryMember = 0 - GroupOwner = 1 - Administrator = 2 + // OrdinaryMember = 0 + // GroupOwner = 1 + // Administrator = 2 //group application - Application = 0 - AgreeApplication = 1 + // Application = 0 + // AgreeApplication = 1 - //feiend related + //friend related BlackListFlag = 1 ApplicationFriendFlag = 0 FriendFlag = 1 @@ -18,10 +18,12 @@ const ( //Websocket Protocol WSGetNewestSeq = 1001 - WSPullMsg = 1002 + WSPullMsgBySeqList = 1002 WSSendMsg = 1003 - WSPullMsgBySeqList = 1004 + WSSendSignalMsg = 1004 WSPushMsg = 2001 + WSKickOnlineMsg = 2002 + WsLogoutMsg = 2003 WSDataError = 3001 ///ContentType @@ -32,32 +34,50 @@ const ( Video = 104 File = 105 AtText = 106 + Merger = 107 + Card = 108 + Location = 109 Custom = 110 + Revoke = 111 HasReadReceipt = 112 Typing = 113 + Quote = 114 Common = 200 GroupMsg = 201 //SysRelated - AcceptFriendApplicationTip = 201 - AddFriendTip = 202 - RefuseFriendApplicationTip = 203 - SetSelfInfoTip = 204 - Revoke = 205 - C2CMessageAsRead = 206 + NotificationBegin = 1000 - KickOnlineTip = 303 + FriendApplicationApprovedNotification = 1201 //add_friend_response + FriendApplicationRejectedNotification = 1202 //add_friend_response + FriendApplicationNotification = 1203 //add_friend + FriendAddedNotification = 1204 + FriendDeletedNotification = 1205 //delete_friend + FriendRemarkSetNotification = 1206 //set_friend_remark? + BlackAddedNotification = 1207 //add_black + BlackDeletedNotification = 1208 //remove_black + ConversationOptChangeNotification = 1300 // change conversation opt - TransferGroupOwnerTip = 501 - CreateGroupTip = 502 - GroupApplicationResponseTip = 503 - JoinGroupTip = 504 - QuitGroupTip = 505 - SetGroupInfoTip = 506 - AcceptGroupApplicationTip = 507 - RefuseGroupApplicationTip = 508 - KickGroupMemberTip = 509 - InviteUserToGroupTip = 510 + UserNotificationBegin = 1301 + UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 + ConversationNotification = 1307 + ConversationNotNotification = 1308 + ConversationDefault = 0 + UserNotificationEnd = 1399 + + GroupNotificationBegin = 1500 + + GroupCreatedNotification = 1501 + GroupInfoSetNotification = 1502 + JoinGroupApplicationNotification = 1503 + MemberQuitNotification = 1504 + GroupApplicationAcceptedNotification = 1505 + GroupApplicationRejectedNotification = 1506 + GroupOwnerTransferredNotification = 1507 + MemberKickedNotification = 1508 + MemberInvitedNotification = 1509 + MemberEnterNotification = 1510 + NotificationEnd = 2000 //MsgFrom UserMsgType = 100 @@ -66,6 +86,71 @@ const ( //SessionType SingleChatType = 1 GroupChatType = 2 + //token + NormalToken = 0 + InValidToken = 1 + KickedToken = 2 + ExpiredToken = 3 + + //MultiTerminalLogin + //Full-end login, but the same end is mutually exclusive + AllLoginButSameTermKick = 1 + //Only one of the endpoints can log in + SingleTerminalLogin = 2 + //The web side can be online at the same time, and the other side can only log in at one end + WebAndOther = 3 + //The PC side is mutually exclusive, and the mobile side is mutually exclusive, but the web side can be online at the same time + PcMobileAndWeb = 4 + + OnlineStatus = "online" + OfflineStatus = "offline" + Registered = "registered" + UnRegistered = "unregistered" + + //MsgReceiveOpt + ReceiveMessage = 0 + NotReceiveMessage = 1 + ReceiveNotNotifyMessage = 2 + + //OptionsKey + IsHistory = "history" + IsPersistent = "persistent" + IsOfflinePush = "offlinePush" + IsUnreadCount = "unreadCount" + IsConversationUpdate = "conversationUpdate" + IsSenderSync = "senderSync" + + //GroupStatus + GroupOk = 0 + GroupBanChat = 1 + GroupDisband = 2 + GroupBaned = 3 + GroupBanPrivateChat = 4 + + //UserJoinGroupSource + JoinByAdmin = 1 + + //Minio + MinioDurationTimes = 3600 + + // verificationCode used for + VerificationCodeForRegister = 1 + VerificationCodeForReset = 2 + VerificationCodeForRegisterSuffix = "_forRegister" + VerificationCodeForResetSuffix = "_forReset" + + //callbackCommand + CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand" + CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand" + CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand" + CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand" + CallbackWordFilterCommand = "callbackWordFilterCommand" + //callback actionCode + ActionAllow = 0 + ActionForbidden = 1 + //callback callbackHandleCode + CallbackHandleSuccess = 0 + CallbackHandleFailed = 1 ) var ContentType2PushContent = map[int64]string{ @@ -79,4 +164,44 @@ var ContentType2PushContent = map[int64]string{ Common: "你收到一条新消息", } +const ( + AppOrdinaryUsers = 1 + AppAdmin = 2 + + GroupOrdinaryUsers = 1 + GroupOwner = 2 + GroupAdmin = 3 + + GroupResponseAgree = 1 + GroupResponseRefuse = -1 + + FriendResponseAgree = 1 + FriendResponseRefuse = -1 + + Male = 1 + Female = 2 +) + +const ( + UnreliableNotification = 1 + ReliableNotificationNoMsg = 2 + ReliableNotificationMsg = 3 +) + const FriendAcceptTip = "You have successfully become friends, so start chatting" + +func GroupIsBanChat(status int32) bool { + if status != GroupBanChat { + return false + } + return true +} + +func GroupIsBanPrivateChat(status int32) bool { + if status != GroupBanPrivateChat { + return false + } + return true +} + +const BigVersion = "v3" diff --git a/pkg/common/constant/error.go b/pkg/common/constant/error.go new file mode 100644 index 000000000..548720a37 --- /dev/null +++ b/pkg/common/constant/error.go @@ -0,0 +1,99 @@ +package constant + +import "errors" + +// key = errCode, string = errMsg +type ErrInfo struct { + ErrCode int32 + ErrMsg string +} + +var ( + OK = ErrInfo{0, ""} + ErrServer = ErrInfo{500, "server error"} + + // ErrMysql = ErrInfo{100, ""} + // ErrMongo = ErrInfo{110, ""} + // ErrRedis = ErrInfo{120, ""} + ErrParseToken = ErrInfo{700, ParseTokenMsg.Error()} + // ErrCreateToken = ErrInfo{201, "Create token failed"} + // ErrAppServerKey = ErrInfo{300, "key error"} + ErrTencentCredential = ErrInfo{400, ThirdPartyMsg.Error()} + + // ErrorUserRegister = ErrInfo{600, "User registration failed"} + // ErrAccountExists = ErrInfo{601, "The account is already registered and cannot be registered again"} + // ErrUserPassword = ErrInfo{602, "User password error"} + // ErrRefreshToken = ErrInfo{605, "Failed to refresh token"} + // ErrAddFriend = ErrInfo{606, "Failed to add friends"} + // ErrAgreeToAddFriend = ErrInfo{607, "Failed to agree application"} + // ErrAddFriendToBlack = ErrInfo{608, "Failed to add friends to the blacklist"} + // ErrGetBlackList = ErrInfo{609, "Failed to get blacklist"} + // ErrDeleteFriend = ErrInfo{610, "Failed to delete friend"} + // ErrGetFriendApplyList = ErrInfo{611, "Failed to get friend application list"} + // ErrGetFriendList = ErrInfo{612, "Failed to get friend list"} + // ErrRemoveBlackList = ErrInfo{613, "Failed to remove blacklist"} + // ErrSearchUserInfo = ErrInfo{614, "Can't find the user information"} + // ErrDelAppleDeviceToken = ErrInfo{615, ""} + // ErrModifyUserInfo = ErrInfo{616, "update user some attribute failed"} + // ErrSetFriendComment = ErrInfo{617, "set friend comment failed"} + // ErrSearchUserInfoFromTheGroup = ErrInfo{618, "There is no such group or the user not in the group"} + // ErrCreateGroup = ErrInfo{619, "create group chat failed"} + // ErrJoinGroupApplication = ErrInfo{620, "Failed to apply to join the group"} + // ErrQuitGroup = ErrInfo{621, "Failed to quit the group"} + // ErrSetGroupInfo = ErrInfo{622, "Failed to set group info"} + // ErrParam = ErrInfo{700, "param failed"} + ErrTokenExpired = ErrInfo{701, TokenExpiredMsg.Error()} + ErrTokenInvalid = ErrInfo{702, TokenInvalidMsg.Error()} + ErrTokenMalformed = ErrInfo{703, TokenMalformedMsg.Error()} + ErrTokenNotValidYet = ErrInfo{704, TokenNotValidYetMsg.Error()} + ErrTokenUnknown = ErrInfo{705, TokenUnknownMsg.Error()} + + ErrAccess = ErrInfo{ErrCode: 801, ErrMsg: AccessMsg.Error()} + ErrDB = ErrInfo{ErrCode: 802, ErrMsg: DBMsg.Error()} + ErrArgs = ErrInfo{ErrCode: 8003, ErrMsg: ArgsMsg.Error()} + ErrCallback = ErrInfo{ErrCode: 809, ErrMsg: CallBackMsg.Error()} +) + +var ( + ParseTokenMsg = errors.New("parse token failed") + TokenExpiredMsg = errors.New("token is timed out, please log in again") + TokenInvalidMsg = errors.New("token has been invalidated") + TokenNotValidYetMsg = errors.New("token not active yet") + TokenMalformedMsg = errors.New("that's not even a token") + TokenUnknownMsg = errors.New("couldn't handle this token") + + AccessMsg = errors.New("no permission") + DBMsg = errors.New("db failed") + ArgsMsg = errors.New("args failed") + CallBackMsg = errors.New("callback failed") + + ThirdPartyMsg = errors.New("third party error") +) + +const ( + NoError = 0 + FormattingError = 10001 + HasRegistered = 10002 + NotRegistered = 10003 + PasswordErr = 10004 + GetIMTokenErr = 10005 + RepeatSendCode = 10006 + MailSendCodeErr = 10007 + SmsSendCodeErr = 10008 + CodeInvalidOrExpired = 10009 + RegisterFailed = 10010 + ResetPasswordFailed = 10011 + DatabaseError = 10002 + ServerError = 10004 + HttpError = 10005 + IoError = 10006 + IntentionalError = 10007 +) + +func (e ErrInfo) Error() string { + return e.ErrMsg +} + +func (e *ErrInfo) Code() int32 { + return e.ErrCode +} diff --git a/pkg/utils/platform_number_id_to_name.go b/pkg/common/constant/platform_number_id_to_name.go similarity index 94% rename from pkg/utils/platform_number_id_to_name.go rename to pkg/common/constant/platform_number_id_to_name.go index e9a3f7fed..c3a970b69 100644 --- a/pkg/utils/platform_number_id_to_name.go +++ b/pkg/common/constant/platform_number_id_to_name.go @@ -1,4 +1,4 @@ -package utils +package constant // fixme 1<--->IOS 2<--->Android 3<--->Windows //fixme 4<--->OSX 5<--->Web 6<--->MiniWeb 7<--->Linux @@ -48,10 +48,10 @@ var PlatformName2ID = map[string]int32{ var Platform2class = map[string]string{ IOSPlatformStr: TerminalMobile, AndroidPlatformStr: TerminalMobile, - MiniWebPlatformStr: TerminalMobile, + MiniWebPlatformStr: WebPlatformStr, + WebPlatformStr: WebPlatformStr, WindowsPlatformStr: TerminalPC, OSXPlatformStr: TerminalPC, - WebPlatformStr: TerminalPC, LinuxPlatformStr: TerminalPC, } diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index 494f8ffaf..e7b03cbd5 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -2,9 +2,22 @@ package db import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "fmt" + "go.mongodb.org/mongo-driver/mongo/options" + + // "context" + // "fmt" "github.com/garyburd/redigo/redis" "gopkg.in/mgo.v2" "time" + + "context" + //"go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + // "go.mongodb.org/mongo-driver/mongo/options" + ) var DB DataBases @@ -13,6 +26,7 @@ type DataBases struct { MysqlDB mysqlDB mgoSession *mgo.Session redisPool *redis.Pool + mongoClient *mongo.Client } func key(dbAddress, dbName string) string { @@ -20,30 +34,65 @@ func key(dbAddress, dbName string) string { } func init() { + //var mgoSession *mgo.Session + var mongoClient *mongo.Client + var err1 error //mysql init initMysqlDB() // mongo init - mgoDailInfo := &mgo.DialInfo{ - Addrs: config.Config.Mongo.DBAddress, - Direct: config.Config.Mongo.DBDirect, - Timeout: time.Second * time.Duration(config.Config.Mongo.DBTimeout), - Database: config.Config.Mongo.DBDatabase, - Source: config.Config.Mongo.DBSource, - Username: config.Config.Mongo.DBUserName, - Password: config.Config.Mongo.DBPassword, - PoolLimit: config.Config.Mongo.DBMaxPoolSize, + // "mongodb://sysop:moon@localhost/records" + uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority" + if config.Config.Mongo.DBUri != "" { + // example: mongodb://$user:$password@mongo1.mongo:27017,mongo2.mongo:27017,mongo3.mongo:27017/$DBDatabase/?replicaSet=rs0&readPreference=secondary&authSource=admin&maxPoolSize=$DBMaxPoolSize + uri = config.Config.Mongo.DBUri + } else { + uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", + config.Config.Mongo.DBAddress[0], config.Config.Mongo.DBDatabase, + config.Config.Mongo.DBMaxPoolSize) } - mgoSession, err := mgo.DialWithInfo(mgoDailInfo) - if err != nil { - panic(err) - } - DB.mgoSession = mgoSession - DB.mgoSession.SetMode(mgo.Monotonic, true) - c := DB.mgoSession.DB(config.Config.Mongo.DBDatabase).C(cChat) - err = c.EnsureIndexKey("uid") - if err != nil { - panic(err) + + mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) + if err != nil{ + log.NewError(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri) + time.Sleep(time.Duration(30) * time.Second) + mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) + if err1 != nil { + log.NewError(" mongo.Connect retry failed, panic", err.Error(), uri) + panic(err1.Error()) + } } + log.NewInfo("0", utils.GetSelfFuncName(), "mongo driver client init success") + DB.mongoClient = mongoClient + + //mgoDailInfo := &mgo.DialInfo{ + // Addrs: config.Config.Mongo.DBAddress, + // Direct: config.Config.Mongo.DBDirect, + // Timeout: time.Second * time.Duration(config.Config.Mongo.DBTimeout), + // Database: config.Config.Mongo.DBDatabase, + // Source: config.Config.Mongo.DBSource, + // Username: config.Config.Mongo.DBUserName, + // Password: config.Config.Mongo.DBPassword, + // PoolLimit: config.Config.Mongo.DBMaxPoolSize, + //} + //mgoSession, err = mgo.DialWithInfo(mgoDailInfo) + // + //if err != nil { + // + // mgoSession, err1 = mgo.DialWithInfo(mgoDailInfo) + // if err1 != nil { + // log.NewError(" mongo.Connect failed, panic", err.Error()) + // panic(err1.Error()) + // } + //} + + //DB.mgoSession = mgoSession + //DB.mgoSession.SetMode(mgo.Monotonic, true) + //c := DB.mgoSession.DB(config.Config.Mongo.DBDatabase).C(cChat) + //err = c.EnsureIndexKey("uid") + //if err != nil { + // panic(err.Error()) + //} + // // redis pool init DB.redisPool = &redis.Pool{ diff --git a/pkg/common/db/model_struct.go b/pkg/common/db/model_struct.go new file mode 100644 index 000000000..184f51e9d --- /dev/null +++ b/pkg/common/db/model_struct.go @@ -0,0 +1,218 @@ +package db + +import "time" + +type Register struct { + Account string `gorm:"column:account;primary_key;type:char(255)" json:"account"` + Password string `gorm:"column:password;type:varchar(255)" json:"password"` + Ex string `gorm:"column:ex;size:1024" json:"ex"` +} + +// +//message FriendInfo{ +//string OwnerUserID = 1; +//string Remark = 2; +//int64 CreateTime = 3; +//UserInfo FriendUser = 4; +//int32 AddSource = 5; +//string OperatorUserID = 6; +//string Ex = 7; +//} +//open_im_sdk.FriendInfo(FriendUser) != imdb.Friend(FriendUserID) +type Friend struct { + OwnerUserID string `gorm:"column:owner_user_id;primary_key;size:64"` + FriendUserID string `gorm:"column:friend_user_id;primary_key;size:64"` + Remark string `gorm:"column:remark;size:255"` + CreateTime time.Time `gorm:"column:create_time"` + AddSource int32 `gorm:"column:add_source"` + OperatorUserID string `gorm:"column:operator_user_id;size:64"` + Ex string `gorm:"column:ex;size:1024"` +} + +//message FriendRequest{ +//string FromUserID = 1; +//string ToUserID = 2; +//int32 HandleResult = 3; +//string ReqMsg = 4; +//int64 CreateTime = 5; +//string HandlerUserID = 6; +//string HandleMsg = 7; +//int64 HandleTime = 8; +//string Ex = 9; +//} +//open_im_sdk.FriendRequest(nickname, farce url ...) != imdb.FriendRequest +type FriendRequest struct { + FromUserID string `gorm:"column:from_user_id;primary_key;size:64"` + ToUserID string `gorm:"column:to_user_id;primary_key;size:64"` + HandleResult int32 `gorm:"column:handle_result"` + ReqMsg string `gorm:"column:req_msg;size:255"` + CreateTime time.Time `gorm:"column:create_time"` + HandlerUserID string `gorm:"column:handler_user_id;size:64"` + HandleMsg string `gorm:"column:handle_msg;size:255"` + HandleTime time.Time `gorm:"column:handle_time"` + Ex string `gorm:"column:ex;size:1024"` +} + +func (FriendRequest) TableName() string { + return "friend_requests" +} + +//message GroupInfo{ +// string GroupID = 1; +// string GroupName = 2; +// string Notification = 3; +// string Introduction = 4; +// string FaceUrl = 5; +// string OwnerUserID = 6; +// uint32 MemberCount = 8; +// int64 CreateTime = 7; +// string Ex = 9; +// int32 Status = 10; +// string CreatorUserID = 11; +// int32 GroupType = 12; +//} +// open_im_sdk.GroupInfo (OwnerUserID , MemberCount )> imdb.Group +type Group struct { + //`json:"operationID" binding:"required"` + //`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"` + GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"` + GroupName string `gorm:"column:name;size:255" json:"groupName"` + Notification string `gorm:"column:notification;size:255" json:"notification"` + Introduction string `gorm:"column:introduction;size:255" json:"introduction"` + FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` + CreateTime time.Time `gorm:"column:create_time"` + Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"` + Status int32 `gorm:"column:status"` + CreatorUserID string `gorm:"column:creator_user_id;size:64"` + GroupType int32 `gorm:"column:group_type"` +} + +//message GroupMemberFullInfo { +//string GroupID = 1 ; +//string UserID = 2 ; +//int32 roleLevel = 3; +//int64 JoinTime = 4; +//string NickName = 5; +//string FaceUrl = 6; +//int32 JoinSource = 8; +//string OperatorUserID = 9; +//string Ex = 10; +//int32 AppMangerLevel = 7; //if >0 +//} open_im_sdk.GroupMemberFullInfo(AppMangerLevel) > imdb.GroupMember +type GroupMember struct { + GroupID string `gorm:"column:group_id;primary_key;size:64"` + UserID string `gorm:"column:user_id;primary_key;size:64"` + Nickname string `gorm:"column:nickname;size:255"` + FaceURL string `gorm:"column:user_group_face_url;size:255"` + RoleLevel int32 `gorm:"column:role_level"` + JoinTime time.Time `gorm:"column:join_time"` + JoinSource int32 `gorm:"column:join_source"` + OperatorUserID string `gorm:"column:operator_user_id;size:64"` + Ex string `gorm:"column:ex;size:1024"` +} + +//message GroupRequest{ +//string UserID = 1; +//string GroupID = 2; +//string HandleResult = 3; +//string ReqMsg = 4; +//string HandleMsg = 5; +//int64 ReqTime = 6; +//string HandleUserID = 7; +//int64 HandleTime = 8; +//string Ex = 9; +//}open_im_sdk.GroupRequest == imdb.GroupRequest +type GroupRequest struct { + UserID string `gorm:"column:user_id;primary_key;size:64"` + GroupID string `gorm:"column:group_id;primary_key;size:64"` + HandleResult int32 `gorm:"column:handle_result"` + ReqMsg string `gorm:"column:req_msg;size:1024"` + HandledMsg string `gorm:"column:handle_msg;size:1024"` + ReqTime time.Time `gorm:"column:req_time"` + HandleUserID string `gorm:"column:handle_user_id;size:64"` + HandledTime time.Time `gorm:"column:handle_time"` + Ex string `gorm:"column:ex;size:1024"` +} + +//string UserID = 1; +//string Nickname = 2; +//string FaceUrl = 3; +//int32 Gender = 4; +//string PhoneNumber = 5; +//string Birth = 6; +//string Email = 7; +//string Ex = 8; +//int64 CreateTime = 9; +//int32 AppMangerLevel = 10; +//open_im_sdk.User == imdb.User +type User struct { + UserID string `gorm:"column:user_id;primary_key;size:64"` + Nickname string `gorm:"column:name;size:255"` + FaceURL string `gorm:"column:face_url;size:255"` + Gender int32 `gorm:"column:gender"` + PhoneNumber string `gorm:"column:phone_number;size:32"` + Birth time.Time `gorm:"column:birth"` + Email string `gorm:"column:email;size:64"` + Ex string `gorm:"column:ex;size:1024"` + CreateTime time.Time `gorm:"column:create_time"` + AppMangerLevel int32 `gorm:"column:app_manger_level"` +} + +//message BlackInfo{ +//string OwnerUserID = 1; +//int64 CreateTime = 2; +//PublicUserInfo BlackUserInfo = 4; +//int32 AddSource = 5; +//string OperatorUserID = 6; +//string Ex = 7; +//} +// open_im_sdk.BlackInfo(BlackUserInfo) != imdb.Black (BlockUserID) +type Black struct { + OwnerUserID string `gorm:"column:owner_user_id;primary_key;size:64"` + BlockUserID string `gorm:"column:block_user_id;primary_key;size:64"` + CreateTime time.Time `gorm:"column:create_time"` + AddSource int32 `gorm:"column:add_source"` + OperatorUserID string `gorm:"column:operator_user_id;size:64"` + Ex string `gorm:"column:ex;size:1024"` +} + +type ChatLog struct { + ServerMsgID string `gorm:"column:server_msg_id;primary_key;type:char(64)" json:"serverMsgID"` + ClientMsgID string `gorm:"column:client_msg_id;type:char(64)" json:"clientMsgID"` + SendID string `gorm:"column:send_id;type:char(64)" json:"sendID"` + RecvID string `gorm:"column:recv_id;type:char(64)" json:"recvID"` + SenderPlatformID int32 `gorm:"column:sender_platform_id" json:"senderPlatformID"` + SenderNickname string `gorm:"column:sender_nick_name;type:varchar(255)" json:"senderNickname"` + SenderFaceURL string `gorm:"column:sender_face_url;type:varchar(255)" json:"senderFaceURL"` + SessionType int32 `gorm:"column:session_type" json:"sessionType"` + MsgFrom int32 `gorm:"column:msg_from" json:"msgFrom"` + ContentType int32 `gorm:"column:content_type" json:"contentType"` + Content string `gorm:"column:content;type:varchar(3000)" json:"content"` + Status int32 `gorm:"column:status" json:"status"` + SendTime time.Time `gorm:"column:send_time" json:"sendTime"` + CreateTime time.Time `gorm:"column:create_time" json:"createTime"` + Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +} + +func (ChatLog) TableName() string { + return "chat_logs" +} + +type BlackList struct { + UserId string `gorm:"column:uid"` + BeginDisableTime time.Time `gorm:"column:begin_disable_time"` + EndDisableTime time.Time `gorm:"column:end_disable_time"` +} +type Conversation struct { + OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"` + ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"` + ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"` + UserID string `gorm:"column:user_id;type:char(64)" json:"userID"` + GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"` + RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"` + UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"` + DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"` + IsPinned bool `gorm:"column:is_pinned" json:"isPinned"` + AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"` + Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +} diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 93f64ff5f..3b489af23 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -2,18 +2,21 @@ package db import ( "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" pbMsg "Open_IM/pkg/proto/chat" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" "errors" - "github.com/garyburd/redigo/redis" + //"github.com/garyburd/redigo/redis" "github.com/golang/protobuf/proto" "gopkg.in/mgo.v2/bson" + "strconv" "time" ) -const cChat = "chat" +const cChat = "msg" const cGroup = "group" const singleGocMsgNum = 5000 @@ -27,111 +30,61 @@ type UserChat struct { Msg []MsgInfo } -type GroupMember struct { +type GroupMember_x struct { GroupID string UIDList []string } -func (d *DataBases) GetMsgBySeqRange(uid string, seqBegin, seqEnd int64) (SingleMsg []*pbMsg.MsgFormat, GroupMsg []*pbMsg.MsgFormat, MaxSeq int64, MinSeq int64, err error) { - var count int64 - session := d.mgoSession.Clone() - if session == nil { - return nil, nil, MaxSeq, MinSeq, errors.New("session == nil") - } - defer session.Close() - - c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) - - sChat := UserChat{} - if err = c.Find(bson.M{"uid": uid}).One(&sChat); err != nil { - return nil, nil, MaxSeq, MinSeq, err - } - pChat := pbMsg.MsgSvrToPushSvrChatMsg{} - for i := 0; i < len(sChat.Msg); i++ { - temp := new(pbMsg.MsgFormat) - if err = proto.Unmarshal(sChat.Msg[i].Msg, &pChat); err != nil { - return nil, nil, MaxSeq, MinSeq, err - } - if pChat.RecvSeq >= seqBegin && pChat.RecvSeq <= seqEnd { - temp.SendID = pChat.SendID - temp.RecvID = pChat.RecvID - temp.MsgFrom = pChat.MsgFrom - temp.Seq = pChat.RecvSeq - temp.ServerMsgID = pChat.MsgID - temp.SendTime = pChat.SendTime - temp.Content = pChat.Content - temp.ContentType = pChat.ContentType - temp.SenderPlatformID = pChat.PlatformID - temp.ClientMsgID = pChat.ClientMsgID - temp.SenderFaceURL = pChat.SenderFaceURL - temp.SenderNickName = pChat.SenderNickName - if pChat.RecvSeq > MaxSeq { - MaxSeq = pChat.RecvSeq - } - if count == 0 { - MinSeq = pChat.RecvSeq - } - if pChat.RecvSeq < MinSeq { - MinSeq = pChat.RecvSeq - } - if pChat.SessionType == constant.SingleChatType { - SingleMsg = append(SingleMsg, temp) - } else { - GroupMsg = append(GroupMsg, temp) - } - count++ - if count == (seqEnd - seqBegin + 1) { - break - } - } - } - - return SingleMsg, GroupMsg, MaxSeq, MinSeq, nil +func (d *DataBases) GetMinSeqFromMongo(uid string) (MinSeq uint32, err error) { + return 1, nil + //var i, NB uint32 + //var seqUid string + //session := d.mgoSession.Clone() + //if session == nil { + // return MinSeq, errors.New("session == nil") + //} + //defer session.Close() + //c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + //MaxSeq, err := d.GetUserMaxSeq(uid) + //if err != nil && err != redis.ErrNil { + // return MinSeq, err + //} + //NB = uint32(MaxSeq / singleGocMsgNum) + //for i = 0; i <= NB; i++ { + // seqUid = indexGen(uid, i) + // n, err := c.Find(bson.M{"uid": seqUid}).Count() + // if err == nil && n != 0 { + // if i == 0 { + // MinSeq = 1 + // } else { + // MinSeq = uint32(i * singleGocMsgNum) + // } + // break + // } + //} + //return MinSeq, nil } -func (d *DataBases) GetMinSeqFromMongo(uid string) (MinSeq int64, err error) { - var i int64 - var seqUid string - session := d.mgoSession.Clone() - if session == nil { - return MinSeq, errors.New("session == nil") - } - defer session.Close() - c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) - MaxSeq, err := d.GetUserMaxSeq(uid) - if err != nil && err != redis.ErrNil { - return MinSeq, err - } - NB := MaxSeq / singleGocMsgNum - for i = 0; i <= NB; i++ { - seqUid = indexGen(uid, i) - n, err := c.Find(bson.M{"uid": seqUid}).Count() - if err == nil && n != 0 { - if i == 0 { - MinSeq = 1 - } else { - MinSeq = i * singleGocMsgNum - } - break - } - } - return MinSeq, nil + +func (d *DataBases) GetMinSeqFromMongo2(uid string) (MinSeq uint32, err error) { + return 1, nil } -func (d *DataBases) GetMsgBySeqList(uid string, seqList []int64) (SingleMsg []*pbMsg.MsgFormat, GroupMsg []*pbMsg.MsgFormat, MaxSeq int64, MinSeq int64, err error) { - allCount := 0 + +func (d *DataBases) GetMsgBySeqList(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) { + log.NewInfo(operationID, utils.GetSelfFuncName(), uid, seqList) + var hasSeqList []uint32 singleCount := 0 session := d.mgoSession.Clone() if session == nil { - return nil, nil, MaxSeq, MinSeq, errors.New("session == nil") + return nil, errors.New("session == nil") } defer session.Close() - c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) - m := func(uid string, seqList []int64) map[string][]int64 { - t := make(map[string][]int64) + m := func(uid string, seqList []uint32) map[string][]uint32 { + t := make(map[string][]uint32) for i := 0; i < len(seqList); i++ { seqUid := getSeqUid(uid, seqList[i]) if value, ok := t[seqUid]; !ok { - var temp []int64 + var temp []uint32 t[seqUid] = append(temp, seqList[i]) } else { t[seqUid] = append(value, seqList[i]) @@ -140,47 +93,21 @@ func (d *DataBases) GetMsgBySeqList(uid string, seqList []int64) (SingleMsg []*p return t }(uid, seqList) sChat := UserChat{} - pChat := pbMsg.MsgSvrToPushSvrChatMsg{} for seqUid, value := range m { if err = c.Find(bson.M{"uid": seqUid}).One(&sChat); err != nil { - log.NewError("", "not find seqUid", seqUid, value, uid, seqList) + log.NewError(operationID, "not find seqUid", seqUid, value, uid, seqList, err.Error()) continue } singleCount = 0 for i := 0; i < len(sChat.Msg); i++ { - temp := new(pbMsg.MsgFormat) - if err = proto.Unmarshal(sChat.Msg[i].Msg, &pChat); err != nil { - log.NewError("", "not find seqUid", seqUid, value, uid, seqList) - return nil, nil, MaxSeq, MinSeq, err + msg := new(open_im_sdk.MsgData) + if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil { + log.NewError(operationID, "Unmarshal err", seqUid, value, uid, seqList, err.Error()) + return nil, err } - if isContainInt64(pChat.RecvSeq, value) { - temp.SendID = pChat.SendID - temp.RecvID = pChat.RecvID - temp.MsgFrom = pChat.MsgFrom - temp.Seq = pChat.RecvSeq - temp.ServerMsgID = pChat.MsgID - temp.SendTime = pChat.SendTime - temp.Content = pChat.Content - temp.ContentType = pChat.ContentType - temp.SenderPlatformID = pChat.PlatformID - temp.ClientMsgID = pChat.ClientMsgID - temp.SenderFaceURL = pChat.SenderFaceURL - temp.SenderNickName = pChat.SenderNickName - if pChat.RecvSeq > MaxSeq { - MaxSeq = pChat.RecvSeq - } - if allCount == 0 { - MinSeq = pChat.RecvSeq - } - if pChat.RecvSeq < MinSeq { - MinSeq = pChat.RecvSeq - } - if pChat.SessionType == constant.SingleChatType { - SingleMsg = append(SingleMsg, temp) - } else { - GroupMsg = append(GroupMsg, temp) - } - allCount++ + if isContainInt32(msg.Seq, value) { + seqMsg = append(seqMsg, msg) + hasSeqList = append(hasSeqList, msg.Seq) singleCount++ if singleCount == len(value) { break @@ -188,9 +115,111 @@ func (d *DataBases) GetMsgBySeqList(uid string, seqList []int64) (SingleMsg []*p } } } - return SingleMsg, GroupMsg, MaxSeq, MinSeq, nil + if len(hasSeqList) != len(seqList) { + var diff []uint32 + diff = utils.Difference(hasSeqList, seqList) + exceptionMSg := genExceptionMessageBySeqList(diff) + seqMsg = append(seqMsg, exceptionMSg...) + + } + return seqMsg, nil } -func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgSvrToPushSvrChatMsg) error { + + +func (d *DataBases) GetMsgBySeqListMongo2(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) { + var hasSeqList []uint32 + singleCount := 0 + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + + m := func(uid string, seqList []uint32) map[string][]uint32 { + t := make(map[string][]uint32) + for i := 0; i < len(seqList); i++ { + seqUid := getSeqUid(uid, seqList[i]) + if value, ok := t[seqUid]; !ok { + var temp []uint32 + t[seqUid] = append(temp, seqList[i]) + } else { + t[seqUid] = append(value, seqList[i]) + } + } + return t + }(uid, seqList) + sChat := UserChat{} + for seqUid, value := range m { + if err = c.FindOne(ctx, bson.M{"uid": seqUid}).Decode(&sChat); err != nil { + log.NewError(operationID, "not find seqUid", seqUid, value, uid, seqList, err.Error()) + continue + } + singleCount = 0 + for i := 0; i < len(sChat.Msg); i++ { + msg := new(open_im_sdk.MsgData) + if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil { + log.NewError(operationID, "Unmarshal err", seqUid, value, uid, seqList, err.Error()) + return nil, err + } + if isContainInt32(msg.Seq, value) { + seqMsg = append(seqMsg, msg) + hasSeqList = append(hasSeqList, msg.Seq) + singleCount++ + if singleCount == len(value) { + break + } + } + } + } + if len(hasSeqList) != len(seqList) { + var diff []uint32 + diff = utils.Difference(hasSeqList, seqList) + exceptionMSg := genExceptionMessageBySeqList(diff) + seqMsg = append(seqMsg, exceptionMSg...) + + } + return seqMsg, nil +} + + +func genExceptionMessageBySeqList(seqList []uint32) (exceptionMsg []*open_im_sdk.MsgData) { + for _, v := range seqList { + msg := new(open_im_sdk.MsgData) + msg.Seq = v + exceptionMsg = append(exceptionMsg, msg) + } + return exceptionMsg +} + +func (d *DataBases) SaveUserChatMongo2(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + newTime := getCurrentTimestampByMill() + operationID := "" + seqUid := getSeqUid(uid, m.MsgData.Seq) + filter := bson.M{"uid": seqUid} + var err error + sMsg := MsgInfo{} + sMsg.SendTime = sendTime + if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil { + return utils.Wrap(err,"") + } + err = c.FindOneAndUpdate(ctx, filter, bson.M{"$push": bson.M{"msg": sMsg}}).Err() + log.NewDebug(operationID, "get mgoSession cost time", getCurrentTimestampByMill()-newTime) + if err != nil { + sChat := UserChat{} + sChat.UID = seqUid + sChat.Msg = append(sChat.Msg, sMsg) + if _, err = c.InsertOne(ctx, &sChat) ; err != nil{ + log.NewDebug(operationID, "InsertOne failed", filter) + return utils.Wrap(err, "") + } + }else{ + log.NewDebug(operationID, "FindOneAndUpdate ok", filter) + } + + log.NewDebug(operationID, "find mgo uid cost time", getCurrentTimestampByMill()-newTime) + return nil +} + +func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error { var seqUid string newTime := getCurrentTimestampByMill() session := d.mgoSession.Clone() @@ -198,17 +227,17 @@ func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgSvrToPu return errors.New("session == nil") } defer session.Close() - log.NewInfo("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime) + log.NewDebug("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime) c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) - seqUid = getSeqUid(uid, m.RecvSeq) + seqUid = getSeqUid(uid, m.MsgData.Seq) n, err := c.Find(bson.M{"uid": seqUid}).Count() if err != nil { return err } - log.NewInfo("", "find mgo uid cost time", getCurrentTimestampByMill()-newTime) + log.NewDebug("", "find mgo uid cost time", getCurrentTimestampByMill()-newTime) sMsg := MsgInfo{} sMsg.SendTime = sendTime - if sMsg.Msg, err = proto.Marshal(m); err != nil { + if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil { return err } if n == 0 { @@ -225,129 +254,151 @@ func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgSvrToPu return err } } - log.NewInfo("", "insert mgo data cost time", getCurrentTimestampByMill()-newTime) + log.NewDebug("", "insert mgo data cost time", getCurrentTimestampByMill()-newTime) return nil } + func (d *DataBases) DelUserChat(uid string) error { - session := d.mgoSession.Clone() - if session == nil { - return errors.New("session == nil") - } - defer session.Close() + return nil + //session := d.mgoSession.Clone() + //if session == nil { + // return errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + // + //delTime := time.Now().Unix() - int64(config.Config.Mongo.DBRetainChatRecords)*24*3600 + //if err := c.Update(bson.M{"uid": uid}, bson.M{"$pull": bson.M{"msg": bson.M{"sendtime": bson.M{"$lte": delTime}}}}); err != nil { + // return err + //} + // + //return nil +} - c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + +func (d *DataBases) DelUserChatMongo2(uid string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + filter := bson.M{"uid": uid} delTime := time.Now().Unix() - int64(config.Config.Mongo.DBRetainChatRecords)*24*3600 - if err := c.Update(bson.M{"uid": uid}, bson.M{"$pull": bson.M{"msg": bson.M{"sendtime": bson.M{"$lte": delTime}}}}); err != nil { - return err + if _, err := c.UpdateOne(ctx, filter, bson.M{"$pull": bson.M{"msg": bson.M{"sendtime": bson.M{"$lte": delTime}}}}); err != nil { + return utils.Wrap(err, "") } - return nil } + + func (d *DataBases) MgoUserCount() (int, error) { - session := d.mgoSession.Clone() - if session == nil { - return 0, errors.New("session == nil") - } - defer session.Close() - - c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) - - return c.Find(nil).Count() + return 0, nil + //session := d.mgoSession.Clone() + //if session == nil { + // return 0, errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + // + //return c.Find(nil).Count() } func (d *DataBases) MgoSkipUID(count int) (string, error) { - session := d.mgoSession.Clone() - if session == nil { - return "", errors.New("session == nil") - } - defer session.Close() - - c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) - - sChat := UserChat{} - c.Find(nil).Skip(count).Limit(1).One(&sChat) - return sChat.UID, nil + return "", nil + //session := d.mgoSession.Clone() + //if session == nil { + // return "", errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + // + //sChat := UserChat{} + //c.Find(nil).Skip(count).Limit(1).One(&sChat) + //return sChat.UID, nil } func (d *DataBases) GetGroupMember(groupID string) []string { - groupInfo := GroupMember{} - groupInfo.GroupID = groupID - groupInfo.UIDList = make([]string, 0) - - session := d.mgoSession.Clone() - if session == nil { - return groupInfo.UIDList - } - defer session.Close() - - c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) - - if err := c.Find(bson.M{"groupid": groupInfo.GroupID}).One(&groupInfo); err != nil { - return groupInfo.UIDList - } - - return groupInfo.UIDList + return nil + //groupInfo := GroupMember_x{} + //groupInfo.GroupID = groupID + //groupInfo.UIDList = make([]string, 0) + // + //session := d.mgoSession.Clone() + //if session == nil { + // return groupInfo.UIDList + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) + // + //if err := c.Find(bson.M{"groupid": groupInfo.GroupID}).One(&groupInfo); err != nil { + // return groupInfo.UIDList + //} + // + //return groupInfo.UIDList } func (d *DataBases) AddGroupMember(groupID, uid string) error { - session := d.mgoSession.Clone() - if session == nil { - return errors.New("session == nil") - } - defer session.Close() - - c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) - - n, err := c.Find(bson.M{"groupid": groupID}).Count() - if err != nil { - return err - } - - if n == 0 { - groupInfo := GroupMember{} - groupInfo.GroupID = groupID - groupInfo.UIDList = append(groupInfo.UIDList, uid) - err = c.Insert(&groupInfo) - if err != nil { - return err - } - } else { - err = c.Update(bson.M{"groupid": groupID}, bson.M{"$addToSet": bson.M{"uidlist": uid}}) - if err != nil { - return err - } - } - return nil + //session := d.mgoSession.Clone() + //if session == nil { + // return errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) + // + //n, err := c.Find(bson.M{"groupid": groupID}).Count() + //if err != nil { + // return err + //} + // + //if n == 0 { + // groupInfo := GroupMember_x{} + // groupInfo.GroupID = groupID + // groupInfo.UIDList = append(groupInfo.UIDList, uid) + // err = c.Insert(&groupInfo) + // if err != nil { + // return err + // } + //} else { + // err = c.Update(bson.M{"groupid": groupID}, bson.M{"$addToSet": bson.M{"uidlist": uid}}) + // if err != nil { + // return err + // } + //} + // + //return nil } func (d *DataBases) DelGroupMember(groupID, uid string) error { - session := d.mgoSession.Clone() - if session == nil { - return errors.New("session == nil") - } - defer session.Close() - - c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) - - if err := c.Update(bson.M{"groupid": groupID}, bson.M{"$pull": bson.M{"uidlist": uid}}); err != nil { - return err - } - return nil + //session := d.mgoSession.Clone() + //if session == nil { + // return errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) + // + //if err := c.Update(bson.M{"groupid": groupID}, bson.M{"$pull": bson.M{"uidlist": uid}}); err != nil { + // return err + //} + // + //return nil } func getCurrentTimestampByMill() int64 { return time.Now().UnixNano() / 1e6 } -func getSeqUid(uid string, seq int64) string { +func getSeqUid(uid string, seq uint32) string { seqSuffix := seq / singleGocMsgNum return indexGen(uid, seqSuffix) } -func isContainInt64(target int64, List []int64) bool { +func isContainInt32(target uint32, List []uint32) bool { for _, element := range List { @@ -358,6 +409,6 @@ func isContainInt64(target int64, List []int64) bool { return false } -func indexGen(uid string, seqSuffix int64) string { - return uid + ":" + strconv.FormatInt(seqSuffix, 10) +func indexGen(uid string, seqSuffix uint32) string { + return uid + ":" + strconv.FormatInt(int64(seqSuffix), 10) } diff --git a/pkg/common/db/mysql.go b/pkg/common/db/mysql.go index e3794b360..ad35cd5da 100644 --- a/pkg/common/db/mysql.go +++ b/pkg/common/db/mysql.go @@ -4,10 +4,11 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "fmt" - "github.com/jinzhu/gorm" - _ "github.com/jinzhu/gorm/dialects/mysql" "sync" "time" + + "github.com/jinzhu/gorm" + _ "github.com/jinzhu/gorm/dialects/mysql" ) type mysqlDB struct { @@ -19,18 +20,27 @@ func initMysqlDB() { //When there is no open IM database, connect to the mysql built-in database to create openIM database dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local", config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], "mysql") - + var db *gorm.DB + var err1 error db, err := gorm.Open("mysql", dsn) if err != nil { - log.Error("", "", dsn) - panic(err) + log.NewError("0", "Open failed ", err.Error(), dsn) + } + if err != nil { + time.Sleep(time.Duration(30) * time.Second) + db, err1 = gorm.Open("mysql", dsn) + if err1 != nil { + log.NewError("0", "Open failed ", err1.Error(), dsn) + panic(err1.Error()) + } } //Check the database and table during initialization - sql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s ;", config.Config.Mysql.DBDatabaseName) + sql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s default charset utf8 COLLATE utf8_general_ci;", config.Config.Mysql.DBDatabaseName) err = db.Exec(sql).Error if err != nil { - panic(err) + log.NewError("0", "Exec failed ", err.Error(), sql) + panic(err.Error()) } db.Close() @@ -38,142 +48,201 @@ func initMysqlDB() { config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], config.Config.Mysql.DBDatabaseName) db, err = gorm.Open("mysql", dsn) if err != nil { - panic(err) + log.NewError("0", "Open failed ", err.Error(), dsn) + panic(err.Error()) } - sqlTable := "CREATE TABLE IF NOT EXISTS `user` ("+ - " `uid` varchar(64) NOT NULL,"+ - " `name` varchar(64) DEFAULT NULL,"+ - " `icon` varchar(1024) DEFAULT NULL,"+ - " `gender` tinyint(4) unsigned zerofill DEFAULT NULL,"+ - " `mobile` varchar(32) DEFAULT NULL,"+ - " `birth` varchar(16) DEFAULT NULL,"+ - " `email` varchar(64) DEFAULT NULL,"+ - " `ex` varchar(1024) DEFAULT NULL,"+ - " `create_time` datetime DEFAULT NULL,"+ - " PRIMARY KEY (`uid`),"+ - " UNIQUE KEY `uk_uid` (`uid`)"+ + log.NewInfo("open db ok ", dsn) + db.AutoMigrate(&Friend{}, + &FriendRequest{}, + &Group{}, + &GroupMember{}, + &GroupRequest{}, + &User{}, + &Black{}, &ChatLog{}, &Register{}, &Conversation{}) + db.Set("gorm:table_options", "CHARSET=utf8") + db.Set("gorm:table_options", "collation=utf8_unicode_ci") + + if !db.HasTable(&Friend{}) { + log.NewInfo("CreateTable Friend") + db.CreateTable(&Friend{}) + } + + if !db.HasTable(&FriendRequest{}) { + log.NewInfo("CreateTable FriendRequest") + db.CreateTable(&FriendRequest{}) + } + + if !db.HasTable(&Group{}) { + log.NewInfo("CreateTable Group") + db.CreateTable(&Group{}) + } + + if !db.HasTable(&GroupMember{}) { + log.NewInfo("CreateTable GroupMember") + db.CreateTable(&GroupMember{}) + } + + if !db.HasTable(&GroupRequest{}) { + log.NewInfo("CreateTable GroupRequest") + db.CreateTable(&GroupRequest{}) + } + + if !db.HasTable(&User{}) { + log.NewInfo("CreateTable User") + db.CreateTable(&User{}) + } + + if !db.HasTable(&Black{}) { + log.NewInfo("CreateTable Black") + db.CreateTable(&Black{}) + } + if !db.HasTable(&ChatLog{}) { + log.NewInfo("CreateTable Black") + db.CreateTable(&ChatLog{}) + } + if !db.HasTable(&Register{}) { + log.NewInfo("CreateTable Black") + db.CreateTable(&Register{}) + } + if !db.HasTable(&Conversation{}) { + log.NewInfo("CreateTable Black") + db.CreateTable(&Conversation{}) + } + + return + + sqlTable := "CREATE TABLE IF NOT EXISTS `user` (" + + " `uid` varchar(64) NOT NULL," + + " `name` varchar(64) DEFAULT NULL," + + " `icon` varchar(1024) DEFAULT NULL," + + " `gender` tinyint(4) unsigned zerofill DEFAULT NULL," + + " `mobile` varchar(32) DEFAULT NULL," + + " `birth` varchar(16) DEFAULT NULL," + + " `email` varchar(64) DEFAULT NULL," + + " `ex` varchar(1024) DEFAULT NULL," + + " `create_time` datetime DEFAULT NULL," + + " PRIMARY KEY (`uid`)," + + " UNIQUE KEY `uk_uid` (`uid`)" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) } - sqlTable = "CREATE TABLE IF NOT EXISTS `friend` ("+ - " `owner_id` varchar(64) NOT NULL,"+ - " `friend_id` varchar(64) NOT NULL,"+ - " `comment` varchar(255) DEFAULT NULL,"+ - " `friend_flag` int(11) NOT NULL,"+ - " `create_time` datetime NOT NULL,"+ - " PRIMARY KEY (`owner_id`,`friend_id`) USING BTREE"+ + sqlTable = "CREATE TABLE IF NOT EXISTS `friend` (" + + " `owner_id` varchar(64) NOT NULL," + + " `friend_id` varchar(64) NOT NULL," + + " `comment` varchar(255) DEFAULT NULL," + + " `friend_flag` int(11) NOT NULL," + + " `create_time` datetime NOT NULL," + + " PRIMARY KEY (`owner_id`,`friend_id`) USING BTREE" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) } - sqlTable = "CREATE TABLE IF NOT EXISTS `friend_request` ("+ - " `req_id` varchar(64) NOT NULL,"+ - " `user_id` varchar(64) NOT NULL,"+ - " `flag` int(11) NOT NULL DEFAULT '0',"+ - " `req_message` varchar(255) DEFAULT NULL,"+ - " `create_time` datetime NOT NULL,"+ - " PRIMARY KEY (`user_id`,`req_id`) USING BTREE"+ + sqlTable = "CREATE TABLE IF NOT EXISTS `friend_request` (" + + " `req_id` varchar(64) NOT NULL," + + " `user_id` varchar(64) NOT NULL," + + " `flag` int(11) NOT NULL DEFAULT '0'," + + " `req_message` varchar(255) DEFAULT NULL," + + " `create_time` datetime NOT NULL," + + " PRIMARY KEY (`user_id`,`req_id`) USING BTREE" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) } - sqlTable = "CREATE TABLE IF NOT EXISTS `black_list` ("+ - " `uid` varchar(32) NOT NULL COMMENT 'uid',"+ - " `begin_disable_time` datetime DEFAULT NULL,"+ - " `end_disable_time` datetime DEFAULT NULL,"+ - " `ex` varchar(1024) DEFAULT NULL,"+ - " PRIMARY KEY (`uid`) USING BTREE"+ + sqlTable = "CREATE TABLE IF NOT EXISTS `user_black_list` (" + + " `owner_id` varchar(64) NOT NULL," + + " `block_id` varchar(64) NOT NULL," + + " `create_time` datetime NOT NULL," + + " PRIMARY KEY (`owner_id`,`block_id`) USING BTREE" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) } - sqlTable = "CREATE TABLE IF NOT EXISTS `user_black_list` ("+ - " `owner_id` varchar(64) NOT NULL,"+ - " `block_id` varchar(64) NOT NULL,"+ - " `create_time` datetime NOT NULL,"+ - " PRIMARY KEY (`owner_id`,`block_id`) USING BTREE"+ + sqlTable = "CREATE TABLE IF NOT EXISTS `group` (" + + " `group_id` varchar(64) NOT NULL," + + " `name` varchar(255) DEFAULT NULL," + + " `introduction` varchar(255) DEFAULT NULL," + + " `notification` varchar(255) DEFAULT NULL," + + " `face_url` varchar(255) DEFAULT NULL," + + " `create_time` datetime DEFAULT NULL," + + " `ex` varchar(255) DEFAULT NULL," + + " PRIMARY KEY (`group_id`)" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) } - sqlTable = "CREATE TABLE IF NOT EXISTS `group` ("+ - " `group_id` varchar(64) NOT NULL,"+ - " `name` varchar(255) DEFAULT NULL,"+ - " `introduction` varchar(255) DEFAULT NULL,"+ - " `notification` varchar(255) DEFAULT NULL,"+ - " `face_url` varchar(255) DEFAULT NULL,"+ - " `create_time` datetime DEFAULT NULL,"+ - " `ex` varchar(255) DEFAULT NULL,"+ - " PRIMARY KEY (`group_id`)"+ + sqlTable = "CREATE TABLE IF NOT EXISTS `group_member` (" + + " `group_id` varchar(64) NOT NULL," + + " `uid` varchar(64) NOT NULL," + + " `nickname` varchar(255) DEFAULT NULL," + + " `user_group_face_url` varchar(255) DEFAULT NULL," + + " `administrator_level` int(11) NOT NULL," + + " `join_time` datetime NOT NULL," + + " PRIMARY KEY (`group_id`,`uid`) USING BTREE" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) } - sqlTable = "CREATE TABLE IF NOT EXISTS `group_member` ("+ - " `group_id` varchar(64) NOT NULL,"+ - " `uid` varchar(64) NOT NULL,"+ - " `nickname` varchar(255) DEFAULT NULL,"+ - " `user_group_face_url` varchar(255) DEFAULT NULL,"+ - " `administrator_level` int(11) NOT NULL,"+ - " `join_time` datetime NOT NULL,"+ - " PRIMARY KEY (`group_id`,`uid`) USING BTREE"+ - " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;" - err = db.Exec(sqlTable).Error - if err != nil { - panic(err) - } - - sqlTable = "CREATE TABLE IF NOT EXISTS `group_request` ("+ - " `id` int(11) NOT NULL AUTO_INCREMENT,"+ - " `group_id` varchar(64) NOT NULL,"+ - " `from_user_id` varchar(255) NOT NULL,"+ - " `to_user_id` varchar(255) NOT NULL,"+ - " `flag` int(10) NOT NULL DEFAULT '0',"+ - " `req_msg` varchar(255) DEFAULT '',"+ - " `handled_msg` varchar(255) DEFAULT '',"+ - " `create_time` datetime NOT NULL,"+ - " `from_user_nickname` varchar(255) DEFAULT '',"+ - " `to_user_nickname` varchar(255) DEFAULT NULL,"+ - " `from_user_face_url` varchar(255) DEFAULT '',"+ - " `to_user_face_url` varchar(255) DEFAULT '',"+ - " `handled_user` varchar(255) DEFAULT '',"+ - " PRIMARY KEY (`id`)"+ + sqlTable = "CREATE TABLE IF NOT EXISTS `group_request` (" + + " `id` int(11) NOT NULL AUTO_INCREMENT," + + " `group_id` varchar(64) NOT NULL," + + " `from_user_id` varchar(255) NOT NULL," + + " `to_user_id` varchar(255) NOT NULL," + + " `flag` int(10) NOT NULL DEFAULT '0'," + + " `req_msg` varchar(255) DEFAULT ''," + + " `handled_msg` varchar(255) DEFAULT ''," + + " `create_time` datetime NOT NULL," + + " `from_user_nickname` varchar(255) DEFAULT ''," + + " `to_user_nickname` varchar(255) DEFAULT NULL," + + " `from_user_face_url` varchar(255) DEFAULT ''," + + " `to_user_face_url` varchar(255) DEFAULT ''," + + " `handled_user` varchar(255) DEFAULT ''," + + " PRIMARY KEY (`id`)" + " ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) } - sqlTable = "CREATE TABLE IF NOT EXISTS `chat_log` ("+ - " `msg_id` varchar(128) NOT NULL,"+ - " `send_id` varchar(255) NOT NULL,"+ - " `session_type` int(11) NOT NULL,"+ - " `recv_id` varchar(255) NOT NULL,"+ - " `content_type` int(11) NOT NULL,"+ - " `msg_from` int(11) NOT NULL,"+ - " `content` varchar(1000) NOT NULL,"+ - " `remark` varchar(100) DEFAULT NULL,"+ - " `sender_platform_id` int(11) NOT NULL,"+ - " `send_time` datetime NOT NULL,"+ - " PRIMARY KEY (`msg_id`) USING BTREE"+ + sqlTable = "CREATE TABLE IF NOT EXISTS `chat_log` (" + + " `msg_id` varchar(128) NOT NULL," + + " `send_id` varchar(255) NOT NULL," + + " `session_type` int(11) NOT NULL," + + " `recv_id` varchar(255) NOT NULL," + + " `content_type` int(11) NOT NULL," + + " `msg_from` int(11) NOT NULL," + + " `content` varchar(1000) NOT NULL," + + " `remark` varchar(100) DEFAULT NULL," + + " `sender_platform_id` int(11) NOT NULL," + + " `send_time` datetime NOT NULL," + + " PRIMARY KEY (`msg_id`) USING BTREE" + " ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;" err = db.Exec(sqlTable).Error if err != nil { - panic(err) + panic(err.Error()) + } + + sqlTable = "CREATE TABLE IF NOT EXISTS `register` (" + + " `account` varchar(255) NOT NULL," + + " `password` varchar(255) NOT NULL," + + " PRIMARY KEY (`account`) USING BTREE" + + " ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;" + err = db.Exec(sqlTable).Error + if err != nil { + panic(err.Error()) } } diff --git a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go new file mode 100644 index 000000000..897e5e212 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go @@ -0,0 +1,41 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + _ "github.com/jinzhu/gorm" +) + +func GetRegister(account string) (*db.Register, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var r db.Register + return &r, dbConn.Table("registers").Where("account = ?", + account).Take(&r).Error +} + +func SetPassword(account, password, ex string) error { + r := db.Register{ + Account: account, + Password: password, + Ex: ex, + } + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + return dbConn.Table("registers").Create(&r).Error +} + +func ResetPassword(account, password string) error { + r := db.Register{ + Password: password, + } + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + dbConn.LogMode(true) + if err != nil { + return err + } + return dbConn.Table("registers").Where("account = ?", account).Update(&r).Error +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go index ce029a0bb..700082353 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go @@ -6,64 +6,73 @@ import ( "time" ) -func InsertToFriend(ownerId, friendId string, flag int32) error { +func InsertToFriend(toInsertFollow *db.Friend) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - toInsertFollow := Friend{ - OwnerId: ownerId, - FriendId: friendId, - FriendFlag: flag, - CreateTime: time.Now(), - } - err = dbConn.Table("friend").Create(toInsertFollow).Error + toInsertFollow.CreateTime = time.Now() + + err = dbConn.Table("friends").Create(toInsertFollow).Error if err != nil { return err } return nil } -func FindFriendRelationshipFromFriend(ownerId, friendId string) (*Friend, error) { +func GetFriendRelationshipFromFriend(OwnerUserID, FriendUserID string) (*db.Friend, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var friend Friend - err = dbConn.Table("friend").Where("owner_id=? and friend_id=?", ownerId, friendId).Find(&friend).Error + var friend db.Friend + err = dbConn.Table("friends").Where("owner_user_id=? and friend_user_id=?", OwnerUserID, FriendUserID).Take(&friend).Error if err != nil { return nil, err } return &friend, err } -func FindUserInfoFromFriend(ownerId string) ([]Friend, error) { +func GetFriendListByUserID(OwnerUserID string) ([]db.Friend, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var friends []Friend - err = dbConn.Table("friend").Where("owner_id=?", ownerId).Find(&friends).Error + var friends []db.Friend + var x db.Friend + x.OwnerUserID = OwnerUserID + err = dbConn.Table("friends").Where("owner_user_id=?", OwnerUserID).Find(&friends).Error + if err != nil { return nil, err } return friends, nil } -func UpdateFriendComment(ownerId, friendId, comment string) error { +func UpdateFriendComment(OwnerUserID, FriendUserID, Remark string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - err = dbConn.Exec("update friend set comment=? where owner_id=? and friend_id=?", comment, ownerId, friendId).Error + err = dbConn.Exec("update friends set remark=? where owner_user_id=? and friend_user_id=?", Remark, OwnerUserID, FriendUserID).Error return err } -func DeleteSingleFriendInfo(ownerId, friendId string) error { +func DeleteSingleFriendInfo(OwnerUserID, FriendUserID string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - err = dbConn.Table("friend").Where("owner_id=? and friend_id=?", ownerId, friendId).Delete(Friend{}).Error + err = dbConn.Table("friends").Where("owner_user_id=? and friend_user_id=?", OwnerUserID, FriendUserID).Delete(db.Friend{}).Error return err } + +//type Friend struct { +// OwnerUserID string `gorm:"column:owner_user_id;primaryKey;"` +// FriendUserID string `gorm:"column:friend_user_id;primaryKey;"` +// Remark string `gorm:"column:remark"` +// CreateTime time.Time `gorm:"column:create_time"` +// AddSource int32 `gorm:"column:add_source"` +// OperatorUserID string `gorm:"column:operator_user_id"` +// Ex string `gorm:"column:ex"` +//} diff --git a/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go index 1a7308cb9..171a6aedf 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go @@ -2,67 +2,109 @@ package im_mysql_model import ( "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" "time" ) -func ReplaceIntoFriendReq(reqId, userId string, flag int32, reqMessage string) error { - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return err - } - err = dbConn.Exec("replace into friend_request(req_id,user_id,flag,req_message,create_time) values(?,?,?,?,?)", reqId, userId, flag, reqMessage, time.Now()).Error - if err != nil { - return err - } - return nil -} +//type FriendRequest struct { +// FromUserID string `gorm:"column:from_user_id;primaryKey;"` +// ToUserID string `gorm:"column:to_user_id;primaryKey;"` +// HandleResult int32 `gorm:"column:handle_result"` +// ReqMessage string `gorm:"column:req_message"` +// CreateTime time.Time `gorm:"column:create_time"` +// HandlerUserID string `gorm:"column:handler_user_id"` +// HandleMsg string `gorm:"column:handle_msg"` +// HandleTime time.Time `gorm:"column:handle_time"` +// Ex string `gorm:"column:ex"` +//} -func FindFriendsApplyFromFriendReq(userId string) ([]FriendRequest, error) { +// who apply to add me +func GetReceivedFriendsApplicationListByUserID(ToUserID string) ([]db.FriendRequest, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var usersInfo []FriendRequest - //dbConn.LogMode(true) - err = dbConn.Table("friend_request").Where("user_id=?", userId).Find(&usersInfo).Error + var usersInfo []db.FriendRequest + err = dbConn.Table("friend_requests").Where("to_user_id=?", ToUserID).Find(&usersInfo).Error if err != nil { return nil, err } return usersInfo, nil } -func FindSelfApplyFromFriendReq(userId string) ([]FriendRequest, error) { +//I apply to add somebody +func GetSendFriendApplicationListByUserID(FromUserID string) ([]db.FriendRequest, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var usersInfo []FriendRequest - err = dbConn.Table("friend_request").Where("req_id=?", userId).Find(&usersInfo).Error + var usersInfo []db.FriendRequest + err = dbConn.Table("friend_requests").Where("from_user_id=?", FromUserID).Find(&usersInfo).Error if err != nil { return nil, err } return usersInfo, nil } -func FindFriendApplyFromFriendReqByUid(reqId, userId string) (*FriendRequest, error) { +//FromUserId apply to add ToUserID +func GetFriendApplicationByBothUserID(FromUserID, ToUserID string) (*db.FriendRequest, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var friendRequest FriendRequest - err = dbConn.Table("friend_request").Where("req_id=? and user_id=?", reqId, userId).Find(&friendRequest).Error + var friendRequest db.FriendRequest + err = dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", FromUserID, ToUserID).Take(&friendRequest).Error if err != nil { return nil, err } return &friendRequest, nil } -func UpdateFriendRelationshipToFriendReq(reqId, userId string, flag int32) error { +func UpdateFriendApplication(friendRequest *db.FriendRequest) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - err = dbConn.Exec("update friend_request set flag=? where req_id=? and user_id=?", flag, reqId, userId).Error + friendRequest.CreateTime = time.Now() + + return dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", + friendRequest.FromUserID, friendRequest.ToUserID).Update(&friendRequest).Error +} + +func InsertFriendApplication(friendRequest *db.FriendRequest, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + + if err = dbConn.Table("friend_requests").Create(friendRequest).Error; err == nil { + return nil + } + + //t := dbConn.Debug().Table("friend_requests").Where("from_user_id = ? and to_user_id = ?", friendRequest.FromUserID, friendRequest.ToUserID).Select("*").Updates(*friendRequest) + //if t.RowsAffected == 0 { + // return utils.Wrap(errors.New("RowsAffected == 0"), "no update") + //} + //return utils.Wrap(t.Error, "") + + friendRequest.CreateTime = time.Now() + args["create_time"] = friendRequest.CreateTime + u := dbConn.Model(friendRequest).Updates(args) + //u := dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", + // friendRequest.FromUserID, friendRequest.ToUserID).Update(&friendRequest) + //u := dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", + // friendRequest.FromUserID, friendRequest.ToUserID).Update(&friendRequest) + if u.RowsAffected != 0 { + return nil + } + + if friendRequest.CreateTime.Unix() < 0 { + friendRequest.CreateTime = time.Now() + } + if friendRequest.HandleTime.Unix() < 0 { + friendRequest.HandleTime = utils.UnixSecondToTime(0) + } + err = dbConn.Table("friend_requests").Create(friendRequest).Error if err != nil { return err } diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go index 60ad86e85..63f12c115 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go @@ -1,171 +1,193 @@ package im_mysql_model import ( + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" + "errors" + "fmt" "time" ) -func InsertIntoGroupMember(groupId, uid, nickName, userGroupFaceUrl string, administratorLevel int32) error { +//type GroupMember struct { +// GroupID string `gorm:"column:group_id;primaryKey;"` +// UserID string `gorm:"column:user_id;primaryKey;"` +// NickName string `gorm:"column:nickname"` +// FaceUrl string `gorm:"user_group_face_url"` +// RoleLevel int32 `gorm:"column:role_level"` +// JoinTime time.Time `gorm:"column:join_time"` +// JoinSource int32 `gorm:"column:join_source"` +// OperatorUserID string `gorm:"column:operator_user_id"` +// Ex string `gorm:"column:ex"` +//} + +func InsertIntoGroupMember(toInsertInfo db.GroupMember) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - toInsertInfo := GroupMember{GroupId: groupId, Uid: uid, NickName: nickName, AdministratorLevel: administratorLevel, JoinTime: time.Now(), UserGroupFaceUrl: userGroupFaceUrl} - err = dbConn.Table("group_member").Create(toInsertInfo).Error + toInsertInfo.JoinTime = time.Now() + if toInsertInfo.RoleLevel == 0 { + toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers + } + err = dbConn.Table("group_members").Create(toInsertInfo).Error if err != nil { return err } return nil } -func FindGroupMemberListByUserId(uid string) ([]GroupMember, error) { +func GetGroupMemberListByUserID(userID string) ([]db.GroupMember, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var groupMemberList []GroupMember - err = dbConn.Raw("select * from `group_member` where uid=?", uid).Find(&groupMemberList).Error + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("user_id=?", userID).Find(&groupMemberList).Error + //err = dbConn.Table("group_members").Where("user_id=?", userID).Take(&groupMemberList).Error if err != nil { return nil, err } return groupMemberList, nil } -func FindGroupMemberListByGroupId(groupId string) ([]GroupMember, error) { +func GetGroupMemberListByGroupID(groupID string) ([]db.GroupMember, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var groupMemberList []GroupMember - err = dbConn.Raw("select * from `group_member` where group_id=?", groupId).Find(&groupMemberList).Error + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("group_id=?", groupID).Find(&groupMemberList).Error + if err != nil { return nil, err } return groupMemberList, nil } -func FindGroupMemberListByGroupIdAndFilterInfo(groupId string, filter int32) ([]GroupMember, error) { +func GetGroupMemberListByGroupIDAndRoleLevel(groupID string, roleLevel int32) ([]db.GroupMember, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() - dbConn.LogMode(true) if err != nil { return nil, err } - var groupMemberList []GroupMember - err = dbConn.Raw("select * from `group_member` where group_id=? and administrator_level=?", groupId, filter).Find(&groupMemberList).Error + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("group_id=? and role_level=?", groupID, roleLevel).Find(&groupMemberList).Error if err != nil { return nil, err } return groupMemberList, nil } -func FindGroupMemberInfoByGroupIdAndUserId(groupId, uid string) (*GroupMember, error) { + +func GetGroupMemberInfoByGroupIDAndUserID(groupID, userID string) (*db.GroupMember, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var groupMember GroupMember - err = dbConn.Raw("select * from `group_member` where group_id=? and uid=? limit 1", groupId, uid).Scan(&groupMember).Error + var groupMember db.GroupMember + err = dbConn.Table("group_members").Where("group_id=? and user_id=? ", groupID, userID).Limit(1).Take(&groupMember).Error if err != nil { return nil, err } return &groupMember, nil } -func DeleteGroupMemberByGroupIdAndUserId(groupId, uid string) error { +func DeleteGroupMemberByGroupIDAndUserID(groupID, userID string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - err = dbConn.Exec("delete from `group_member` where group_id=? and uid=?", groupId, uid).Error + err = dbConn.Table("group_members").Where("group_id=? and user_id=? ", groupID, userID).Delete(db.GroupMember{}).Error if err != nil { return err } return nil } -func UpdateOwnerGroupNickName(groupId, userId, groupNickName string) error { +func UpdateGroupMemberInfo(groupMemberInfo db.GroupMember) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - err = dbConn.Exec("update `group_member` set nickname=? where group_id=? and uid=?", groupNickName, groupId, userId).Error + err = dbConn.Table("group_members").Where("group_id=? and user_id=?", groupMemberInfo.GroupID, groupMemberInfo.UserID).Update(&groupMemberInfo).Error if err != nil { return err } return nil } -func SelectGroupList(groupID string) ([]string, error) { - var groupUserID string - var groupList []string - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return groupList, err - } - - rows, err := dbConn.Model(&GroupMember{}).Where("group_id = ?", groupID).Select("user_id").Rows() - if err != nil { - return groupList, err - } - defer rows.Close() - for rows.Next() { - rows.Scan(&groupUserID) - groupList = append(groupList, groupUserID) - } - return groupList, nil -} - -func UpdateTheUserAdministratorLevel(groupId, uid string, administratorLevel int64) error { - dbConn, err := db.DB.MysqlDB.DefaultGormDB() - if err != nil { - return err - } - err = dbConn.Exec("update `group_member` set administrator_level=? where group_id=? and uid=?", administratorLevel, groupId, uid).Error - if err != nil { - return err - } - return nil -} - -func GetOwnerManagerByGroupId(groupId string) ([]GroupMember, error) { +func GetOwnerManagerByGroupID(groupID string) ([]db.GroupMember, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var groupMemberList []GroupMember - err = dbConn.Raw("select * from `group_member` where group_id=? and administrator_level > 0", groupId).Find(&groupMemberList).Error + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("group_id=? and role_level>?", groupID, constant.GroupOrdinaryUsers).Find(&groupMemberList).Error if err != nil { return nil, err } return groupMemberList, nil } -func IsExistGroupMember(groupId, uid string) bool { +func GetGroupMemberNumByGroupID(groupID string) (uint32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, utils.Wrap(err, "DefaultGormDB failed") + } + var number uint32 + err = dbConn.Table("group_members").Where("group_id=?", groupID).Count(&number).Error + if err != nil { + return 0, utils.Wrap(err, "") + } + return number, nil +} + +func GetGroupOwnerInfoByGroupID(groupID string) (*db.GroupMember, error) { + omList, err := GetOwnerManagerByGroupID(groupID) + if err != nil { + return nil, err + } + for _, v := range omList { + if v.RoleLevel == constant.GroupOwner { + return &v, nil + } + } + + return nil, utils.Wrap(errors.New("no owner"), "") +} + +func IsExistGroupMember(groupID, userID string) bool { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return false } var number int32 - err = dbConn.Raw("select count(*) from `group_member` where group_id = ? and uid = ?", groupId, uid).Count(&number).Error + err = dbConn.Table("group_members").Where("group_id = ? and user_id = ?", groupID, userID).Count(&number).Error if err != nil { return false } - if number != 1 { return false } return true } -func RemoveGroupMember(groupId string, memberId string) error { - return DeleteGroupMemberByGroupIdAndUserId(groupId, memberId) +func RemoveGroupMember(groupID string, UserID string) error { + return DeleteGroupMemberByGroupIDAndUserID(groupID, UserID) } -func GetMemberInfoById(groupId string, memberId string) (*GroupMember, error) { - return FindGroupMemberInfoByGroupIdAndUserId(groupId, memberId) +func GetMemberInfoByID(groupID string, userID string) (*db.GroupMember, error) { + return GetGroupMemberInfoByGroupIDAndUserID(groupID, userID) } -func GetGroupMemberByGroupId(groupId string, filter int32, begin int32, maxNumber int32) ([]GroupMember, error) { - memberList, err := FindGroupMemberListByGroupId(groupId) //sorted by join time +func GetGroupMemberByGroupID(groupID string, filter int32, begin int32, maxNumber int32) ([]db.GroupMember, error) { + var memberList []db.GroupMember + var err error + if filter >= 0 { + memberList, err = GetGroupMemberListByGroupIDAndRoleLevel(groupID, filter) //sorted by join time + } else { + memberList, err = GetGroupMemberListByGroupID(groupID) + } + if err != nil { return nil, err } @@ -182,36 +204,74 @@ func GetGroupMemberByGroupId(groupId string, filter int32, begin int32, maxNumbe return memberList[begin:end], nil } -func GetJoinedGroupIdListByMemberId(memberId string) ([]GroupMember, error) { - return FindGroupMemberListByUserId(memberId) +func GetJoinedGroupIDListByUserID(userID string) ([]string, error) { + memberList, err := GetGroupMemberListByUserID(userID) + if err != nil { + return nil, err + } + var groupIDList []string = make([]string, len(memberList)) + for _, v := range memberList { + groupIDList = append(groupIDList, v.GroupID) + } + return groupIDList, nil } -func GetGroupMemberNumByGroupId(groupId string) int32 { - dbConn, err := db.DB.MysqlDB.DefaultGormDB() +func IsGroupOwnerAdmin(groupID, UserID string) bool { + groupMemberList, err := GetOwnerManagerByGroupID(groupID) if err != nil { - return 0 + return false } - var number int32 - err = dbConn.Raw("select count(*) from `group_member` where group_id=? ", groupId).Count(&number).Error - if err != nil { - return 0 - } - return number -} - -func GetGroupOwnerByGroupId(groupId string) string { - omList, err := GetOwnerManagerByGroupId(groupId) - if err != nil { - return "" - } - for _, v := range omList { - if v.AdministratorLevel == 1 { - return v.Uid + for _, v := range groupMemberList { + if v.UserID == UserID && v.RoleLevel > constant.GroupOrdinaryUsers { + return true } } - return "" + return false } -func InsertGroupMember(groupId, userId, nickName, userFaceUrl string, role int32) error { - return InsertIntoGroupMember(groupId, userId, nickName, userFaceUrl, role) +func GetGroupMembersByGroupIdCMS(groupId string, userName string, showNumber, pageNumber int32) ([]db.GroupMember, error) { + var groupMembers []db.GroupMember + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return groupMembers, err + } + err = dbConn.Table("group_members").Where("group_id=?", groupId).Where(fmt.Sprintf(" nickname like '%%%s%%' ", userName)).Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&groupMembers).Error + if err != nil { + return nil, err + } + return groupMembers, nil } + +func GetGroupMembersCount(groupId, userName string) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var count int32 + if err != nil { + return count, err + } + dbConn.LogMode(true) + if err := dbConn.Table("group_members").Where("group_id=?", groupId).Where(fmt.Sprintf(" nickname like '%%%s%%' ", userName)).Count(&count).Error; err != nil { + return count, err + } + return count, nil +} + +// +//func SelectGroupList(groupID string) ([]string, error) { +// var groupUserID string +// var groupList []string +// dbConn, err := db.DB.MysqlDB.DefaultGormDB() +// if err != nil { +// return groupList, err +// } +// +// rows, err := dbConn.Model(&GroupMember{}).Where("group_id = ?", groupID).Select("user_id").Rows() +// if err != nil { +// return groupList, err +// } +// defer rows.Close() +// for rows.Next() { +// rows.Scan(&groupUserID) +// groupList = append(groupList, groupUserID) +// } +// return groupList, nil +//} diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_model.go index 2988741e5..587e3672e 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_model.go @@ -1,302 +1,219 @@ package im_mysql_model import ( + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" - "Open_IM/pkg/common/log" - "Open_IM/pkg/proto/group" + "Open_IM/pkg/utils" "errors" + "fmt" + "github.com/jinzhu/gorm" "time" ) -func InsertIntoGroup(groupId, name, introduction, notification, faceUrl, ex string) error { +//type Group struct { +// GroupID string `gorm:"column:group_id;primaryKey;"` +// GroupName string `gorm:"column:name"` +// Introduction string `gorm:"column:introduction"` +// Notification string `gorm:"column:notification"` +// FaceUrl string `gorm:"column:face_url"` +// CreateTime time.Time `gorm:"column:create_time"` +// Status int32 `gorm:"column:status"` +// CreatorUserID string `gorm:"column:creator_user_id"` +// GroupType int32 `gorm:"column:group_type"` +// Ex string `gorm:"column:ex"` +//} + +func InsertIntoGroup(groupInfo db.Group) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - //Default group name - if name == "" { - name = "groupChat" + if groupInfo.GroupName == "" { + groupInfo.GroupName = "Group Chat" } - toInsertInfo := Group{GroupId: groupId, Name: name, Introduction: introduction, Notification: notification, FaceUrl: faceUrl, CreateTime: time.Now(), Ex: ex} - err = dbConn.Table("group").Create(toInsertInfo).Error + groupInfo.CreateTime = time.Now() + err = dbConn.Table("groups").Create(groupInfo).Error if err != nil { return err } return nil } -func FindGroupInfoByGroupId(groupId string) (*Group, error) { +func GetGroupInfoByGroupID(groupId string) (*db.Group, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return nil, err + return nil, utils.Wrap(err, "") } - var groupInfo Group - err = dbConn.Raw("select * from `group` where group_id=?", groupId).Scan(&groupInfo).Error + var groupInfo db.Group + err = dbConn.Table("groups").Where("group_id=?", groupId).Take(&groupInfo).Error if err != nil { return nil, err } return &groupInfo, nil } -func SetGroupInfo(groupId, groupName, introduction, notification, groupFaceUrl, ex string) error { +func SetGroupInfo(groupInfo db.Group) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() - dbConn.LogMode(true) if err != nil { return err } - if groupName != "" { - if err = dbConn.Exec("update `group` set name=? where group_id=?", groupName, groupId).Error; err != nil { - return err - } + dbConn.LogMode(true) + err = dbConn.Table("groups").Where("group_id=?", groupInfo.GroupID).Update(&groupInfo).Error + return err +} + +func GetGroupsByName(groupName string, pageNumber, showNumber int32) ([]db.Group, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var groups []db.Group + if err != nil { + return groups, err } - if introduction != "" { - if err = dbConn.Exec("update `group` set introduction=? where group_id=?", introduction, groupId).Error; err != nil { - return err - } + dbConn.LogMode(true) + err = dbConn.Table("groups").Where(fmt.Sprintf(" name like '%%%s%%' ", groupName)).Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&groups).Error + return groups, err +} + +func GetGroups(pageNumber, showNumber int) ([]db.Group, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var groups []db.Group + if err != nil { + return groups, err } - if notification != "" { - if err = dbConn.Exec("update `group` set notification=? where group_id=?", notification, groupId).Error; err != nil { - return err - } + dbConn.LogMode(true) + if err = dbConn.Table("groups").Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&groups).Error; err != nil { + return groups, err } - if groupFaceUrl != "" { - if err = dbConn.Exec("update `group` set face_url=? where group_id=?", groupFaceUrl, groupId).Error; err != nil { - return err - } + return groups, nil +} + +func OperateGroupStatus(groupId string, groupStatus int32) error { + group := db.Group{ + GroupID: groupId, + Status: groupStatus, } - if ex != "" { - if err = dbConn.Exec("update `group` set ex=? where group_id=?", ex, groupId).Error; err != nil { - return err - } + if err := SetGroupInfo(group); err != nil { + return err } return nil } -func GetGroupApplicationList(uid string) (*group.GetGroupApplicationListResp, error) { +func DeleteGroup(groupId string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return nil, err + return err } + dbConn.LogMode(true) + var group db.Group + var groupMembers []db.GroupMember + if err := dbConn.Table("groups").Where("group_id=?", groupId).Delete(&group).Error; err != nil { + return err + } + if err := dbConn.Table("group_members").Where("group_id=?", groupId).Delete(groupMembers).Error; err != nil { + return err + } + return nil +} - var gID string - var gIDs []string - rows, err := dbConn.Raw("select group_id from `group_member` where uid = ? and administrator_level > 0", uid).Rows() - defer rows.Close() +func OperateGroupRole(userId, groupId string, roleLevel int32) (string, string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return nil, err + return "", "", err } - - for rows.Next() { - rows.Scan(&gID) - gIDs = append(gIDs, gID) + dbConn.LogMode(true) + groupMember := db.GroupMember{ + UserID: userId, + GroupID: groupId, } - - if len(gIDs) == 0 { - return &group.GetGroupApplicationListResp{}, nil + updateInfo := db.GroupMember{ + RoleLevel: roleLevel, } + groupMaster := db.GroupMember{} + switch roleLevel { + case constant.GroupOwner: + err = dbConn.Transaction(func(tx *gorm.DB) error { + result := dbConn.Table("group_members").Where("group_id = ? and role_level = ?", groupId, constant.GroupOwner).First(&groupMaster).Update(&db.GroupMember{ + RoleLevel: constant.GroupOrdinaryUsers, + }) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } - sql := "select id, group_id, from_user_id, to_user_id, flag, req_msg, handled_msg, create_time, " + - "from_user_nickname, to_user_nickname, from_user_face_url, to_user_face_url, handled_user from `group_request` where group_id in ( " - for i := 0; i < len(gIDs); i++ { - if i == len(gIDs)-1 { - sql = sql + "\"" + gIDs[i] + "\"" + " )" - } else { - sql = sql + "\"" + gIDs[i] + "\"" + ", " - } - } + result = dbConn.Table("group_members").First(&groupMember).Update(updateInfo) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } + return nil + }) - var groupRequest GroupRequest - var groupRequests []GroupRequest - log.Info("", "", sql) - rows, err = dbConn.Raw(sql).Rows() - defer rows.Close() - if err != nil { - return nil, err - } - for rows.Next() { - rows.Scan(&groupRequest.ID, &groupRequest.GroupID, &groupRequest.FromUserID, &groupRequest.ToUserID, &groupRequest.Flag, &groupRequest.ReqMsg, - &groupRequest.HandledMsg, &groupRequest.CreateTime, &groupRequest.FromUserNickname, &groupRequest.ToUserNickname, - &groupRequest.FromUserFaceUrl, &groupRequest.ToUserFaceUrl, &groupRequest.HandledUser) - groupRequests = append(groupRequests, groupRequest) - } - - reply := &group.GetGroupApplicationListResp{} - reply.Data = &group.GetGroupApplicationListData{} - reply.Data.Count = int32(len(groupRequests)) - for i := 0; i < int(reply.Data.Count); i++ { - addUser := group.GetGroupApplicationList_Data_User{ - ID: groupRequests[i].ID, - GroupID: groupRequests[i].GroupID, - FromUserID: groupRequests[i].FromUserID, - FromUserNickname: groupRequests[i].FromUserNickname, - FromUserFaceUrl: groupRequests[i].FromUserFaceUrl, - ToUserID: groupRequests[i].ToUserID, - AddTime: groupRequests[i].CreateTime.Unix(), - RequestMsg: groupRequests[i].ReqMsg, - HandledMsg: groupRequests[i].HandledMsg, - Flag: groupRequests[i].Flag, - ToUserNickname: groupRequests[i].ToUserNickname, - ToUserFaceUrl: groupRequests[i].ToUserFaceUrl, - HandledUser: groupRequests[i].HandledUser, - Type: 0, - HandleStatus: 0, - HandleResult: 0, - } - - if addUser.ToUserID != "0" { - addUser.Type = 1 - } - - if len(groupRequests[i].HandledUser) > 0 { - if groupRequests[i].HandledUser == uid { - addUser.HandleStatus = 2 + case constant.GroupOrdinaryUsers: + err = dbConn.Transaction(func(tx *gorm.DB) error { + result := dbConn.Table("group_members").Where("group_id = ? and role_level = ?", groupId, constant.GroupOwner).First(&groupMaster) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } + if groupMaster.UserID == userId { + return errors.New(fmt.Sprintf("user %s is master of %s, cant set to ordinary user", userId, groupId)) } else { - addUser.HandleStatus = 1 + result = dbConn.Table("group_members").Find(&groupMember).Update(updateInfo) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } } - } - - if groupRequests[i].Flag == 1 { - addUser.HandleResult = 1 - } - - reply.Data.User = append(reply.Data.User, &addUser) + return nil + }) } - return reply, nil + return "", "", nil } -func TransferGroupOwner(pb *group.TransferGroupOwnerReq) (*group.TransferGroupOwnerResp, error) { - oldOwner, err := FindGroupMemberInfoByGroupIdAndUserId(pb.GroupID, pb.OldOwner) - if err != nil { - return nil, err - } - newOwner, err := FindGroupMemberInfoByGroupIdAndUserId(pb.GroupID, pb.NewOwner) - if err != nil { - return nil, err - } - - if oldOwner.Uid == newOwner.Uid { - return nil, errors.New("the self") - } - - if err = UpdateTheUserAdministratorLevel(pb.GroupID, pb.OldOwner, 0); err != nil { - return nil, err - } - - if err = UpdateTheUserAdministratorLevel(pb.GroupID, pb.NewOwner, 1); err != nil { - UpdateTheUserAdministratorLevel(pb.GroupID, pb.OldOwner, 1) - return nil, err - } - - return &group.TransferGroupOwnerResp{}, nil -} - -func GroupApplicationResponse(pb *group.GroupApplicationResponseReq) (*group.GroupApplicationResponseResp, error) { - - ownerUser, err := FindGroupMemberInfoByGroupIdAndUserId(pb.GroupID, pb.OwnerID) - if err != nil { - log.ErrorByKv("FindGroupMemberInfoByGroupIdAndUserId failed", pb.OperationID, "groupId", pb.GroupID, "ownerID", pb.OwnerID) - return nil, err - } - if ownerUser.AdministratorLevel <= 0 { - return nil, errors.New("insufficient permissions") - } - +func GetGroupsCountNum(group db.Group) (int32, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return nil, err + return 0, err } - var groupRequest GroupRequest - err = dbConn.Raw("select * from `group_request` where handled_user = ? and group_id = ? and from_user_id = ? and to_user_id = ?", - "", pb.GroupID, pb.FromUserID, pb.ToUserID).Scan(&groupRequest).Error - if err != nil { - log.ErrorByKv("find group_request info failed", pb.OperationID, "groupId", pb.GroupID, "fromUserId", pb.FromUserID, "toUserId", pb.OwnerID) - return nil, err + dbConn.LogMode(true) + var count int32 + if err := dbConn.Table("groups").Where(fmt.Sprintf(" name like '%%%s%%' ", group.GroupName)).Count(&count).Error; err != nil { + return 0, err } - - if groupRequest.Flag != 0 { - return nil, errors.New("application has already handle") - } - - var saveFlag int - if pb.HandleResult == 0 { - saveFlag = -1 - } else if pb.HandleResult == 1 { - saveFlag = 1 - } else { - return nil, errors.New("parma HandleResult error") - } - err = dbConn.Exec("update `group_request` set flag = ?, handled_msg = ?, handled_user = ? where group_id = ? and from_user_id = ? and to_user_id = ?", - saveFlag, pb.HandledMsg, pb.OwnerID, groupRequest.GroupID, groupRequest.FromUserID, groupRequest.ToUserID).Error - if err != nil { - log.ErrorByKv("update group request failed", pb.OperationID, "groupID", pb.GroupID, "flag", saveFlag, "ownerId", pb.OwnerID, "fromUserId", pb.FromUserID, "toUserID", pb.ToUserID) - return nil, err - } - - if saveFlag == 1 { - if groupRequest.ToUserID == "0" { - err = InsertIntoGroupMember(pb.GroupID, pb.FromUserID, groupRequest.FromUserNickname, groupRequest.FromUserFaceUrl, 0) - if err != nil { - log.ErrorByKv("InsertIntoGroupMember failed", pb.OperationID, "groupID", pb.GroupID, "fromUserId", pb.FromUserID) - return nil, err - } - } else { - err = InsertIntoGroupMember(pb.GroupID, pb.ToUserID, groupRequest.ToUserNickname, groupRequest.ToUserFaceUrl, 0) - if err != nil { - log.ErrorByKv("InsertIntoGroupMember failed", pb.OperationID, "groupID", pb.GroupID, "fromUserId", pb.FromUserID) - return nil, err - } - } - } - - //if err != nil { - // err = dbConn.Raw("select * from `group_request` where handled_user = ? and group_id = ? and to_user_id = ? and from_user_id = ?", "", pb.GroupID, "0", pb.UID).Scan(&groupRequest).Error - // if err != nil { - // return nil, err - // } - // if pb.Flag == 1 { - // err = dbConn.Exec("update `group_request` set flag = ?, handled_msg = ?, handled_user = ? where group_id = ? and to_user_id = ? and from_user_id = ?", - // pb.Flag, pb.RespMsg, pb.OwnerID, pb.GroupID, "0", pb.UID).Error - // if err != nil { - // return nil, err - // } - // - // // add to group member - // err = InsertIntoGroupMember(pb.GroupID, pb.UID, groupRequest.FromUserNickname, groupRequest.FromUserFaceUrl, 0) - // if err != nil { - // return nil, err - // } - // } else if pb.Flag == -1 { - // err = dbConn.Exec("update `group_request` set flag = ?, handled_msg = ?, handled_user = ? where group_id = ? and to_user_id = ? and from_user_id = ?", - // pb.Flag, pb.RespMsg, pb.OwnerID, pb.GroupID, "0", pb.UID).Error - // if err != nil { - // return nil, err - // } - // } else { - // return nil, errors.New("flag error") - // } - //} else { - // if pb.Flag == 1 { - // err = dbConn.Exec("update `group_request` set flag = ?, handled_msg = ?, handled_user = ? where group_id = ? and to_user_id = ?", - // pb.Flag, pb.RespMsg, pb.OwnerID, pb.GroupID, pb.UID).Error - // if err != nil { - // return nil, err - // } - // - // // add to group member - // err = InsertIntoGroupMember(pb.GroupID, pb.UID, groupRequest.ToUserNickname, groupRequest.ToUserFaceUrl, 0) - // if err != nil { - // return nil, err - // } - // } else if pb.Flag == -1 { - // err = dbConn.Exec("update `group_request` set flag = ?, handled_msg = ?, handled_user = ? where group_id = ? and to_user_id = ?", - // pb.Flag, pb.RespMsg, pb.OwnerID, pb.GroupID, pb.UID).Error - // if err != nil { - // return nil, err - // } - // } else { - // return nil, errors.New("flag error") - // } - //} - - return &group.GroupApplicationResponseResp{}, nil + return count, nil +} + +func GetGroupById(groupId string) (db.Group, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + group := db.Group{ + GroupID: groupId, + } + if err != nil { + return group, err + } + dbConn.LogMode(true) + if err := dbConn.Table("groups").Find(&group).Error; err != nil { + return group, err + } + return group, nil +} + +func GetGroupMaster(groupId string) (db.GroupMember, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + groupMember := db.GroupMember{} + if err != nil { + return groupMember, err + } + dbConn.LogMode(true) + if err := dbConn.Table("group_members").Where("role_level=? and group_id=?", constant.GroupOwner, groupId).Find(&groupMember).Error; err != nil { + return groupMember, err + } + return groupMember, nil } diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go index da793d331..836f3f0bf 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go @@ -1,62 +1,209 @@ package im_mysql_model import ( + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" "time" ) -func InsertIntoGroupRequest(groupId, fromUserId, toUserId, reqMsg, fromUserNickName, fromUserFaceUrl string) error { +//type GroupRequest struct { +// UserID string `gorm:"column:user_id;primaryKey;"` +// GroupID string `gorm:"column:group_id;primaryKey;"` +// HandleResult int32 `gorm:"column:handle_result"` +// ReqMsg string `gorm:"column:req_msg"` +// HandledMsg string `gorm:"column:handled_msg"` +// ReqTime time.Time `gorm:"column:req_time"` +// HandleUserID string `gorm:"column:handle_user_id"` +// HandledTime time.Time `gorm:"column:handle_time"` +// Ex string `gorm:"column:ex"` +//} + +func UpdateGroupRequest(groupRequest db.GroupRequest) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - toInsertInfo := GroupRequest{GroupID: groupId, FromUserID: fromUserId, ToUserID: toUserId, ReqMsg: reqMsg, FromUserNickname: fromUserNickName, FromUserFaceUrl: fromUserFaceUrl, CreateTime: time.Now()} - err = dbConn.Table("group_request").Create(&toInsertInfo).Error + if groupRequest.HandledTime.Unix() < 0 { + groupRequest.HandledTime = utils.UnixSecondToTime(0) + } + return dbConn.Table("group_requests").Where("group_id=? and user_id=?", groupRequest.GroupID, groupRequest.UserID).Update(&groupRequest).Error +} + +func InsertIntoGroupRequest(toInsertInfo db.GroupRequest) error { + DelGroupRequestByGroupIDAndUserID(toInsertInfo.GroupID, toInsertInfo.UserID) + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + + if toInsertInfo.HandledTime.Unix() < 0 { + toInsertInfo.HandledTime = utils.UnixSecondToTime(0) + } + u := dbConn.Table("group_requests").Where("group_id=? and user_id=?", toInsertInfo.GroupID, toInsertInfo.UserID).Update(&toInsertInfo) + if u.RowsAffected != 0 { + return nil + } + + toInsertInfo.ReqTime = time.Now() + if toInsertInfo.HandledTime.Unix() < 0 { + toInsertInfo.HandledTime = utils.UnixSecondToTime(0) + } + + err = dbConn.Table("group_requests").Create(&toInsertInfo).Error if err != nil { return err } return nil } -func FindGroupRequestUserInfoByGroupIDAndUid(groupId, uid string) (*GroupRequest, error) { +func GetGroupRequestByGroupIDAndUserID(groupID, userID string) (*db.GroupRequest, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var requestUserInfo GroupRequest - err = dbConn.Table("group_request").Where("from_user_id=? and group_id=?", uid, groupId).Find(&requestUserInfo).Error + var groupRequest db.GroupRequest + err = dbConn.Table("group_requests").Where("user_id=? and group_id=?", userID, groupID).Take(&groupRequest).Error if err != nil { return nil, err } - return &requestUserInfo, nil + return &groupRequest, nil } -func DelGroupRequest(groupId, fromUserId, toUserId string) error { +func DelGroupRequestByGroupIDAndUserID(groupID, userID string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - err = dbConn.Exec("delete from group_request where group_id=? and from_user_id=? and to_user_id=?", groupId, fromUserId, toUserId).Error + err = dbConn.Table("group_requests").Where("group_id=? and user_id=?", groupID, userID).Delete(db.GroupRequest{}).Error if err != nil { return err } return nil } -func FindGroupBeInvitedRequestInfoByUidAndGroupID(groupId, uid string) (*GroupRequest, error) { +func GetGroupRequestByGroupID(groupID string) ([]db.GroupRequest, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var beInvitedRequestUserInfo GroupRequest - err = dbConn.Table("group_request").Where("to_user_id=? and group_id=?", uid, groupId).Find(&beInvitedRequestUserInfo).Error + var groupRequestList []db.GroupRequest + err = dbConn.Table("group_requests").Where("group_id=?", groupID).Find(&groupRequestList).Error if err != nil { return nil, err } - return &beInvitedRequestUserInfo, nil - + return groupRequestList, nil } -func InsertGroupRequest(groupId, fromUser, fromUserNickName, fromUserFaceUrl, toUser, requestMsg, handledMsg string, handleStatus int) error { - return nil +//received +func GetGroupApplicationList(userID string) ([]db.GroupRequest, error) { + var groupRequestList []db.GroupRequest + memberList, err := GetGroupMemberListByUserID(userID) + if err != nil { + return nil, err + } + for _, v := range memberList { + if v.RoleLevel > constant.GroupOrdinaryUsers { + list, err := GetGroupRequestByGroupID(v.GroupID) + if err != nil { + // fmt.Println("111 GetGroupRequestByGroupID failed ", err.Error()) + continue + } + // fmt.Println("222 GetGroupRequestByGroupID ok ", list) + groupRequestList = append(groupRequestList, list...) + // fmt.Println("333 GetGroupRequestByGroupID ok ", groupRequestList) + } + } + return groupRequestList, nil } + +func GetUserReqGroupByUserID(userID string) ([]db.GroupRequest, error) { + var groupRequestList []db.GroupRequest + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + dbConn.LogMode(true) + err = dbConn.Table("group_requests").Where("user_id=?", userID).Find(&groupRequestList).Error + return groupRequestList, err +} + +// +//func GroupApplicationResponse(pb *group.GroupApplicationResponseReq) (*group.CommonResp, error) { +// +// ownerUser, err := FindGroupMemberInfoByGroupIdAndUserId(pb.GroupID, pb.OwnerID) +// if err != nil { +// log.ErrorByKv("FindGroupMemberInfoByGroupIdAndUserId failed", pb.OperationID, "groupId", pb.GroupID, "ownerID", pb.OwnerID) +// return nil, err +// } +// if ownerUser.AdministratorLevel <= 0 { +// return nil, errors.New("insufficient permissions") +// } +// +// dbConn, err := db.DB.MysqlDB.DefaultGormDB() +// if err != nil { +// return nil, err +// } +// var groupRequest GroupRequest +// err = dbConn.Raw("select * from `group_request` where handled_user = ? and group_id = ? and from_user_id = ? and to_user_id = ?", +// "", pb.GroupID, pb.FromUserID, pb.ToUserID).Scan(&groupRequest).Error +// if err != nil { +// log.ErrorByKv("find group_request info failed", pb.OperationID, "groupId", pb.GroupID, "fromUserId", pb.FromUserID, "toUserId", pb.OwnerID) +// return nil, err +// } +// +// if groupRequest.Flag != 0 { +// return nil, errors.New("application has already handle") +// } +// +// var saveFlag int +// if pb.HandleResult == 0 { +// saveFlag = -1 +// } else if pb.HandleResult == 1 { +// saveFlag = 1 +// } else { +// return nil, errors.New("parma HandleResult error") +// } +// err = dbConn.Exec("update `group_request` set flag = ?, handled_msg = ?, handled_user = ? where group_id = ? and from_user_id = ? and to_user_id = ?", +// saveFlag, pb.HandledMsg, pb.OwnerID, groupRequest.GroupID, groupRequest.FromUserID, groupRequest.ToUserID).Error +// if err != nil { +// log.ErrorByKv("update group request failed", pb.OperationID, "groupID", pb.GroupID, "flag", saveFlag, "ownerId", pb.OwnerID, "fromUserId", pb.FromUserID, "toUserID", pb.ToUserID) +// return nil, err +// } +// +// if saveFlag == 1 { +// if groupRequest.ToUserID == "0" { +// err = InsertIntoGroupMember(pb.GroupID, pb.FromUserID, groupRequest.FromUserNickname, groupRequest.FromUserFaceUrl, 0) +// if err != nil { +// log.ErrorByKv("InsertIntoGroupMember failed", pb.OperationID, "groupID", pb.GroupID, "fromUserId", pb.FromUserID) +// return nil, err +// } +// } else { +// err = InsertIntoGroupMember(pb.GroupID, pb.ToUserID, groupRequest.ToUserNickname, groupRequest.ToUserFaceUrl, 0) +// if err != nil { +// log.ErrorByKv("InsertIntoGroupMember failed", pb.OperationID, "groupID", pb.GroupID, "fromUserId", pb.FromUserID) +// return nil, err +// } +// } +// } +// +// return &group.GroupApplicationResponseResp{}, nil +//} + +//func FindGroupBeInvitedRequestInfoByUidAndGroupID(groupId, uid string) (*GroupRequest, error) { +// dbConn, err := db.DB.MysqlDB.DefaultGormDB() +// if err != nil { +// return nil, err +// } +// var beInvitedRequestUserInfo GroupRequest +// err = dbConn.Table("group_request").Where("to_user_id=? and group_id=?", uid, groupId).Find(&beInvitedRequestUserInfo).Error +// if err != nil { +// return nil, err +// } +// return &beInvitedRequestUserInfo, nil +// +//} + +//func InsertGroupRequest(groupId, fromUser, fromUserNickName, fromUserFaceUrl, toUser, requestMsg, handledMsg string, handleStatus int) error { +// return nil +//} diff --git a/pkg/common/db/mysql_model/im_mysql_model/message_cms.go b/pkg/common/db/mysql_model/im_mysql_model/message_cms.go new file mode 100644 index 000000000..811943667 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/message_cms.go @@ -0,0 +1,66 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "fmt" +) + +func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var chatLogs []db.ChatLog + if err != nil { + return chatLogs, err + } + dbConn.LogMode(true) + db := dbConn.Table("chat_logs"). + Where(fmt.Sprintf(" content like '%%%s%%'", chatLog.Content)). + Limit(showNumber).Offset(showNumber * (pageNumber - 1)) + if chatLog.SessionType != 0 { + db = db.Where("session_type = ?", chatLog.SessionType) + } + if chatLog.ContentType != 0 { + db = db.Where("content_type = ?", chatLog.ContentType) + } + if chatLog.SendID != "" { + db = db.Where("send_id = ?", chatLog.SendID) + } + if chatLog.RecvID != "" { + db = db.Where("recv_id = ?", chatLog.RecvID) + } + if chatLog.SendTime.Unix() > 0 { + db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1)) + } + + err = db.Find(&chatLogs).Error + return chatLogs, err +} + +func GetChatLogCount(chatLog db.ChatLog) (int64, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var chatLogs []db.ChatLog + var count int64 + if err != nil { + return count, err + } + dbConn.LogMode(true) + db := dbConn.Table("chat_logs"). + Where(fmt.Sprintf(" content like '%%%s%%'", chatLog.Content)) + if chatLog.SessionType != 0 { + db = db.Where("session_type = ?", chatLog.SessionType) + } + if chatLog.ContentType != 0 { + db = db.Where("content_type = ?", chatLog.ContentType) + } + if chatLog.SendID != "" { + db = db.Where("send_id = ?", chatLog.SendID) + } + if chatLog.RecvID != "" { + db = db.Where("recv_id = ?", chatLog.RecvID) + } + if chatLog.SendTime.Unix() > 0 { + db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1)) + } + + err = db.Find(&chatLogs).Count(&count).Error + return count, err +} \ No newline at end of file diff --git a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go deleted file mode 100644 index d8576ac19..000000000 --- a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go +++ /dev/null @@ -1,70 +0,0 @@ -package im_mysql_model - -import "time" - -type User struct { - UID string `gorm:"column:uid;primaryKey;"` - Name string `gorm:"column:name"` - Icon string `gorm:"column:icon"` - Gender int32 `gorm:"column:gender"` - Mobile string `gorm:"column:mobile"` - Birth string `gorm:"column:birth"` - Email string `gorm:"column:email"` - Ex string `gorm:"column:ex"` - CreateTime time.Time `gorm:"column:create_time"` -} - -type Friend struct { - OwnerId string `gorm:"column:owner_id"` - FriendId string `gorm:"column:friend_id"` - Comment string `gorm:"column:comment"` - FriendFlag int32 `gorm:"column:friend_flag"` - CreateTime time.Time `gorm:"column:create_time"` -} -type FriendRequest struct { - ReqId string `gorm:"column:req_id"` - Uid string `gorm:"column:user_id"` - Flag int32 `gorm:"column:flag"` - ReqMessage string `gorm:"column:req_message"` - CreateTime time.Time `gorm:"column:create_time"` -} -type BlackList struct { - OwnerId string `gorm:"column:owner_id"` - BlockId string `gorm:"column:block_id"` - CreateTime time.Time `gorm:"column:create_time"` -} - -type Group struct { - GroupId string `gorm:"column:group_id"` - Name string `gorm:"column:name"` - Introduction string `gorm:"column:introduction"` - Notification string `gorm:"column:notification"` - FaceUrl string `gorm:"column:face_url"` - CreateTime time.Time `gorm:"column:create_time"` - Ex string `gorm:"column:ex"` -} - -type GroupMember struct { - GroupId string `gorm:"column:group_id"` - Uid string `gorm:"column:uid"` - NickName string `gorm:"column:nickname"` - AdministratorLevel int32 `gorm:"column:administrator_level"` - JoinTime time.Time `gorm:"column:join_time"` - UserGroupFaceUrl string `gorm:"user_group_face_url"` -} - -type GroupRequest struct { - ID string `gorm:"column:id"` - GroupID string `gorm:"column:group_id"` - FromUserID string `gorm:"column:from_user_id"` - ToUserID string `gorm:"column:to_user_id"` - Flag int32 `gorm:"column:flag"` - ReqMsg string `gorm:"column:req_msg"` - HandledMsg string `gorm:"column:handled_msg"` - CreateTime time.Time `gorm:"column:create_time"` - FromUserNickname string `gorm:"from_user_nickname"` - ToUserNickname string `gorm:"to_user_nickname"` - FromUserFaceUrl string `gorm:"from_user_face_url"` - ToUserFaceUrl string `gorm:"to_user_face_url"` - HandledUser string `gorm:"handled_user"` -} diff --git a/pkg/common/db/mysql_model/im_mysql_model/statistics_model.go b/pkg/common/db/mysql_model/im_mysql_model/statistics_model.go new file mode 100644 index 000000000..097c83185 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/statistics_model.go @@ -0,0 +1,153 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "time" +) + +func GetActiveUserNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("chat_logs").Select("count(distinct(send_id))").Where("create_time >= ? and create_time <= ?", from, to).Count(&num).Error + return num, err +} + +func GetIncreaseUserNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("users").Where("create_time >= ? and create_time <= ?", from, to).Count(&num).Error + return num, err +} + +func GetTotalUserNum() (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("users").Count(&num).Error + return num, err +} + +func GetTotalUserNumByDate(to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("users").Where("create_time <= ?", to).Count(&num).Error + return num, err +} + +func GetPrivateMessageNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("chat_logs").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 1).Count(&num).Error + return num, err +} + +func GetGroupMessageNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("chat_logs").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 2).Count(&num).Error + return num, err +} + +func GetIncreaseGroupNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("groups").Where("create_time >= ? and create_time <= ?", from, to).Count(&num).Error + return num, err +} + +func GetTotalGroupNum() (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("groups").Count(&num).Error + return num, err +} + +func GetGroupNum(to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var num int32 + err = dbConn.Table("groups").Where("create_time <= ?", to).Count(&num).Error + return num, err +} + +type activeGroup struct { + Name string + Id string `gorm:"column:recv_id"` + MessageNum int `gorm:"column:message_num"` +} + +func GetActiveGroups(from, to time.Time, limit int) ([]*activeGroup, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var activeGroups []*activeGroup + if err != nil { + return activeGroups, err + } + dbConn.LogMode(true) + err = dbConn.Table("chat_logs").Select("recv_id, count(*) as message_num").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 2).Group("recv_id").Limit(limit).Order("message_num DESC").Find(&activeGroups).Error + for _, activeGroup := range activeGroups { + group := db.Group{ + GroupID: activeGroup.Id, + } + dbConn.Table("groups").Where("group_id= ? ", group.GroupID).Find(&group) + activeGroup.Name = group.GroupName + } + return activeGroups, err +} + +type activeUser struct { + Name string + Id string `gorm:"column:send_id"` + MessageNum int `gorm:"column:message_num"` +} + +func GetActiveUsers(from, to time.Time, limit int) ([]*activeUser, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var activeUsers []*activeUser + if err != nil { + return activeUsers, err + } + dbConn.LogMode(true) + err = dbConn.Table("chat_logs").Select("send_id, count(*) as message_num").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 1).Group("send_id").Limit(limit).Order("message_num DESC").Find(&activeUsers).Error + for _, activeUser := range activeUsers { + user := db.User{ + UserID: activeUser.Id, + } + dbConn.Table("users").Select("user_id, name").Find(&user) + activeUser.Name = user.Nickname + } + return activeUsers, err +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go index 907b0f223..7a60287a6 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go @@ -2,45 +2,55 @@ package im_mysql_model import ( "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" "time" ) -func InsertInToUserBlackList(ownerID, blockID string) error { +func InsertInToUserBlackList(black db.Black) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - toInsertInfo := BlackList{OwnerId: ownerID, BlockId: blockID, CreateTime: time.Now()} - err = dbConn.Table("user_black_list").Create(toInsertInfo).Error + black.CreateTime = time.Now() + err = dbConn.Table("blacks").Create(black).Error return err } -func FindRelationshipFromBlackList(ownerID, blockID string) error { +//type Black struct { +// OwnerUserID string `gorm:"column:owner_user_id;primaryKey;"` +// BlockUserID string `gorm:"column:block_user_id;primaryKey;"` +// CreateTime time.Time `gorm:"column:create_time"` +// AddSource int32 `gorm:"column:add_source"` +// OperatorUserID int32 `gorm:"column:operator_user_id"` +// Ex string `gorm:"column:ex"` +//} + +func CheckBlack(ownerUserID, blockUserID string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - var blackList BlackList - err = dbConn.Table("user_black_list").Where("owner_id=? and block_id=?", ownerID, blockID).Find(&blackList).Error + var black db.Black + err = dbConn.Table("blacks").Where("owner_user_id=? and block_user_id=?", ownerUserID, blockUserID).Find(&black).Error return err } -func RemoveBlackList(ownerID, blockID string) error { +func RemoveBlackList(ownerUserID, blockUserID string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - err = dbConn.Exec("delete from user_black_list where owner_id=? and block_id=?", ownerID, blockID).Error - return err + err = dbConn.Table("blacks").Where("owner_user_id=? and block_user_id=?", ownerUserID, blockUserID).Delete(db.Black{}).Error + return utils.Wrap(err, "RemoveBlackList failed") } -func GetBlackListByUID(ownerID string) ([]BlackList, error) { +func GetBlackListByUserID(ownerUserID string) ([]db.Black, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var blackListUsersInfo []BlackList - err = dbConn.Table("user_black_list").Where("owner_id=?", ownerID).Find(&blackListUsersInfo).Error + var blackListUsersInfo []db.Black + err = dbConn.Table("blacks").Where("owner_user_id=?", ownerUserID).Find(&blackListUsersInfo).Error if err != nil { return nil, err } diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go index f378fdbb5..7492d6a38 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -2,147 +2,292 @@ package im_mysql_model import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" - pbAuth "Open_IM/pkg/proto/auth" "Open_IM/pkg/utils" "fmt" - _ "github.com/jinzhu/gorm/dialects/mysql" "time" + + _ "github.com/jinzhu/gorm/dialects/mysql" ) func init() { //init managers - var pb pbAuth.UserRegisterReq for k, v := range config.Config.Manager.AppManagerUid { - if !IsExistUser(v) { - pb.UID = v - pb.Name = "AppManager" + utils.IntToString(k+1) - err := UserRegister(&pb) - if err != nil { - fmt.Println("AppManager insert error", err.Error()) - } + user, err := GetUserByUserID(v) + if err != nil { + fmt.Println("GetUserByUserID failed ", err.Error(), v, user) + } else { + continue } + var appMgr db.User + appMgr.UserID = v + appMgr.Nickname = "AppManager" + utils.IntToString(k+1) + appMgr.AppMangerLevel = constant.AppAdmin + err = UserRegister(appMgr) + if err != nil { + fmt.Println("AppManager insert error", err.Error(), appMgr, "time: ", appMgr.Birth.Unix()) + } + } } -func UserRegister(pb *pbAuth.UserRegisterReq) error { + +func UserRegister(user db.User) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - addUser := User{ - UID: pb.UID, - Name: pb.Name, - Icon: pb.Icon, - Gender: pb.Gender, - Mobile: pb.Mobile, - Birth: pb.Birth, - Email: pb.Email, - Ex: pb.Ex, - CreateTime: time.Now(), + user.CreateTime = time.Now() + if user.AppMangerLevel == 0 { + user.AppMangerLevel = constant.AppOrdinaryUsers } - err = dbConn.Table("user").Create(&addUser).Error + if user.Birth.Unix() < 0 { + user.Birth = utils.UnixSecondToTime(0) + } + err = dbConn.Table("users").Create(&user).Error if err != nil { return err } return nil } -func UserDelete(uid string) error { +func DeleteUser(userID string) (i int64) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return err + return 0 } - err = dbConn.Table("user").Where("uid=?", uid).Delete(User{}).Error - if err != nil { - return err - } - return nil + i = dbConn.Table("users").Where("user_id=?", userID).Delete(db.User{}).RowsAffected + return i } -func FindUserByUID(uid string) (*User, error) { + +func GetUserByUserID(userID string) (*db.User, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return nil, err } - var user User - err = dbConn.Table("user").Where("uid=?", uid).First(&user).Error + var user db.User + err = dbConn.Table("users").Where("user_id=?", userID).Take(&user).Error if err != nil { return nil, err } return &user, nil } -func UpDateUserInfo(uid, name, headUrl, mobilePhoneNum, birth, email, extendInfo string, gender int32) error { +func UpdateUserInfo(user db.User) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - if name != "" { - if err = dbConn.Exec("update user set name=? where uid=?", name, uid).Error; err != nil { - return err - } - } - if headUrl != "" { - if err = dbConn.Exec("update user set icon=? where uid=?", headUrl, uid).Error; err != nil { - return err - } - } - if mobilePhoneNum != "" { - if err = dbConn.Exec("update user set mobile=? where uid=?", mobilePhoneNum, uid).Error; err != nil { - return err - } - } - if birth != "" { - if err = dbConn.Exec("update user set birth=? where uid=?", birth, uid).Error; err != nil { - return err - } - } - if email != "" { - if err = dbConn.Exec("update user set email=? where uid=?", email, uid).Error; err != nil { - return err - } - } - if extendInfo != "" { - if err = dbConn.Exec("update user set ex=? where uid=?", extendInfo, uid).Error; err != nil { - return err - } - } - if gender != 0 { - if err = dbConn.Exec("update user set gender=? where uid=?", gender, uid).Error; err != nil { - return err - } - } - return nil + dbConn.LogMode(true) + err = dbConn.Table("users").Where("user_id=?", user.UserID).Update(&user).Error + return err } -func SelectAllUID() ([]string, error) { - var uid []string - +func SelectAllUserID() ([]string, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return uid, err + return nil, err } - rows, _ := dbConn.Raw("select uid from user").Rows() - defer rows.Close() - var strUID string - for rows.Next() { - rows.Scan(&strUID) - uid = append(uid, strUID) + var resultArr []string + err = dbConn.Table("users").Pluck("user_id", &resultArr).Error + if err != nil { + return nil, err } - return uid, nil + return resultArr, nil } -func IsExistUser(uid string) bool { +func SelectSomeUserID(userIDList []string) ([]string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + dbConn.LogMode(true) + if err != nil { + return nil, err + } + var resultArr []string + err = dbConn.Table("users").Where("user_id IN (?) ", userIDList).Pluck("user_id", &resultArr).Error + + if err != nil { + return nil, err + } + return resultArr, nil +} + +func GetUsers(showNumber, pageNumber int32) ([]db.User, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var users []db.User + if err != nil { + return users, err + } + dbConn.LogMode(true) + err = dbConn.Table("users").Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&users).Error + if err != nil { + return users, err + } + return users, err +} + +func AddUser(userId, phoneNumber, name string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return false + return err } - var number int32 - err = dbConn.Raw("select count(*) from `user` where uid = ?", uid).Count(&number).Error - if err != nil { - return false + user := db.User{ + PhoneNumber: phoneNumber, + Birth: time.Now(), + CreateTime: time.Now(), + UserID: userId, + Nickname: name, } - if number != 1 { - return false - } - return true + result := dbConn.Table("users").Create(&user) + return result.Error +} + +func UserIsBlock(userId string) (bool, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return false, err + } + var user db.BlackList + rows := dbConn.Table("black_lists").Where("uid=?", userId).First(&user).RowsAffected + if rows >= 1 { + return true, nil + } + return false, nil +} + +func BlockUser(userId, endDisableTime string) error { + user, err := GetUserByUserID(userId) + if err != nil || user.UserID == "" { + return err + } + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + end, err := time.Parse("2006-01-02 15:04:05", endDisableTime) + if err != nil { + return err + } + if end.Before(time.Now()) { + return constant.ErrDB + } + var blockUser db.BlackList + dbConn.Table("black_lists").Where("uid=?", userId).First(&blockUser) + if blockUser.UserId != "" { + dbConn.Model(&blockUser).Where("uid=?", blockUser.UserId).Update("end_disable_time", end) + return nil + } + blockUser = db.BlackList{ + UserId: userId, + BeginDisableTime: time.Now(), + EndDisableTime: end, + } + result := dbConn.Create(&blockUser) + return result.Error +} + +func UnBlockUser(userId string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(true) + result := dbConn.Where("uid=?", userId).Delete(&db.BlackList{}) + return result.Error +} + +type BlockUserInfo struct { + User db.User + BeginDisableTime time.Time + EndDisableTime time.Time +} + +func GetBlockUserById(userId string) (BlockUserInfo, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var blockUserInfo BlockUserInfo + blockUser := db.BlackList{ + UserId: userId, + } + if err != nil { + return blockUserInfo, err + } + if err = dbConn.Table("black_lists").Where("uid=?", userId).Find(&blockUser).Error; err != nil { + return blockUserInfo, err + } + user := db.User{ + UserID: blockUser.UserId, + } + if err := dbConn.Find(&user).Error; err != nil { + return blockUserInfo, err + } + blockUserInfo.User.UserID = user.UserID + blockUserInfo.User.FaceURL = user.UserID + blockUserInfo.User.Nickname = user.Nickname + blockUserInfo.BeginDisableTime = blockUser.BeginDisableTime + blockUserInfo.EndDisableTime = blockUser.EndDisableTime + return blockUserInfo, nil +} + +func GetBlockUsers(showNumber, pageNumber int32) ([]BlockUserInfo, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var blockUserInfos []BlockUserInfo + var blockUsers []db.BlackList + if err != nil { + return blockUserInfos, err + } + dbConn.LogMode(true) + if err = dbConn.Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&blockUsers).Error; err != nil { + return blockUserInfos, err + } + for _, blockUser := range blockUsers { + var user db.User + if err := dbConn.Table("users").Where("user_id=?", blockUser.UserId).First(&user).Error; err == nil { + blockUserInfos = append(blockUserInfos, BlockUserInfo{ + User: db.User{ + UserID: user.UserID, + Nickname: user.Nickname, + FaceURL: user.FaceURL, + }, + BeginDisableTime: blockUser.BeginDisableTime, + EndDisableTime: blockUser.EndDisableTime, + }) + } + } + return blockUserInfos, nil +} + +func GetUserByName(userName string, showNumber, pageNumber int32) ([]db.User, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var users []db.User + if err != nil { + return users, err + } + dbConn.LogMode(true) + err = dbConn.Table("users").Where(fmt.Sprintf(" name like '%%%s%%' ", userName)).Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&users).Error + return users, err +} + +func GetUsersCount(user db.User) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var count int32 + if err := dbConn.Table("users").Where(fmt.Sprintf(" name like '%%%s%%' ", user.Nickname)).Count(&count).Error; err != nil { + return 0, err + } + return count, nil +} + +func GetBlockUsersNumCount() (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(true) + var count int32 + if err := dbConn.Model(&db.BlackList{}).Count(&count).Error; err != nil { + return 0, err + } + return count, nil } diff --git a/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go index 73defd89d..99c099ac4 100644 --- a/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go +++ b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go @@ -7,42 +7,45 @@ package im_mysql_msg_model import ( + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" - "database/sql" - "time" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "github.com/jinzhu/copier" ) -// ChatLog Chat information table structure -type ChatLog struct { - MsgId string `gorm:"primary_key"` // Chat history primary key ID - SendID string `gorm:"column:send_id"` // Send ID - RecvID string `gorm:"column:recv_id"` //Receive ID - SendTime time.Time `gorm:"column:send_time"` // Send time - SessionType int32 `gorm:"column:session_type"` // Session type - ContentType int32 `gorm:"column:content_type"` // Message content type - MsgFrom int32 `gorm:"column:msg_from"` // Source, user, system - Content string `gorm:"column:content"` // Chat content - SenderPlatformID int32 `gorm:"column:sender_platform_id"` //The sender's platform ID - Remark sql.NullString `gorm:"column:remark"` // remark -} - -func InsertMessageToChatLog(msgData pbMsg.WSToMsgSvrChatMsg) error { +func InsertMessageToChatLog(msg pbMsg.MsgDataToMQ) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { return err } - chatLog := ChatLog{ - MsgId: msgData.MsgID, - SendID: msgData.SendID, - RecvID: msgData.RecvID, - SendTime: utils.UnixNanoSecondToTime(msgData.SendTime), - SessionType: msgData.SessionType, - ContentType: msgData.ContentType, - MsgFrom: msgData.MsgFrom, - Content: msgData.Content, - SenderPlatformID: msgData.PlatformID, + chatLog := new(db.ChatLog) + copier.Copy(chatLog, msg.MsgData) + switch msg.MsgData.SessionType { + case constant.GroupChatType: + chatLog.RecvID = msg.MsgData.GroupID + case constant.SingleChatType: + chatLog.RecvID = msg.MsgData.RecvID } - return dbConn.Table("chat_log").Create(chatLog).Error + if msg.MsgData.ContentType >= constant.NotificationBegin && msg.MsgData.ContentType <= constant.NotificationEnd { + var tips server_api_params.TipsComm + _ = proto.Unmarshal(msg.MsgData.Content, &tips) + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + chatLog.Content, _ = marshaler.MarshalToString(&tips) + + } else { + chatLog.Content = string(msg.MsgData.Content) + } + chatLog.CreateTime = utils.UnixMillSecondToTime(msg.MsgData.CreateTime) + chatLog.SendTime = utils.UnixMillSecondToTime(msg.MsgData.SendTime) + log.NewDebug("test", "this is ", chatLog) + return dbConn.Table("chat_logs").Create(chatLog).Error } diff --git a/pkg/common/db/mysql_model/im_mysql_msg_model/receive_model.go b/pkg/common/db/mysql_model/im_mysql_msg_model/receive_model.go deleted file mode 100644 index 3973f71ef..000000000 --- a/pkg/common/db/mysql_model/im_mysql_msg_model/receive_model.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -** description(""). -** copyright('tuoyun,www.tuoyun.net'). -** author("fg,Gordon@tuoyun.net"). -** time(2021/3/4 11:18). - */ -package im_mysql_msg_model - -import ( - "time" -) - -// Receive Inbox table structure -type Receive struct { - UserId string `gorm:"primary_key"` // 收件箱主键ID - Seq int64 `gorm:"primary_key"` // 收件箱主键ID - MsgId string - CreateTime *time.Time -} - -//func InsertMessageToReceive(seq int64, userid, msgid string) error { -// conn := db.NewDbConnection() -// receive := Receive{ -// UID: userid, -// Seq: seq, -// MsgId: msgid, -// } -// err := conn.Table("receive").Create(&receive).Error -// return err -//} -//func GetBiggestSeqFromReceive(userid string) (seq int64, err error) { -// //得到数据库的连接(并非真连接,调用时才连接,由gorm自动维护数据库连接池) -// conn := db.NewDbConnection() -// err = conn.Raw("select max(seq) from receive where user_id = ?", userid).Row().Scan(&seq) -// return seq, err -//} diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go index b31fde8c1..c8529b97c 100644 --- a/pkg/common/db/redisModel.go +++ b/pkg/common/db/redisModel.go @@ -1,15 +1,19 @@ package db import ( + "Open_IM/pkg/common/constant" log2 "Open_IM/pkg/common/log" "github.com/garyburd/redigo/redis" ) const ( - userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq - appleDeviceToken = "DEVICE_TOKEN" - lastGetSeq = "LAST_GET_SEQ" - userMinSeq = "REDIS_USER_MIN_SEQ:" + AccountTempCode = "ACCOUNT_TEMP_CODE" + resetPwdTempCode = "RESET_PWD_TEMP_CODE" + userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq + appleDeviceToken = "DEVICE_TOKEN" + userMinSeq = "REDIS_USER_MIN_SEQ:" + uidPidToken = "UID_PID_TOKEN_STATUS:" + conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:" ) func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { @@ -31,30 +35,43 @@ func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (inte return con.Do(cmd, params...) } +func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { + key := AccountTempCode + account + return redis.Bool(d.Exec("EXISTS", key)) +} +func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error) { + key := AccountTempCode + account + _, err = d.Exec("SET", key, code, "ex", ttl) + return err +} +func (d *DataBases) GetAccountCode(account string) (string, error) { + key := AccountTempCode + account + return redis.String(d.Exec("GET", key)) +} //Perform seq auto-increment operation of user messages -func (d *DataBases) IncrUserSeq(uid string) (int64, error) { +func (d *DataBases) IncrUserSeq(uid string) (uint64, error) { key := userIncrSeq + uid - return redis.Int64(d.Exec("INCR", key)) + return redis.Uint64(d.Exec("INCR", key)) } //Get the largest Seq -func (d *DataBases) GetUserMaxSeq(uid string) (int64, error) { +func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) { key := userIncrSeq + uid - return redis.Int64(d.Exec("GET", key)) + return redis.Uint64(d.Exec("GET", key)) } //Set the user's minimum seq -func (d *DataBases) SetUserMinSeq(uid string, minSeq int64) (err error) { +func (d *DataBases) SetUserMinSeq(uid string, minSeq uint32) (err error) { key := userMinSeq + uid _, err = d.Exec("SET", key, minSeq) return err } //Get the smallest Seq -func (d *DataBases) GetUserMinSeq(uid string) (int64, error) { +func (d *DataBases) GetUserMinSeq(uid string) (uint64, error) { key := userMinSeq + uid - return redis.Int64(d.Exec("GET", key)) + return redis.Uint64(d.Exec("GET", key)) } //Store Apple's device token to redis @@ -71,36 +88,57 @@ func (d *DataBases) DelAppleDeviceToken(accountAddress string) (err error) { return err } -//Record the last time the user actively pulled the value of Seq -func (d *DataBases) SetLastGetSeq(uid string) (err error) { - key := lastGetSeq + uid - _, err = d.Exec("SET", key) - return err -} - -//Get the value of the user's last active pull Seq -func (d *DataBases) GetLastGetSeq(uid string) (int64, error) { - key := lastGetSeq + uid - return redis.Int64(d.Exec("GET", key)) -} - //Store userid and platform class to redis -func (d *DataBases) SetUserIDAndPlatform(userID, platformClass, value string, ttl int64) error { - key := userID + platformClass - _, err := d.Exec("SET", key, value, "EX", ttl) +func (d *DataBases) AddTokenFlag(userID string, platformID int32, token string, flag int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + log2.NewDebug("", "add token key is ", key) + _, err1 := d.Exec("HSet", key, token, flag) + return err1 +} + +func (d *DataBases) GetTokenMapByUidPid(userID, platformID string) (map[string]int, error) { + key := uidPidToken + userID + ":" + platformID + log2.NewDebug("", "get token key is ", key) + return redis.IntMap(d.Exec("HGETALL", key)) +} +func (d *DataBases) SetTokenMapByUidPid(userID string, platformID int32, m map[string]int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) return err } - -//Check exists userid and platform class from redis -func (d *DataBases) ExistsUserIDAndPlatform(userID, platformClass string) (interface{}, error) { - key := userID + platformClass - exists, err := d.Exec("EXISTS", key) - return exists, err +func (d *DataBases) DeleteTokenByUidPid(userID string, platformID int32, fields []string) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + _, err := d.Exec("HDEL", key, redis.Args{}.Add().AddFlat(fields)...) + return err } - -//Get platform class Token -func (d *DataBases) GetPlatformToken(userID, platformClass string) (interface{}, error) { - key := userID + platformClass - token, err := d.Exec("GET", key) - return token, err +func (d *DataBases) SetSingleConversationMsgOpt(userID, conversationID string, opt int) error { + key := conversationReceiveMessageOpt + userID + _, err := d.Exec("HSet", key, conversationID, opt) + return err +} +func (d *DataBases) GetSingleConversationMsgOpt(userID, conversationID string) (int, error) { + key := conversationReceiveMessageOpt + userID + return redis.Int(d.Exec("HGet", key, conversationID)) +} +func (d *DataBases) GetAllConversationMsgOpt(userID string) (map[string]int, error) { + key := conversationReceiveMessageOpt + userID + return redis.IntMap(d.Exec("HGETALL", key)) +} +func (d *DataBases) SetMultiConversationMsgOpt(userID string, m map[string]int) error { + key := conversationReceiveMessageOpt + userID + _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) + return err +} +func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []string) (m map[string]int, err error) { + m = make(map[string]int) + key := conversationReceiveMessageOpt + userID + i, err := redis.Ints(d.Exec("hmget", key, redis.Args{}.Add().AddFlat(conversationIDs)...)) + if err != nil { + return m, err + } + for k, v := range conversationIDs { + m[v] = i[k] + } + return m, nil + } diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go new file mode 100644 index 000000000..1d9d254b7 --- /dev/null +++ b/pkg/common/db/redisModel_test.go @@ -0,0 +1,27 @@ +package db + +import ( + "fmt" + "github.com/stretchr/testify/assert" + "testing" +) + +func Test_SetTokenMapByUidPid(t *testing.T) { + m := make(map[string]int, 0) + m["test1"] = 1 + m["test2"] = 2 + m["2332"] = 4 + _ = DB.SetTokenMapByUidPid("1234", 2, m) + +} +func Test_GetTokenMapByUidPid(t *testing.T) { + m, err := DB.GetTokenMapByUidPid("1234", "Android") + assert.Nil(t, err) + fmt.Println(m) +} + +func TestDataBases_GetMultiConversationMsgOpt(t *testing.T) { + m, err := DB.GetMultiConversationMsgOpt("fg", []string{"user", "age", "color"}) + assert.Nil(t, err) + fmt.Println(m) +} diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go index 85f2c9f79..e227da91e 100644 --- a/pkg/common/http/http_client.go +++ b/pkg/common/http/http_client.go @@ -29,25 +29,38 @@ func Get(url string) (response []byte, err error) { } //application/json; charset=utf-8 -func Post(url string, data interface{}, contentType string) (content []byte, err error) { - jsonStr, _ := json.Marshal(data) +func Post(url string, data interface{}, timeOutSecond int) (content []byte, err error) { + jsonStr, err := json.Marshal(data) + if err != nil { + return nil, err + } req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) if err != nil { return nil, err } - req.Header.Add("content-type", contentType) - defer req.Body.Close() + req.Close = true + req.Header.Add("content-type", "application/json; charset=utf-8") - client := &http.Client{Timeout: 5 * time.Second} + client := &http.Client{Timeout: time.Duration(timeOutSecond) * time.Second} resp, err := client.Do(req) if err != nil { return nil, err } defer resp.Body.Close() - result, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, err } return result, nil } + +func PostReturn(url string, input, output interface{}, timeOut int) error { + b, err := Post(url, input, timeOut) + if err != nil { + return err + } + if err = json.Unmarshal(b, output); err != nil { + return err + } + return nil +} diff --git a/pkg/common/http/http_resp.go b/pkg/common/http/http_resp.go new file mode 100644 index 000000000..cdbf04463 --- /dev/null +++ b/pkg/common/http/http_resp.go @@ -0,0 +1,43 @@ +package http + +import ( + "Open_IM/pkg/common/constant" + "fmt" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + //"Open_IM/pkg/cms_api_struct" + "net/http" + + "github.com/gin-gonic/gin" +) + +type BaseResp struct { + Code int32 `json:"code"` + ErrMsg string `json:"err_msg"` + Data interface{} `json:"data"` +} + +func RespHttp200(ctx *gin.Context, err error, data interface{}) { + var resp BaseResp + switch e := err.(type) { + case constant.ErrInfo: + resp.Code = e.ErrCode + resp.ErrMsg = e.ErrMsg + default: + s, ok := status.FromError(err) + if !ok { + fmt.Println("need grpc format error") + return + } + resp.Code = int32(s.Code()) + resp.ErrMsg = s.Message() + } + resp.Data = data + ctx.JSON(http.StatusOK, resp) +} + +// warp error +func WrapError(err constant.ErrInfo) error { + return status.Error(codes.Code(err.ErrCode), err.ErrMsg) +} diff --git a/pkg/common/kafka/consumer.go b/pkg/common/kafka/consumer.go index eed6ef142..771145906 100644 --- a/pkg/common/kafka/consumer.go +++ b/pkg/common/kafka/consumer.go @@ -20,14 +20,14 @@ func NewKafkaConsumer(addr []string, topic string) *Consumer { consumer, err := sarama.NewConsumer(p.addr, nil) if err != nil { - panic(err) + panic(err.Error()) return nil } p.Consumer = consumer partitionList, err := consumer.Partitions(p.Topic) if err != nil { - panic(err) + panic(err.Error()) return nil } p.PartitionList = partitionList diff --git a/pkg/common/kafka/consumer_group.go b/pkg/common/kafka/consumer_group.go index 4c4af5033..3af714373 100644 --- a/pkg/common/kafka/consumer_group.go +++ b/pkg/common/kafka/consumer_group.go @@ -30,11 +30,11 @@ func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addr []stri config.Consumer.Return.Errors = consumerConfig.IsReturnErr client, err := sarama.NewClient(addr, config) if err != nil { - panic(err) + panic(err.Error()) } consumerGroup, err := sarama.NewConsumerGroupFromClient(groupID, client) if err != nil { - panic(err) + panic(err.Error()) } return &MConsumerGroup{ consumerGroup, @@ -47,7 +47,7 @@ func (mc *MConsumerGroup) RegisterHandleAndConsumer(handler sarama.ConsumerGroup for { err := mc.ConsumerGroup.Consume(ctx, mc.topics, handler) if err != nil { - panic(err) + panic(err.Error()) } } } diff --git a/pkg/common/kafka/producer.go b/pkg/common/kafka/producer.go index c82df975f..98ad92209 100644 --- a/pkg/common/kafka/producer.go +++ b/pkg/common/kafka/producer.go @@ -25,7 +25,7 @@ func NewKafkaProducer(addr []string, topic string) *Producer { producer, err := sarama.NewSyncProducer(p.addr, p.config) //Initialize the client if err != nil { - panic(err) + panic(err.Error()) return nil } p.producer = producer diff --git a/pkg/common/log/es_hk.go b/pkg/common/log/es_hk.go index 061773e5d..19eafaed5 100644 --- a/pkg/common/log/es_hk.go +++ b/pkg/common/log/es_hk.go @@ -61,19 +61,18 @@ func newEsHook(moduleName string) *esHook { return &esHook{client: es, moduleName: moduleName} } -//Fire log hook interface 方法 +//Fire log hook interface func (hook *esHook) Fire(entry *logrus.Entry) error { doc := newEsLog(entry) go hook.sendEs(doc) return nil } -//Levels log hook interface 方法,此hook影响的日志 func (hook *esHook) Levels() []logrus.Level { return logrus.AllLevels } -//sendEs 异步发送日志到es +//sendEs func (hook *esHook) sendEs(doc appLogDocModel) { defer func() { if r := recover(); r != nil { @@ -102,7 +101,7 @@ func newEsLog(e *logrus.Entry) appLogDocModel { return ins } -// indexName es index name 时间分割 +// indexName es index name func (m *appLogDocModel) indexName() string { return time.Now().Format("2006-01-02") } diff --git a/pkg/common/log/file_line_hk.go b/pkg/common/log/file_line_hk.go index 7eeb6ea82..bc908ee03 100644 --- a/pkg/common/log/file_line_hk.go +++ b/pkg/common/log/file_line_hk.go @@ -24,10 +24,21 @@ func (f *fileHook) Levels() []logrus.Level { } func (f *fileHook) Fire(entry *logrus.Entry) error { - entry.Data["FilePath"] = findCaller(5) + entry.Data["FilePath"] = findCaller(6) return nil } +//func (f *fileHook) Fire(entry *logrus.Entry) error { +// var s string +// _, b, c, _ := runtime.Caller(10) +// i := strings.SplitAfter(b, "/") +// if len(i) > 3 { +// s = i[len(i)-3] + i[len(i)-2] + i[len(i)-1] + ":" + utils.IntToString(c) +// } +// entry.Data["FilePath"] = s +// return nil +//} + func findCaller(skip int) string { file := "" line := 0 diff --git a/pkg/common/log/logrus.go b/pkg/common/log/logrus.go index b88a6f6d3..a5e0ae7dd 100644 --- a/pkg/common/log/logrus.go +++ b/pkg/common/log/logrus.go @@ -4,12 +4,13 @@ import ( "Open_IM/pkg/common/config" "bufio" "fmt" + "os" + "time" + nested "github.com/antonfisher/nested-logrus-formatter" rotatelogs "github.com/lestrrat-go/file-rotatelogs" "github.com/rifflock/lfshook" "github.com/sirupsen/logrus" - "os" - "time" ) var logger *Logger @@ -34,10 +35,11 @@ func loggerInit(moduleName string) *Logger { //Close std console output src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend) if err != nil { - panic(err) + panic(err.Error()) } writer := bufio.NewWriter(src) logger.SetOutput(writer) + //logger.SetOutput(os.Stdout) //Log Console Print Style Setting logger.SetFormatter(&nested.Formatter{ TimestampFormat: "2006-01-02 15:04:05.000", @@ -82,39 +84,31 @@ func initRotateLogs(rotationTime time.Duration, maxRemainNum uint, level string, rotatelogs.WithRotationCount(maxRemainNum), ) if err != nil { - panic(err) + panic(err.Error()) } else { return writer } } -//Deprecated -func Info(token, OperationID, format string, args ...interface{}) { +func Info(OperationID string, args ...interface{}) { logger.WithFields(logrus.Fields{ - "PID": logger.Pid, "OperationID": OperationID, - }).Infof(format, args...) - + "PID": logger.Pid, + }).Infoln(args) } -//Deprecated -func Error(token, OperationID, format string, args ...interface{}) { - +func Error(OperationID string, args ...interface{}) { logger.WithFields(logrus.Fields{ - "PID": logger.Pid, "OperationID": OperationID, - }).Errorf(format, args...) - + "PID": logger.Pid, + }).Errorln(args) } -//Deprecated -func Debug(token, OperationID, format string, args ...interface{}) { - +func Debug(OperationID string, args ...interface{}) { logger.WithFields(logrus.Fields{ - "PID": logger.Pid, "OperationID": OperationID, - }).Debugf(format, args...) - + "PID": logger.Pid, + }).Debugln(args) } //Deprecated diff --git a/pkg/common/multi_terminal_login/multi_terminal_login.go b/pkg/common/multi_terminal_login/multi_terminal_login.go index ba0c0525c..3c3245e63 100644 --- a/pkg/common/multi_terminal_login/multi_terminal_login.go +++ b/pkg/common/multi_terminal_login/multi_terminal_login.go @@ -1,73 +1,73 @@ package multi_terminal_login -import ( - "Open_IM/internal/push/content_struct" - "Open_IM/internal/push/logic" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db" - pbChat "Open_IM/pkg/proto/chat" - "Open_IM/pkg/utils" -) - -func MultiTerminalLoginChecker(uid, token string, platformID int32) error { - // 1.check userid and platform class 0 not exists and 1 exists - existsInterface, err := db.DB.ExistsUserIDAndPlatform(uid, utils.PlatformNameToClass(utils.PlatformIDToName(platformID))) - if err != nil { - return err - } - exists := existsInterface.(int64) - //get config multi login policy - if config.Config.MultiLoginPolicy.OnlyOneTerminalAccess { - //OnlyOneTerminalAccess policy need to check all terminal - if utils.PlatformNameToClass(utils.PlatformIDToName(platformID)) == "PC" { - existsInterface, err = db.DB.ExistsUserIDAndPlatform(uid, "Mobile") - if err != nil { - return err - } - } else { - existsInterface, err = db.DB.ExistsUserIDAndPlatform(uid, "PC") - if err != nil { - return err - } - } - exists = existsInterface.(int64) - if exists == 1 { - err := db.DB.SetUserIDAndPlatform(uid, utils.PlatformNameToClass(utils.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire) - if err != nil { - return err - } - PushMessageToTheTerminal(uid, platformID) - return nil - } - } else if config.Config.MultiLoginPolicy.MobileAndPCTerminalAccessButOtherTerminalKickEachOther { - // common terminal need to kick eich other - if exists == 1 { - err := db.DB.SetUserIDAndPlatform(uid, utils.PlatformNameToClass(utils.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire) - if err != nil { - return err - } - PushMessageToTheTerminal(uid, platformID) - return nil - } - } - err = db.DB.SetUserIDAndPlatform(uid, utils.PlatformNameToClass(utils.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire) - if err != nil { - return err - } - PushMessageToTheTerminal(uid, platformID) - return nil -} - -func PushMessageToTheTerminal(uid string, platform int32) { - - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: uid, - RecvID: uid, - Content: content_struct.NewContentStructString(1, "", "Your account is already logged on other terminal,please confirm"), - SendTime: utils.GetCurrentTimestampBySecond(), - MsgFrom: constant.SysMsgType, - ContentType: constant.KickOnlineTip, - PlatformID: platform, - }) -} +// +//import ( +// "Open_IM/internal/push/content_struct" +// "Open_IM/internal/push/logic" +// "Open_IM/pkg/common/config" +// "Open_IM/pkg/common/constant" +// "Open_IM/pkg/common/db" +// pbChat "Open_IM/pkg/proto/chat" +// "Open_IM/pkg/utils" +//) +// +//const DayOfSecond = 24*60*60 +//func MultiTerminalLoginChecker(uid, token string, platformID int32) error { +// // 1.check userid and platform class 0 not exists and 1 exists +// exists, err := db.DB.ExistsUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID))) +// if err != nil { +// return err +// } +// //get config multi login policy +// if config.Config.MultiLoginPolicy { +// //OnlyOneTerminalAccess policy need to check all terminal +// if constant.PlatformNameToClass(constant.PlatformIDToName(platformID)) == "PC" { +// exists, err = db.DB.ExistsUserIDAndPlatform(uid, "Mobile") +// if err != nil { +// return err +// } +// } else { +// exists, err = db.DB.ExistsUserIDAndPlatform(uid, "PC") +// if err != nil { +// return err +// } +// } +// if exists == 1 { +// err := db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond) +// if err != nil { +// return err +// } +// PushMessageToTheTerminal(uid, platformID) +// return nil +// } +// } else if config.Config.MultiLoginPolicy.MobileAndPCTerminalAccessButOtherTerminalKickEachOther { +// // common terminal need to kick eich other +// if exists == 1 { +// err := db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond) +// if err != nil { +// return err +// } +// PushMessageToTheTerminal(uid, platformID) +// return nil +// } +// } +// err = db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond) +// if err != nil { +// return err +// } +// PushMessageToTheTerminal(uid, platformID) +// return nil +//} +//// +////func PushMessageToTheTerminal(uid string, platform int32) { +//// +//// logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ +//// SendID: uid, +//// RecvID: uid, +//// Content: content_struct.NewContentStructString(1, "", "Your account is already logged on other terminal,please confirm"), +//// SendTime: utils.GetCurrentTimestampBySecond(), +//// MsgFrom: constant.SysMsgType, +//// ContentType: constant.KickOnlineTip, +//// PlatformID: platform, +//// }) +////} diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go new file mode 100644 index 000000000..50aecc8ae --- /dev/null +++ b/pkg/common/token_verify/jwt_token.go @@ -0,0 +1,206 @@ +package token_verify + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + commonDB "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "github.com/garyburd/redigo/redis" + "github.com/golang-jwt/jwt/v4" + "time" +) + +//var ( +// TokenExpired = errors.New("token is timed out, please log in again") +// TokenInvalid = errors.New("token has been invalidated") +// TokenNotValidYet = errors.New("token not active yet") +// TokenMalformed = errors.New("that's not even a token") +// TokenUnknown = errors.New("couldn't handle this token") +//) + +type Claims struct { + UID string + Platform string //login platform + jwt.RegisteredClaims +} + +func BuildClaims(uid, platform string, ttl int64) Claims { + now := time.Now() + return Claims{ + UID: uid, + Platform: platform, + RegisteredClaims: jwt.RegisteredClaims{ + ExpiresAt: jwt.NewNumericDate(now.Add(time.Duration(ttl*24) * time.Hour)), //Expiration time + IssuedAt: jwt.NewNumericDate(now), //Issuing time + NotBefore: jwt.NewNumericDate(now), //Begin Effective time + }} +} + +func CreateToken(userID string, platformID int32) (string, int64, error) { + claims := BuildClaims(userID, constant.PlatformIDToName(platformID), config.Config.TokenPolicy.AccessExpire) + token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) + tokenString, err := token.SignedString([]byte(config.Config.TokenPolicy.AccessSecret)) + if err != nil { + return "", 0, err + } + //remove Invalid token + m, err := commonDB.DB.GetTokenMapByUidPid(userID, constant.PlatformIDToName(platformID)) + if err != nil && err != redis.ErrNil { + return "", 0, err + } + var deleteTokenKey []string + for k, v := range m { + _, err = GetClaimFromToken(k) + if err != nil || v != constant.NormalToken { + deleteTokenKey = append(deleteTokenKey, k) + } + } + if len(deleteTokenKey) != 0 { + err = commonDB.DB.DeleteTokenByUidPid(userID, platformID, deleteTokenKey) + if err != nil { + return "", 0, err + } + } + err = commonDB.DB.AddTokenFlag(userID, platformID, tokenString, constant.NormalToken) + if err != nil { + return "", 0, err + } + return tokenString, claims.ExpiresAt.Time.Unix(), err +} + +func secret() jwt.Keyfunc { + return func(token *jwt.Token) (interface{}, error) { + return []byte(config.Config.TokenPolicy.AccessSecret), nil + } +} + +func GetClaimFromToken(tokensString string) (*Claims, error) { + token, err := jwt.ParseWithClaims(tokensString, &Claims{}, secret()) + if err != nil { + if ve, ok := err.(*jwt.ValidationError); ok { + if ve.Errors&jwt.ValidationErrorMalformed != 0 { + return nil, &constant.ErrTokenMalformed + } else if ve.Errors&jwt.ValidationErrorExpired != 0 { + return nil, &constant.ErrTokenExpired + } else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 { + return nil, &constant.ErrTokenNotValidYet + } else { + return nil, &constant.ErrTokenUnknown + } + } else { + return nil, &constant.ErrTokenNotValidYet + } + } else { + if claims, ok := token.Claims.(*Claims); ok && token.Valid { + log.NewDebug("", claims.UID, claims.Platform) + return claims, nil + } + return nil, &constant.ErrTokenNotValidYet + } +} + +func IsAppManagerAccess(token string, OpUserID string) bool { + claims, err := ParseToken(token) + if err != nil { + return false + } + if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) && claims.UID == OpUserID { + return true + } + return false +} + +func IsMangerUserID(OpUserID string) bool { + if utils.IsContain(OpUserID, config.Config.Manager.AppManagerUid) { + return true + } else { + return false + } +} + +func CheckAccess(OpUserID string, OwnerUserID string) bool { + if utils.IsContain(OpUserID, config.Config.Manager.AppManagerUid) { + return true + } + if OpUserID == OwnerUserID { + return true + } + return false +} + +func GetUserIDFromToken(token string) (bool, string) { + claims, err := ParseToken(token) + if err != nil { + return false, "" + } + return true, claims.UID +} + +func ParseToken(tokensString string) (claims *Claims, err error) { + + claims, err = GetClaimFromToken(tokensString) + if err != nil { + log.NewError("", "token validate err", err.Error()) + return nil, err + } + + m, err := commonDB.DB.GetTokenMapByUidPid(claims.UID, claims.Platform) + if err != nil { + log.NewError("", "get token from redis err", err.Error()) + return nil, &constant.ErrTokenInvalid + } + if m == nil { + log.NewError("", "get token from redis err", "m is nil") + return nil, &constant.ErrTokenInvalid + } + if v, ok := m[tokensString]; ok { + switch v { + case constant.NormalToken: + log.NewDebug("", "this is normal return", claims) + return claims, nil + case constant.InValidToken: + return nil, &constant.ErrTokenInvalid + case constant.KickedToken: + return nil, &constant.ErrTokenInvalid + case constant.ExpiredToken: + return nil, &constant.ErrTokenExpired + default: + return nil, &constant.ErrTokenUnknown + } + } + return nil, &constant.ErrTokenUnknown +} + +//func MakeTheTokenInvalid(currentClaims *Claims, platformClass string) (bool, error) { +// storedRedisTokenInterface, err := db.DB.GetPlatformToken(currentClaims.UID, platformClass) +// if err != nil { +// return false, err +// } +// storedRedisPlatformClaims, err := ParseRedisInterfaceToken(storedRedisTokenInterface) +// if err != nil { +// return false, err +// } +// //if issue time less than redis token then make this token invalid +// if currentClaims.IssuedAt.Time.Unix() < storedRedisPlatformClaims.IssuedAt.Time.Unix() { +// return true, constant.TokenInvalid +// } +// return false, nil +//} + +func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) { + return GetClaimFromToken(string(redisToken.([]uint8))) +} + +//Validation token, false means failure, true means successful verification +func VerifyToken(token, uid string) (bool, error) { + claims, err := ParseToken(token) + if err != nil { + return false, err + } + if claims.UID != uid { + return false, &constant.ErrTokenUnknown + } + log.NewDebug("", claims.UID, claims.Platform) + return true, nil +} diff --git a/pkg/common/utils/utils.go b/pkg/common/utils/utils.go new file mode 100644 index 000000000..8e7346cc1 --- /dev/null +++ b/pkg/common/utils/utils.go @@ -0,0 +1,153 @@ +package utils + +import ( + db "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/token_verify" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "math/rand" + "strconv" + "time" +) + +func OperationIDGenerator() string { + return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10) +} + +func FriendOpenIMCopyDB(dst *db.Friend, src *open_im_sdk.FriendInfo) { + utils.CopyStructFields(dst, src) + dst.FriendUserID = src.FriendUser.UserID + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) +} + +func FriendDBCopyOpenIM(dst *open_im_sdk.FriendInfo, src *db.Friend) error { + utils.CopyStructFields(dst, src) + user, err := imdb.GetUserByUserID(src.FriendUserID) + if err != nil { + return utils.Wrap(err, "") + } + utils.CopyStructFields(dst.FriendUser, user) + dst.CreateTime = uint32(src.CreateTime.Unix()) + if dst.FriendUser == nil { + dst.FriendUser = &open_im_sdk.UserInfo{} + } + dst.FriendUser.CreateTime = uint32(user.CreateTime.Unix()) + return nil +} + +// +func FriendRequestOpenIMCopyDB(dst *db.FriendRequest, src *open_im_sdk.FriendRequest) { + utils.CopyStructFields(dst, src) + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) + dst.HandleTime = utils.UnixSecondToTime(int64(src.HandleTime)) +} + +func FriendRequestDBCopyOpenIM(dst *open_im_sdk.FriendRequest, src *db.FriendRequest) error { + utils.CopyStructFields(dst, src) + user, err := imdb.GetUserByUserID(src.FromUserID) + if err != nil { + return utils.Wrap(err, "") + } + dst.FromNickname = user.Nickname + dst.FromFaceURL = user.FaceURL + dst.FromGender = user.Gender + user, err = imdb.GetUserByUserID(src.ToUserID) + if err != nil { + return utils.Wrap(err, "") + } + dst.ToNickname = user.Nickname + dst.ToFaceURL = user.FaceURL + dst.ToGender = user.Gender + dst.CreateTime = uint32(src.CreateTime.Unix()) + dst.HandleTime = uint32(src.HandleTime.Unix()) + return nil +} + +func BlackOpenIMCopyDB(dst *db.Black, src *open_im_sdk.BlackInfo) { + utils.CopyStructFields(dst, src) + dst.BlockUserID = src.BlackUserInfo.UserID + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) +} + +func BlackDBCopyOpenIM(dst *open_im_sdk.BlackInfo, src *db.Black) error { + utils.CopyStructFields(dst, src) + dst.CreateTime = uint32(src.CreateTime.Unix()) + user, err := imdb.GetUserByUserID(src.BlockUserID) + if err != nil { + return utils.Wrap(err, "") + } + utils.CopyStructFields(dst.BlackUserInfo, user) + return nil +} + +func GroupOpenIMCopyDB(dst *db.Group, src *open_im_sdk.GroupInfo) { + utils.CopyStructFields(dst, src) +} + +func GroupDBCopyOpenIM(dst *open_im_sdk.GroupInfo, src *db.Group) error { + utils.CopyStructFields(dst, src) + user, err := imdb.GetGroupOwnerInfoByGroupID(src.GroupID) + if err != nil { + return utils.Wrap(err, "") + } + dst.OwnerUserID = user.UserID + + dst.MemberCount, err = imdb.GetGroupMemberNumByGroupID(src.GroupID) + if err != nil { + return utils.Wrap(err, "") + } + dst.CreateTime = uint32(src.CreateTime.Unix()) + return nil +} + +func GroupMemberOpenIMCopyDB(dst *db.GroupMember, src *open_im_sdk.GroupMemberFullInfo) { + utils.CopyStructFields(dst, src) +} + +func GroupMemberDBCopyOpenIM(dst *open_im_sdk.GroupMemberFullInfo, src *db.GroupMember) error { + utils.CopyStructFields(dst, src) + if token_verify.IsMangerUserID(src.UserID) { + u, err := imdb.GetUserByUserID(src.UserID) + if err != nil { + return utils.Wrap(err, "") + } + + utils.CopyStructFields(dst, u) + + dst.AppMangerLevel = 1 + } + dst.JoinTime = int32(src.JoinTime.Unix()) + return nil +} + +func GroupRequestOpenIMCopyDB(dst *db.GroupRequest, src *open_im_sdk.GroupRequest) { + utils.CopyStructFields(dst, src) +} + +func GroupRequestDBCopyOpenIM(dst *open_im_sdk.GroupRequest, src *db.GroupRequest) { + utils.CopyStructFields(dst, src) + dst.ReqTime = uint32(src.ReqTime.Unix()) + dst.HandleTime = uint32(src.HandledTime.Unix()) +} + +func UserOpenIMCopyDB(dst *db.User, src *open_im_sdk.UserInfo) { + utils.CopyStructFields(dst, src) + dst.Birth = utils.UnixSecondToTime(int64(src.Birth)) + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) +} + +func UserDBCopyOpenIM(dst *open_im_sdk.UserInfo, src *db.User) { + utils.CopyStructFields(dst, src) + dst.CreateTime = uint32(src.CreateTime.Unix()) + dst.Birth = uint32(src.Birth.Unix()) +} + +func UserDBCopyOpenIMPublicUser(dst *open_im_sdk.PublicUserInfo, src *db.User) { + utils.CopyStructFields(dst, src) +} + +// +//func PublicUserDBCopyOpenIM(dst *open_im_sdk.PublicUserInfo, src *db.User){ +// +//} diff --git a/pkg/grpc-etcdv3/getcdv3/register.go b/pkg/grpc-etcdv3/getcdv3/register.go index e1a78dd61..898a4b8c0 100644 --- a/pkg/grpc-etcdv3/getcdv3/register.go +++ b/pkg/grpc-etcdv3/getcdv3/register.go @@ -1,12 +1,14 @@ package getcdv3 import ( + "Open_IM/pkg/common/log" "context" "fmt" "go.etcd.io/etcd/clientv3" "net" "strconv" "strings" + "time" ) type RegEtcd struct { @@ -36,12 +38,12 @@ func RegisterEtcd4Unique(schema, etcdAddr, myHost string, myPort int, serviceNam //etcdAddr separated by commas func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName string, ttl int) error { + ttl = ttl * 3 cli, err := clientv3.New(clientv3.Config{ - Endpoints: strings.Split(etcdAddr, ","), - }) - fmt.Println("RegisterEtcd") + Endpoints: strings.Split(etcdAddr, ","), DialTimeout: 5 * time.Second}) + + log.Info("", "RegisterEtcd, ", schema, etcdAddr, myHost, myPort, serviceName, ttl) if err != nil { - // return fmt.Errorf("grpclb: create clientv3 client failed: %v", err) return fmt.Errorf("create etcd clientv3 client failed, errmsg:%v, etcd addr:%s", err, etcdAddr) } @@ -64,17 +66,28 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin //keepalive kresp, err := cli.KeepAlive(ctx, resp.ID) if err != nil { - return fmt.Errorf("keepalive faild, errmsg:%v, lease id:%d", err, resp.ID) + return fmt.Errorf("keepalive failed, errmsg:%v, lease id:%d", err, resp.ID) } + //log.Info("", "RegisterEtcd ok ") go func() { - FLOOP: for { select { - case _, ok := <-kresp: + case pv, ok := <-kresp: if ok == true { + log.Debug("", "KeepAlive kresp ok", pv) } else { - break FLOOP + log.Error("", "KeepAlive kresp failed", pv) + t := time.NewTicker(time.Duration(ttl) * time.Second) + for { + select { + case <-t.C: + } + if _, err := cli.Put(ctx, serviceKey, serviceValue, clientv3.WithLease(resp.ID)); err != nil { + log.Error("", "etcd Put failed ", err.Error(), serviceKey, serviceValue, resp.ID) + } + log.Info("", "etcd Put ok", serviceKey, serviceValue, resp.ID) + } } } } diff --git a/pkg/grpc-etcdv3/getcdv3/resolver.go b/pkg/grpc-etcdv3/getcdv3/resolver.go index aa41f86c4..1e57f8cdd 100644 --- a/pkg/grpc-etcdv3/getcdv3/resolver.go +++ b/pkg/grpc-etcdv3/getcdv3/resolver.go @@ -102,7 +102,7 @@ func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts re if err == nil { var addrList []resolver.Address for i := range resp.Kvs { - fmt.Println("init addr: ", string(resp.Kvs[i].Value)) + //log.Debug("", "init addr: ", string(resp.Kvs[i].Value)) addrList = append(addrList, resolver.Address{Addr: string(resp.Kvs[i].Value)}) } r.cc.UpdateState(resolver.State{Addresses: addrList}) @@ -148,27 +148,27 @@ func (r *Resolver) watch(prefix string, addrList []resolver.Address) { if !exists(addrList, string(ev.Kv.Value)) { flag = 1 addrList = append(addrList, resolver.Address{Addr: string(ev.Kv.Value)}) - fmt.Println("after add, new list: ", addrList) + //log.Debug("", "after add, new list: ", addrList) } case mvccpb.DELETE: - fmt.Println("remove addr key: ", string(ev.Kv.Key), "value:", string(ev.Kv.Value)) + //log.Debug("remove addr key: ", string(ev.Kv.Key), "value:", string(ev.Kv.Value)) i := strings.LastIndexAny(string(ev.Kv.Key), "/") if i < 0 { return } t := string(ev.Kv.Key)[i+1:] - fmt.Println("remove addr key: ", string(ev.Kv.Key), "value:", string(ev.Kv.Value), "addr:", t) + //log.Debug("remove addr key: ", string(ev.Kv.Key), "value:", string(ev.Kv.Value), "addr:", t) if s, ok := remove(addrList, t); ok { flag = 1 addrList = s - fmt.Println("after remove, new list: ", addrList) + //log.Debug("after remove, new list: ", addrList) } } } if flag == 1 { r.cc.UpdateState(resolver.State{Addresses: addrList}) - fmt.Println("update: ", addrList) + //log.Debug("update: ", addrList) } } } @@ -176,7 +176,7 @@ func (r *Resolver) watch(prefix string, addrList []resolver.Address) { func GetConn4Unique(schema, etcdaddr, servicename string) []*grpc.ClientConn { gEtcdCli, err := clientv3.New(clientv3.Config{Endpoints: strings.Split(etcdaddr, ",")}) if err != nil { - fmt.Println("eeeeeeeeeeeee", err.Error()) + //log.Error("clientv3.New failed", err.Error()) return nil } @@ -200,7 +200,7 @@ func GetConn4Unique(schema, etcdaddr, servicename string) []*grpc.ClientConn { } } else { gEtcdCli.Close() - fmt.Println("rrrrrrrrrrr", err.Error()) + //log.Error("gEtcdCli.Get failed", err.Error()) return nil } gEtcdCli.Close() @@ -236,7 +236,7 @@ func GetConnPool(schema, etcdaddr, servicename string) (*ClientConn, error) { ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(1000*time.Millisecond)) c, err := p.Get(ctx) - fmt.Println(err) + //log.Info("", "Get ", err) return c, err } diff --git a/pkg/proto/admin_cms/admin_cms.pb.go b/pkg/proto/admin_cms/admin_cms.pb.go new file mode 100644 index 000000000..890f409a9 --- /dev/null +++ b/pkg/proto/admin_cms/admin_cms.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.15.5 +// source: admin_cms/admin_cms.proto + +package admin_cms + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AdminLoginReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + AdminID string `protobuf:"bytes,2,opt,name=AdminID,proto3" json:"AdminID,omitempty"` + Secret string `protobuf:"bytes,3,opt,name=Secret,proto3" json:"Secret,omitempty"` +} + +func (x *AdminLoginReq) Reset() { + *x = AdminLoginReq{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_cms_admin_cms_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdminLoginReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminLoginReq) ProtoMessage() {} + +func (x *AdminLoginReq) ProtoReflect() protoreflect.Message { + mi := &file_admin_cms_admin_cms_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdminLoginReq.ProtoReflect.Descriptor instead. +func (*AdminLoginReq) Descriptor() ([]byte, []int) { + return file_admin_cms_admin_cms_proto_rawDescGZIP(), []int{0} +} + +func (x *AdminLoginReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *AdminLoginReq) GetAdminID() string { + if x != nil { + return x.AdminID + } + return "" +} + +func (x *AdminLoginReq) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type AdminLoginResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *AdminLoginResp) Reset() { + *x = AdminLoginResp{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_cms_admin_cms_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdminLoginResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminLoginResp) ProtoMessage() {} + +func (x *AdminLoginResp) ProtoReflect() protoreflect.Message { + mi := &file_admin_cms_admin_cms_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdminLoginResp.ProtoReflect.Descriptor instead. +func (*AdminLoginResp) Descriptor() ([]byte, []int) { + return file_admin_cms_admin_cms_proto_rawDescGZIP(), []int{1} +} + +func (x *AdminLoginResp) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +var File_admin_cms_admin_cms_proto protoreflect.FileDescriptor + +var file_admin_cms_admin_cms_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x22, 0x63, 0x0a, 0x0d, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x64, 0x6d, + 0x69, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x26, 0x0a, 0x0e, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x32, 0x4d, 0x0a, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x43, 0x4d, 0x53, 0x12, + 0x41, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, + 0x63, 0x6d, 0x73, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x42, 0x17, 0x5a, 0x15, 0x2e, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, + 0x73, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_admin_cms_admin_cms_proto_rawDescOnce sync.Once + file_admin_cms_admin_cms_proto_rawDescData = file_admin_cms_admin_cms_proto_rawDesc +) + +func file_admin_cms_admin_cms_proto_rawDescGZIP() []byte { + file_admin_cms_admin_cms_proto_rawDescOnce.Do(func() { + file_admin_cms_admin_cms_proto_rawDescData = protoimpl.X.CompressGZIP(file_admin_cms_admin_cms_proto_rawDescData) + }) + return file_admin_cms_admin_cms_proto_rawDescData +} + +var file_admin_cms_admin_cms_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_admin_cms_admin_cms_proto_goTypes = []interface{}{ + (*AdminLoginReq)(nil), // 0: admin_cms.AdminLoginReq + (*AdminLoginResp)(nil), // 1: admin_cms.AdminLoginResp +} +var file_admin_cms_admin_cms_proto_depIdxs = []int32{ + 0, // 0: admin_cms.adminCMS.AdminLogin:input_type -> admin_cms.AdminLoginReq + 1, // 1: admin_cms.adminCMS.AdminLogin:output_type -> admin_cms.AdminLoginResp + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_cms_admin_cms_proto_init() } +func file_admin_cms_admin_cms_proto_init() { + if File_admin_cms_admin_cms_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_admin_cms_admin_cms_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdminLoginReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_cms_admin_cms_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdminLoginResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_cms_admin_cms_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_cms_admin_cms_proto_goTypes, + DependencyIndexes: file_admin_cms_admin_cms_proto_depIdxs, + MessageInfos: file_admin_cms_admin_cms_proto_msgTypes, + }.Build() + File_admin_cms_admin_cms_proto = out.File + file_admin_cms_admin_cms_proto_rawDesc = nil + file_admin_cms_admin_cms_proto_goTypes = nil + file_admin_cms_admin_cms_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AdminCMSClient is the client API for AdminCMS service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AdminCMSClient interface { + AdminLogin(ctx context.Context, in *AdminLoginReq, opts ...grpc.CallOption) (*AdminLoginResp, error) +} + +type adminCMSClient struct { + cc grpc.ClientConnInterface +} + +func NewAdminCMSClient(cc grpc.ClientConnInterface) AdminCMSClient { + return &adminCMSClient{cc} +} + +func (c *adminCMSClient) AdminLogin(ctx context.Context, in *AdminLoginReq, opts ...grpc.CallOption) (*AdminLoginResp, error) { + out := new(AdminLoginResp) + err := c.cc.Invoke(ctx, "/admin_cms.adminCMS/AdminLogin", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AdminCMSServer is the server API for AdminCMS service. +type AdminCMSServer interface { + AdminLogin(context.Context, *AdminLoginReq) (*AdminLoginResp, error) +} + +// UnimplementedAdminCMSServer can be embedded to have forward compatible implementations. +type UnimplementedAdminCMSServer struct { +} + +func (*UnimplementedAdminCMSServer) AdminLogin(context.Context, *AdminLoginReq) (*AdminLoginResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AdminLogin not implemented") +} + +func RegisterAdminCMSServer(s *grpc.Server, srv AdminCMSServer) { + s.RegisterService(&_AdminCMS_serviceDesc, srv) +} + +func _AdminCMS_AdminLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminLoginReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminCMSServer).AdminLogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/admin_cms.adminCMS/AdminLogin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminCMSServer).AdminLogin(ctx, req.(*AdminLoginReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _AdminCMS_serviceDesc = grpc.ServiceDesc{ + ServiceName: "admin_cms.adminCMS", + HandlerType: (*AdminCMSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AdminLogin", + Handler: _AdminCMS_AdminLogin_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin_cms/admin_cms.proto", +} diff --git a/pkg/proto/admin_cms/admin_cms.proto b/pkg/proto/admin_cms/admin_cms.proto new file mode 100644 index 000000000..6759268ed --- /dev/null +++ b/pkg/proto/admin_cms/admin_cms.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +option go_package = "./admin_cms;admin_cms"; +package admin_cms; + +message AdminLoginReq { + string OperationID = 1; + string AdminID = 2; + string Secret = 3; +} + + +message AdminLoginResp { + string token = 1; +} + +service adminCMS { + rpc AdminLogin(AdminLoginReq) returns(AdminLoginResp); +} \ No newline at end of file diff --git a/pkg/proto/auth/auth.pb.go b/pkg/proto/auth/auth.pb.go index 71ab5fe7a..3941570ee 100644 --- a/pkg/proto/auth/auth.pb.go +++ b/pkg/proto/auth/auth.pb.go @@ -6,6 +6,7 @@ package pbAuth // import "./auth" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" import ( context "golang.org/x/net/context" @@ -23,25 +24,65 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package -type UserRegisterReq struct { - UID string `protobuf:"bytes,1,opt,name=UID" json:"UID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=Name" json:"Name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=Icon" json:"Icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=Gender" json:"Gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=Mobile" json:"Mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=Birth" json:"Birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=Email" json:"Email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=Ex" json:"Ex,omitempty"` +type CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} +func (*CommonResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_88965eda3ab7f34d, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type UserRegisterReq struct { + UserInfo *sdk_ws.UserInfo `protobuf:"bytes,1,opt,name=UserInfo" json:"UserInfo,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *UserRegisterReq) Reset() { *m = UserRegisterReq{} } func (m *UserRegisterReq) String() string { return proto.CompactTextString(m) } func (*UserRegisterReq) ProtoMessage() {} func (*UserRegisterReq) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_d2199f7b1388fd2f, []int{0} + return fileDescriptor_auth_88965eda3ab7f34d, []int{1} } func (m *UserRegisterReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterReq.Unmarshal(m, b) @@ -61,74 +102,32 @@ func (m *UserRegisterReq) XXX_DiscardUnknown() { var xxx_messageInfo_UserRegisterReq proto.InternalMessageInfo -func (m *UserRegisterReq) GetUID() string { +func (m *UserRegisterReq) GetUserInfo() *sdk_ws.UserInfo { if m != nil { - return m.UID + return m.UserInfo } - return "" + return nil } -func (m *UserRegisterReq) GetName() string { +func (m *UserRegisterReq) GetOperationID() string { if m != nil { - return m.Name - } - return "" -} - -func (m *UserRegisterReq) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *UserRegisterReq) GetGender() int32 { - if m != nil { - return m.Gender - } - return 0 -} - -func (m *UserRegisterReq) GetMobile() string { - if m != nil { - return m.Mobile - } - return "" -} - -func (m *UserRegisterReq) GetBirth() string { - if m != nil { - return m.Birth - } - return "" -} - -func (m *UserRegisterReq) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -func (m *UserRegisterReq) GetEx() string { - if m != nil { - return m.Ex + return m.OperationID } return "" } type UserRegisterResp struct { - Success bool `protobuf:"varint,1,opt,name=Success" json:"Success,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *UserRegisterResp) Reset() { *m = UserRegisterResp{} } func (m *UserRegisterResp) String() string { return proto.CompactTextString(m) } func (*UserRegisterResp) ProtoMessage() {} func (*UserRegisterResp) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_d2199f7b1388fd2f, []int{1} + return fileDescriptor_auth_88965eda3ab7f34d, []int{2} } func (m *UserRegisterResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterResp.Unmarshal(m, b) @@ -148,16 +147,18 @@ func (m *UserRegisterResp) XXX_DiscardUnknown() { var xxx_messageInfo_UserRegisterResp proto.InternalMessageInfo -func (m *UserRegisterResp) GetSuccess() bool { +func (m *UserRegisterResp) GetCommonResp() *CommonResp { if m != nil { - return m.Success + return m.CommonResp } - return false + return nil } type UserTokenReq struct { Platform int32 `protobuf:"varint,1,opt,name=Platform" json:"Platform,omitempty"` - UID string `protobuf:"bytes,2,opt,name=UID" json:"UID,omitempty"` + FromUserID string `protobuf:"bytes,2,opt,name=FromUserID" json:"FromUserID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -167,7 +168,7 @@ func (m *UserTokenReq) Reset() { *m = UserTokenReq{} } func (m *UserTokenReq) String() string { return proto.CompactTextString(m) } func (*UserTokenReq) ProtoMessage() {} func (*UserTokenReq) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_d2199f7b1388fd2f, []int{2} + return fileDescriptor_auth_88965eda3ab7f34d, []int{3} } func (m *UserTokenReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenReq.Unmarshal(m, b) @@ -194,28 +195,41 @@ func (m *UserTokenReq) GetPlatform() int32 { return 0 } -func (m *UserTokenReq) GetUID() string { +func (m *UserTokenReq) GetFromUserID() string { if m != nil { - return m.UID + return m.FromUserID + } + return "" +} + +func (m *UserTokenReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *UserTokenReq) GetOperationID() string { + if m != nil { + return m.OperationID } return "" } type UserTokenResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` - ExpiredTime int64 `protobuf:"varint,4,opt,name=ExpiredTime" json:"ExpiredTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` + ExpiredTime int64 `protobuf:"varint,3,opt,name=ExpiredTime" json:"ExpiredTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *UserTokenResp) Reset() { *m = UserTokenResp{} } func (m *UserTokenResp) String() string { return proto.CompactTextString(m) } func (*UserTokenResp) ProtoMessage() {} func (*UserTokenResp) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_d2199f7b1388fd2f, []int{3} + return fileDescriptor_auth_88965eda3ab7f34d, []int{4} } func (m *UserTokenResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenResp.Unmarshal(m, b) @@ -235,18 +249,11 @@ func (m *UserTokenResp) XXX_DiscardUnknown() { var xxx_messageInfo_UserTokenResp proto.InternalMessageInfo -func (m *UserTokenResp) GetErrCode() int32 { +func (m *UserTokenResp) GetCommonResp() *CommonResp { if m != nil { - return m.ErrCode + return m.CommonResp } - return 0 -} - -func (m *UserTokenResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" + return nil } func (m *UserTokenResp) GetToken() string { @@ -264,6 +271,7 @@ func (m *UserTokenResp) GetExpiredTime() int64 { } func init() { + proto.RegisterType((*CommonResp)(nil), "pbAuth.CommonResp") proto.RegisterType((*UserRegisterReq)(nil), "pbAuth.UserRegisterReq") proto.RegisterType((*UserRegisterResp)(nil), "pbAuth.UserRegisterResp") proto.RegisterType((*UserTokenReq)(nil), "pbAuth.UserTokenReq") @@ -375,30 +383,32 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ Metadata: "auth/auth.proto", } -func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_d2199f7b1388fd2f) } +func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_88965eda3ab7f34d) } -var fileDescriptor_auth_d2199f7b1388fd2f = []byte{ - // 348 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x4f, 0xf2, 0x40, - 0x10, 0x86, 0xd3, 0x42, 0x0b, 0xcc, 0xf7, 0x21, 0x64, 0x82, 0xba, 0xe1, 0x44, 0x7a, 0xe2, 0x60, - 0x6a, 0xa2, 0x17, 0x13, 0xbd, 0x80, 0x36, 0x86, 0x03, 0xc6, 0x54, 0xb8, 0x78, 0x2b, 0xb0, 0x42, - 0x23, 0x65, 0xeb, 0x6e, 0x49, 0xf0, 0xec, 0x8f, 0xf2, 0xef, 0x99, 0x9d, 0xdd, 0x12, 0x34, 0x5c, - 0xda, 0x79, 0x9f, 0x9d, 0xc9, 0xee, 0x3b, 0x33, 0xd0, 0x4a, 0xb6, 0xc5, 0xea, 0x52, 0x7f, 0xc2, - 0x5c, 0x8a, 0x42, 0xa0, 0x9f, 0xcf, 0x06, 0xdb, 0x62, 0x15, 0x7c, 0x3b, 0xd0, 0x9a, 0x2a, 0x2e, - 0x63, 0xbe, 0x4c, 0x55, 0xa1, 0xff, 0x1f, 0xd8, 0x86, 0xca, 0x74, 0xf4, 0xc0, 0x9c, 0x9e, 0xd3, - 0x6f, 0xc4, 0x3a, 0x44, 0x84, 0xea, 0x53, 0x92, 0x71, 0xe6, 0x12, 0xa2, 0x58, 0xb3, 0xd1, 0x5c, - 0x6c, 0x58, 0xc5, 0x30, 0x1d, 0xe3, 0x19, 0xf8, 0x8f, 0x7c, 0xb3, 0xe0, 0x92, 0x55, 0x7b, 0x4e, - 0xdf, 0x8b, 0xad, 0xd2, 0x7c, 0x2c, 0x66, 0xe9, 0x9a, 0x33, 0x8f, 0xb2, 0xad, 0xc2, 0x0e, 0x78, - 0xc3, 0x54, 0x16, 0x2b, 0xe6, 0x13, 0x36, 0x42, 0xd3, 0x28, 0x4b, 0xd2, 0x35, 0xab, 0x19, 0x4a, - 0x02, 0x4f, 0xc0, 0x8d, 0x76, 0xac, 0x4e, 0xc8, 0x8d, 0x76, 0xc1, 0x05, 0xb4, 0x7f, 0x3f, 0x5c, - 0xe5, 0xc8, 0xa0, 0xf6, 0xb2, 0x9d, 0xcf, 0xb9, 0x52, 0xf4, 0xfa, 0x7a, 0x5c, 0xca, 0xe0, 0x0e, - 0xfe, 0xeb, 0xec, 0x89, 0x78, 0xe7, 0x1b, 0xed, 0xb1, 0x0b, 0xf5, 0xe7, 0x75, 0x52, 0xbc, 0x09, - 0x99, 0x51, 0xaa, 0x17, 0xef, 0x75, 0xe9, 0xdf, 0xdd, 0xfb, 0x0f, 0x3e, 0xa1, 0x79, 0x50, 0x6d, - 0x2e, 0x8a, 0xa4, 0xbc, 0x17, 0x0b, 0x6e, 0xab, 0x4b, 0xa9, 0xad, 0x46, 0x52, 0x8e, 0xd5, 0xd2, - 0xd6, 0x5b, 0xa5, 0x4d, 0x51, 0xb9, 0xed, 0x97, 0x11, 0xd8, 0x83, 0x7f, 0xd1, 0x2e, 0x4f, 0x25, - 0x5f, 0x4c, 0xd2, 0x8c, 0x53, 0xd7, 0x2a, 0xf1, 0x21, 0xba, 0xfa, 0x72, 0xa0, 0xaa, 0x27, 0x85, - 0x03, 0xe3, 0xa0, 0xf4, 0x8b, 0xe7, 0xa1, 0x19, 0x61, 0xf8, 0x67, 0x7c, 0x5d, 0x76, 0xfc, 0x40, - 0xe5, 0x78, 0x03, 0x8d, 0xbd, 0x0d, 0xec, 0x1c, 0xa6, 0x95, 0x7d, 0xe9, 0x9e, 0x1e, 0xa1, 0x2a, - 0x1f, 0xb6, 0x5e, 0x9b, 0x21, 0xad, 0xcf, 0xad, 0x39, 0x9e, 0xf9, 0xb4, 0x46, 0xd7, 0x3f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x15, 0x5d, 0xc8, 0xb6, 0x59, 0x02, 0x00, 0x00, +var fileDescriptor_auth_88965eda3ab7f34d = []byte{ + // 369 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x4d, 0x4b, 0xc3, 0x40, + 0x10, 0x25, 0xf6, 0xc3, 0x76, 0x6a, 0xa9, 0x2c, 0x55, 0x43, 0x04, 0xa9, 0x39, 0xf5, 0x94, 0x40, + 0x3d, 0x28, 0x08, 0x42, 0xad, 0x16, 0x7a, 0x28, 0x95, 0xa5, 0x5e, 0xbc, 0x84, 0x94, 0x6e, 0xdb, + 0x90, 0x26, 0xbb, 0xee, 0xa6, 0x56, 0xf0, 0xe8, 0xc5, 0x9f, 0x2d, 0xbb, 0xf9, 0x70, 0xad, 0x3d, + 0x79, 0x49, 0x98, 0x79, 0x2f, 0xf3, 0xde, 0x9b, 0x0c, 0xb4, 0xfc, 0x4d, 0xb2, 0x72, 0xe5, 0xc3, + 0x61, 0x9c, 0x26, 0x14, 0x55, 0xd9, 0xac, 0xbf, 0x49, 0x56, 0xd6, 0xe5, 0x84, 0x91, 0xd8, 0x1b, + 0x8d, 0x5d, 0x16, 0x2e, 0x5d, 0x05, 0xb9, 0x62, 0x1e, 0x7a, 0x5b, 0xe1, 0x6e, 0x45, 0x4a, 0xb5, + 0xef, 0x00, 0x06, 0x34, 0x8a, 0x68, 0x8c, 0x89, 0x60, 0xc8, 0x84, 0x43, 0xc2, 0xf9, 0x80, 0xce, + 0x89, 0x69, 0x74, 0x8c, 0x6e, 0x05, 0xe7, 0x25, 0x3a, 0x85, 0x2a, 0xe1, 0x7c, 0x2c, 0x96, 0xe6, + 0x41, 0xc7, 0xe8, 0xd6, 0x71, 0x56, 0xd9, 0x6b, 0x68, 0x3d, 0x0b, 0xc2, 0x31, 0x59, 0x06, 0x22, + 0x91, 0xef, 0x57, 0x74, 0x0d, 0x35, 0xd9, 0x1a, 0xc5, 0x0b, 0xaa, 0xa6, 0x34, 0x7a, 0xe7, 0x8e, + 0x20, 0xfc, 0x8d, 0x70, 0xcf, 0x67, 0x81, 0xc7, 0x7c, 0xee, 0x47, 0xc2, 0xc9, 0x29, 0xb8, 0x20, + 0xa3, 0x0e, 0x34, 0x26, 0x8c, 0x70, 0x3f, 0x09, 0x68, 0x3c, 0x7a, 0xc8, 0x84, 0xf4, 0x96, 0x3d, + 0x84, 0xe3, 0xdf, 0x6a, 0x82, 0xa1, 0x9e, 0x9e, 0x20, 0x13, 0x44, 0x4e, 0xba, 0x01, 0xe7, 0x07, + 0xc1, 0x1a, 0xcb, 0xfe, 0x32, 0xe0, 0x48, 0x0e, 0x9a, 0xd2, 0x90, 0xc4, 0xd2, 0xb3, 0x05, 0xb5, + 0xa7, 0xb5, 0x9f, 0x2c, 0x28, 0x8f, 0xb2, 0xe4, 0x45, 0x8d, 0x2e, 0x00, 0x86, 0x9c, 0x46, 0xca, + 0x66, 0xee, 0x4a, 0xeb, 0xc8, 0x6f, 0x27, 0x2c, 0x43, 0x4b, 0x0a, 0x2d, 0xea, 0xdd, 0x48, 0xe5, + 0xbf, 0x91, 0x3e, 0xa0, 0xa9, 0x39, 0xf9, 0x5f, 0x1e, 0xd4, 0x86, 0x8a, 0x1a, 0x90, 0xb9, 0x4b, + 0x0b, 0x29, 0xfe, 0xf8, 0xce, 0x02, 0x4e, 0xe6, 0xd3, 0x20, 0x22, 0xca, 0x5b, 0x09, 0xeb, 0xad, + 0xde, 0xa7, 0x01, 0x65, 0x39, 0x17, 0xf5, 0xd3, 0x7d, 0xe4, 0x8b, 0x45, 0x67, 0xb9, 0xe0, 0xce, + 0xcf, 0xb5, 0xcc, 0xfd, 0x80, 0x60, 0xe8, 0x06, 0xea, 0x45, 0x10, 0xd4, 0xd6, 0x69, 0xf9, 0x96, + 0xad, 0x93, 0x3d, 0x5d, 0xc1, 0xee, 0x5b, 0x2f, 0x4d, 0x47, 0x9d, 0xef, 0x6d, 0x0a, 0xcf, 0xaa, + 0xea, 0x36, 0xaf, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x20, 0x74, 0x9f, 0xd9, 0x02, 0x00, + 0x00, } diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index 21b82ff40..c91921fe9 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -1,33 +1,34 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; package pbAuth; option go_package = "./auth;pbAuth"; -message UserRegisterReq { - string UID = 1; - string Name = 2; - string Icon = 3; - int32 Gender = 4; - string Mobile = 5; - string Birth = 6; - string Email = 7; - string Ex = 8; +message CommonResp{ + int32 errCode = 1; + string errMsg = 2; } -message UserRegisterResp { - bool Success = 1; +message UserRegisterReq { + server_api_params.UserInfo UserInfo = 1; + string OperationID = 2; } +message UserRegisterResp { + CommonResp CommonResp = 1; +} + message UserTokenReq { int32 Platform = 1; - string UID = 2; + string FromUserID = 2; + string OpUserID = 3; + string OperationID = 4; +} +message UserTokenResp { + CommonResp CommonResp = 1; + string Token = 2; + int64 ExpiredTime = 3; } -message UserTokenResp { - int32 ErrCode = 1; - string ErrMsg = 2; - string Token = 3; - int64 ExpiredTime = 4; -} service Auth { rpc UserRegister(UserRegisterReq) returns(UserRegisterResp); diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh index 309186817..25408d46e 100644 --- a/pkg/proto/auto_proto.sh +++ b/pkg/proto/auto_proto.sh @@ -4,7 +4,7 @@ source ./proto_dir.cfg for ((i = 0; i < ${#all_proto[*]}; i++)); do proto=${all_proto[$i]} - protoc --go_out=plugins=grpc:. $proto + protoc -I ../../../ -I ./ --go_out=plugins=grpc:. $proto s=`echo $proto | sed 's/ //g'` v=${s//proto/pb.go} protoc-go-inject-tag -input=./$v diff --git a/pkg/proto/base/base.proto b/pkg/proto/base/base.proto new file mode 100644 index 000000000..6d5144f0b --- /dev/null +++ b/pkg/proto/base/base.proto @@ -0,0 +1,5 @@ +syntax = "proto3"; +package base; + + + diff --git a/pkg/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go index b48d2cee1..834c9b307 100644 --- a/pkg/proto/chat/chat.pb.go +++ b/pkg/proto/chat/chat.pb.go @@ -6,6 +6,7 @@ package pbChat // import "./chat" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" import ( context "golang.org/x/net/context" @@ -23,524 +24,180 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package -type WSToMsgSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - SendTime int64 `protobuf:"varint,4,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,6,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,8,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,11,opt,name=MsgID" json:"MsgID,omitempty"` - Token string `protobuf:"bytes,12,opt,name=Token" json:"Token,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` - ForceList []string `protobuf:"bytes,16,rep,name=ForceList" json:"ForceList,omitempty"` - ClientMsgID string `protobuf:"bytes,17,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type MsgDataToMQ struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *WSToMsgSvrChatMsg) Reset() { *m = WSToMsgSvrChatMsg{} } -func (m *WSToMsgSvrChatMsg) String() string { return proto.CompactTextString(m) } -func (*WSToMsgSvrChatMsg) ProtoMessage() {} -func (*WSToMsgSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{0} +func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} } +func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) } +func (*MsgDataToMQ) ProtoMessage() {} +func (*MsgDataToMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_a5e95d84ecbd21a3, []int{0} } -func (m *WSToMsgSvrChatMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_WSToMsgSvrChatMsg.Unmarshal(m, b) +func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) } -func (m *WSToMsgSvrChatMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_WSToMsgSvrChatMsg.Marshal(b, m, deterministic) +func (m *MsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToMQ.Marshal(b, m, deterministic) } -func (dst *WSToMsgSvrChatMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_WSToMsgSvrChatMsg.Merge(dst, src) +func (dst *MsgDataToMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToMQ.Merge(dst, src) } -func (m *WSToMsgSvrChatMsg) XXX_Size() int { - return xxx_messageInfo_WSToMsgSvrChatMsg.Size(m) +func (m *MsgDataToMQ) XXX_Size() int { + return xxx_messageInfo_MsgDataToMQ.Size(m) } -func (m *WSToMsgSvrChatMsg) XXX_DiscardUnknown() { - xxx_messageInfo_WSToMsgSvrChatMsg.DiscardUnknown(m) +func (m *MsgDataToMQ) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToMQ.DiscardUnknown(m) } -var xxx_messageInfo_WSToMsgSvrChatMsg proto.InternalMessageInfo +var xxx_messageInfo_MsgDataToMQ proto.InternalMessageInfo -func (m *WSToMsgSvrChatMsg) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -func (m *WSToMsgSvrChatMsg) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *WSToMsgSvrChatMsg) GetSenderNickName() string { - if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *WSToMsgSvrChatMsg) GetSessionType() int32 { - if m != nil { - return m.SessionType - } - return 0 -} - -func (m *WSToMsgSvrChatMsg) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetMsgID() string { - if m != nil { - return m.MsgID - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetToken() string { +func (m *MsgDataToMQ) GetToken() string { if m != nil { return m.Token } return "" } -func (m *WSToMsgSvrChatMsg) GetOfflineInfo() string { +func (m *MsgDataToMQ) GetOperationID() string { if m != nil { - return m.OfflineInfo + return m.OperationID } return "" } -func (m *WSToMsgSvrChatMsg) GetOptions() string { +func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData { if m != nil { - return m.Options - } - return "" -} - -func (m *WSToMsgSvrChatMsg) GetPlatformID() int32 { - if m != nil { - return m.PlatformID - } - return 0 -} - -func (m *WSToMsgSvrChatMsg) GetForceList() []string { - if m != nil { - return m.ForceList + return m.MsgData } return nil } -func (m *WSToMsgSvrChatMsg) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - -type MsgSvrToPushSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,7,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,8,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,12,opt,name=MsgID" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MsgSvrToPushSvrChatMsg) Reset() { *m = MsgSvrToPushSvrChatMsg{} } -func (m *MsgSvrToPushSvrChatMsg) String() string { return proto.CompactTextString(m) } -func (*MsgSvrToPushSvrChatMsg) ProtoMessage() {} -func (*MsgSvrToPushSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{1} -} -func (m *MsgSvrToPushSvrChatMsg) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Unmarshal(m, b) -} -func (m *MsgSvrToPushSvrChatMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Marshal(b, m, deterministic) -} -func (dst *MsgSvrToPushSvrChatMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSvrToPushSvrChatMsg.Merge(dst, src) -} -func (m *MsgSvrToPushSvrChatMsg) XXX_Size() int { - return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Size(m) -} -func (m *MsgSvrToPushSvrChatMsg) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSvrToPushSvrChatMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSvrToPushSvrChatMsg proto.InternalMessageInfo - -func (m *MsgSvrToPushSvrChatMsg) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetRecvSeq() int64 { - if m != nil { - return m.RecvSeq - } - return 0 -} - -func (m *MsgSvrToPushSvrChatMsg) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -func (m *MsgSvrToPushSvrChatMsg) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *MsgSvrToPushSvrChatMsg) GetSenderNickName() string { - if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *MsgSvrToPushSvrChatMsg) GetSessionType() int32 { - if m != nil { - return m.SessionType - } - return 0 -} - -func (m *MsgSvrToPushSvrChatMsg) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetMsgID() string { - if m != nil { - return m.MsgID - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetOfflineInfo() string { - if m != nil { - return m.OfflineInfo - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetOptions() string { - if m != nil { - return m.Options - } - return "" -} - -func (m *MsgSvrToPushSvrChatMsg) GetPlatformID() int32 { - if m != nil { - return m.PlatformID - } - return 0 -} - -func (m *MsgSvrToPushSvrChatMsg) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - -type PullMessageReq struct { - UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` - SeqBegin int64 `protobuf:"varint,2,opt,name=SeqBegin" json:"SeqBegin,omitempty"` - SeqEnd int64 `protobuf:"varint,3,opt,name=SeqEnd" json:"SeqEnd,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PullMessageReq) Reset() { *m = PullMessageReq{} } -func (m *PullMessageReq) String() string { return proto.CompactTextString(m) } -func (*PullMessageReq) ProtoMessage() {} -func (*PullMessageReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{2} -} -func (m *PullMessageReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PullMessageReq.Unmarshal(m, b) -} -func (m *PullMessageReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PullMessageReq.Marshal(b, m, deterministic) -} -func (dst *PullMessageReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullMessageReq.Merge(dst, src) -} -func (m *PullMessageReq) XXX_Size() int { - return xxx_messageInfo_PullMessageReq.Size(m) -} -func (m *PullMessageReq) XXX_DiscardUnknown() { - xxx_messageInfo_PullMessageReq.DiscardUnknown(m) -} - -var xxx_messageInfo_PullMessageReq proto.InternalMessageInfo - -func (m *PullMessageReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *PullMessageReq) GetSeqBegin() int64 { - if m != nil { - return m.SeqBegin - } - return 0 -} - -func (m *PullMessageReq) GetSeqEnd() int64 { - if m != nil { - return m.SeqEnd - } - return 0 -} - -func (m *PullMessageReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type PullMessageResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - MaxSeq int64 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` - MinSeq int64 `protobuf:"varint,4,opt,name=MinSeq" json:"MinSeq,omitempty"` - SingleUserMsg []*GatherFormat `protobuf:"bytes,5,rep,name=SingleUserMsg" json:"SingleUserMsg,omitempty"` - GroupUserMsg []*GatherFormat `protobuf:"bytes,6,rep,name=GroupUserMsg" json:"GroupUserMsg,omitempty"` +type MsgDataToDB struct { + MsgData *sdk_ws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *PullMessageResp) Reset() { *m = PullMessageResp{} } -func (m *PullMessageResp) String() string { return proto.CompactTextString(m) } -func (*PullMessageResp) ProtoMessage() {} -func (*PullMessageResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{3} +func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} } +func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) } +func (*MsgDataToDB) ProtoMessage() {} +func (*MsgDataToDB) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_a5e95d84ecbd21a3, []int{1} } -func (m *PullMessageResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PullMessageResp.Unmarshal(m, b) +func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) } -func (m *PullMessageResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PullMessageResp.Marshal(b, m, deterministic) +func (m *MsgDataToDB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToDB.Marshal(b, m, deterministic) } -func (dst *PullMessageResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullMessageResp.Merge(dst, src) +func (dst *MsgDataToDB) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToDB.Merge(dst, src) } -func (m *PullMessageResp) XXX_Size() int { - return xxx_messageInfo_PullMessageResp.Size(m) +func (m *MsgDataToDB) XXX_Size() int { + return xxx_messageInfo_MsgDataToDB.Size(m) } -func (m *PullMessageResp) XXX_DiscardUnknown() { - xxx_messageInfo_PullMessageResp.DiscardUnknown(m) +func (m *MsgDataToDB) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToDB.DiscardUnknown(m) } -var xxx_messageInfo_PullMessageResp proto.InternalMessageInfo +var xxx_messageInfo_MsgDataToDB proto.InternalMessageInfo -func (m *PullMessageResp) GetErrCode() int32 { +func (m *MsgDataToDB) GetMsgData() *sdk_ws.MsgData { if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *PullMessageResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -func (m *PullMessageResp) GetMaxSeq() int64 { - if m != nil { - return m.MaxSeq - } - return 0 -} - -func (m *PullMessageResp) GetMinSeq() int64 { - if m != nil { - return m.MinSeq - } - return 0 -} - -func (m *PullMessageResp) GetSingleUserMsg() []*GatherFormat { - if m != nil { - return m.SingleUserMsg + return m.MsgData } return nil } -func (m *PullMessageResp) GetGroupUserMsg() []*GatherFormat { - if m != nil { - return m.GroupUserMsg - } - return nil -} - -type PullMessageBySeqListReq struct { - UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - SeqList []int64 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq{} } -func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } -func (*PullMessageBySeqListReq) ProtoMessage() {} -func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{4} -} -func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) -} -func (m *PullMessageBySeqListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PullMessageBySeqListReq.Marshal(b, m, deterministic) -} -func (dst *PullMessageBySeqListReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullMessageBySeqListReq.Merge(dst, src) -} -func (m *PullMessageBySeqListReq) XXX_Size() int { - return xxx_messageInfo_PullMessageBySeqListReq.Size(m) -} -func (m *PullMessageBySeqListReq) XXX_DiscardUnknown() { - xxx_messageInfo_PullMessageBySeqListReq.DiscardUnknown(m) -} - -var xxx_messageInfo_PullMessageBySeqListReq proto.InternalMessageInfo - -func (m *PullMessageBySeqListReq) GetUserID() string { - if m != nil { - return m.UserID - } - return "" -} - -func (m *PullMessageBySeqListReq) GetOperationID() string { +func (m *MsgDataToDB) GetOperationID() string { if m != nil { return m.OperationID } return "" } -func (m *PullMessageBySeqListReq) GetSeqList() []int64 { +type PushMsgDataToMQ struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} } +func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) } +func (*PushMsgDataToMQ) ProtoMessage() {} +func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_a5e95d84ecbd21a3, []int{2} +} +func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) +} +func (m *PushMsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PushMsgDataToMQ.Marshal(b, m, deterministic) +} +func (dst *PushMsgDataToMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushMsgDataToMQ.Merge(dst, src) +} +func (m *PushMsgDataToMQ) XXX_Size() int { + return xxx_messageInfo_PushMsgDataToMQ.Size(m) +} +func (m *PushMsgDataToMQ) XXX_DiscardUnknown() { + xxx_messageInfo_PushMsgDataToMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_PushMsgDataToMQ proto.InternalMessageInfo + +func (m *PushMsgDataToMQ) GetOperationID() string { if m != nil { - return m.SeqList + return m.OperationID + } + return "" +} + +func (m *PushMsgDataToMQ) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData } return nil } +func (m *PushMsgDataToMQ) GetPushToUserID() string { + if m != nil { + return m.PushToUserID + } + return "" +} + +// message PullMessageReq { +// string UserID = 1; +// int64 SeqBegin = 2; +// int64 SeqEnd = 3; +// string OperationID = 4; +// } +// +// message PullMessageResp { +// int32 ErrCode = 1; +// string ErrMsg = 2; +// int64 MaxSeq = 3; +// int64 MinSeq = 4; +// repeated GatherFormat SingleUserMsg = 5; +// repeated GatherFormat GroupUserMsg = 6; +// } +// message PullMessageBySeqListReq{ +// string UserID = 1; +// string OperationID = 2; +// repeated int64 seqList =3; +// } type GetMaxAndMinSeqReq struct { UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` @@ -553,7 +210,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{5} + return fileDescriptor_chat_a5e95d84ecbd21a3, []int{3} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -590,8 +247,8 @@ func (m *GetMaxAndMinSeqReq) GetOperationID() string { type GetMaxAndMinSeqResp struct { ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - MaxSeq int64 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` - MinSeq int64 `protobuf:"varint,4,opt,name=MinSeq" json:"MinSeq,omitempty"` + MaxSeq uint32 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` + MinSeq uint32 `protobuf:"varint,4,opt,name=MinSeq" json:"MinSeq,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -601,7 +258,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{6} + return fileDescriptor_chat_a5e95d84ecbd21a3, []int{4} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -635,452 +292,138 @@ func (m *GetMaxAndMinSeqResp) GetErrMsg() string { return "" } -func (m *GetMaxAndMinSeqResp) GetMaxSeq() int64 { +func (m *GetMaxAndMinSeqResp) GetMaxSeq() uint32 { if m != nil { return m.MaxSeq } return 0 } -func (m *GetMaxAndMinSeqResp) GetMinSeq() int64 { +func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { if m != nil { return m.MinSeq } return 0 } -type GatherFormat struct { - // @inject_tag: json:"id" - ID string `protobuf:"bytes,1,opt,name=ID" json:"id"` - // @inject_tag: json:"list" - List []*MsgFormat `protobuf:"bytes,2,rep,name=List" json:"list"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type SendMsgReq struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *GatherFormat) Reset() { *m = GatherFormat{} } -func (m *GatherFormat) String() string { return proto.CompactTextString(m) } -func (*GatherFormat) ProtoMessage() {} -func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{7} +func (m *SendMsgReq) Reset() { *m = SendMsgReq{} } +func (m *SendMsgReq) String() string { return proto.CompactTextString(m) } +func (*SendMsgReq) ProtoMessage() {} +func (*SendMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_a5e95d84ecbd21a3, []int{5} } -func (m *GatherFormat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GatherFormat.Unmarshal(m, b) +func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) } -func (m *GatherFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GatherFormat.Marshal(b, m, deterministic) +func (m *SendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsgReq.Marshal(b, m, deterministic) } -func (dst *GatherFormat) XXX_Merge(src proto.Message) { - xxx_messageInfo_GatherFormat.Merge(dst, src) +func (dst *SendMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsgReq.Merge(dst, src) } -func (m *GatherFormat) XXX_Size() int { - return xxx_messageInfo_GatherFormat.Size(m) +func (m *SendMsgReq) XXX_Size() int { + return xxx_messageInfo_SendMsgReq.Size(m) } -func (m *GatherFormat) XXX_DiscardUnknown() { - xxx_messageInfo_GatherFormat.DiscardUnknown(m) +func (m *SendMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsgReq.DiscardUnknown(m) } -var xxx_messageInfo_GatherFormat proto.InternalMessageInfo +var xxx_messageInfo_SendMsgReq proto.InternalMessageInfo -func (m *GatherFormat) GetID() string { - if m != nil { - return m.ID - } - return "" -} - -func (m *GatherFormat) GetList() []*MsgFormat { - if m != nil { - return m.List - } - return nil -} - -type MsgFormat struct { - // @inject_tag: json:"sendID" - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"sendID"` - // @inject_tag: json:"recvID" - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"recvID"` - // @inject_tag: json:"msgFrom" - MsgFrom int32 `protobuf:"varint,3,opt,name=MsgFrom" json:"msgFrom"` - // @inject_tag: json:"contentType" - ContentType int32 `protobuf:"varint,4,opt,name=ContentType" json:"contentType"` - // @inject_tag: json:"serverMsgID" - ServerMsgID string `protobuf:"bytes,5,opt,name=ServerMsgID" json:"serverMsgID"` - // @inject_tag: json:"content" - Content string `protobuf:"bytes,6,opt,name=Content" json:"content"` - // @inject_tag: json:"seq" - Seq int64 `protobuf:"varint,7,opt,name=Seq" json:"seq"` - // @inject_tag: json:"sendTime" - SendTime int64 `protobuf:"varint,8,opt,name=SendTime" json:"sendTime"` - // @inject_tag: json:"senderPlatformID" - SenderPlatformID int32 `protobuf:"varint,9,opt,name=SenderPlatformID" json:"senderPlatformID"` - // @inject_tag: json:"senderNickName" - SenderNickName string `protobuf:"bytes,10,opt,name=SenderNickName" json:"senderNickName"` - // @inject_tag: json:"senderFaceUrl" - SenderFaceURL string `protobuf:"bytes,11,opt,name=SenderFaceURL" json:"senderFaceUrl"` - // @inject_tag: json:"clientMsgID" - ClientMsgID string `protobuf:"bytes,12,opt,name=ClientMsgID" json:"clientMsgID"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MsgFormat) Reset() { *m = MsgFormat{} } -func (m *MsgFormat) String() string { return proto.CompactTextString(m) } -func (*MsgFormat) ProtoMessage() {} -func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{8} -} -func (m *MsgFormat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgFormat.Unmarshal(m, b) -} -func (m *MsgFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgFormat.Marshal(b, m, deterministic) -} -func (dst *MsgFormat) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgFormat.Merge(dst, src) -} -func (m *MsgFormat) XXX_Size() int { - return xxx_messageInfo_MsgFormat.Size(m) -} -func (m *MsgFormat) XXX_DiscardUnknown() { - xxx_messageInfo_MsgFormat.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgFormat proto.InternalMessageInfo - -func (m *MsgFormat) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *MsgFormat) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *MsgFormat) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *MsgFormat) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *MsgFormat) GetServerMsgID() string { - if m != nil { - return m.ServerMsgID - } - return "" -} - -func (m *MsgFormat) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *MsgFormat) GetSeq() int64 { - if m != nil { - return m.Seq - } - return 0 -} - -func (m *MsgFormat) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -func (m *MsgFormat) GetSenderPlatformID() int32 { - if m != nil { - return m.SenderPlatformID - } - return 0 -} - -func (m *MsgFormat) GetSenderNickName() string { - if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *MsgFormat) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *MsgFormat) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - -type UserSendMsgReq struct { - ReqIdentifier int32 `protobuf:"varint,1,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` - SendID string `protobuf:"bytes,3,opt,name=SendID" json:"SendID,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` - SenderNickName string `protobuf:"bytes,5,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,6,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - PlatformID int32 `protobuf:"varint,7,opt,name=PlatformID" json:"PlatformID,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` - MsgFrom int32 `protobuf:"varint,9,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,10,opt,name=ContentType" json:"ContentType,omitempty"` - RecvID string `protobuf:"bytes,11,opt,name=RecvID" json:"RecvID,omitempty"` - ForceList []string `protobuf:"bytes,12,rep,name=ForceList" json:"ForceList,omitempty"` - Content string `protobuf:"bytes,13,opt,name=Content" json:"Content,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` - ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo" json:"OffLineInfo,omitempty"` - Ex string `protobuf:"bytes,17,opt,name=Ex" json:"Ex,omitempty"` - SendTime int64 `protobuf:"varint,18,opt,name=sendTime" json:"sendTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } -func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } -func (*UserSendMsgReq) ProtoMessage() {} -func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{9} -} -func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) -} -func (m *UserSendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserSendMsgReq.Marshal(b, m, deterministic) -} -func (dst *UserSendMsgReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserSendMsgReq.Merge(dst, src) -} -func (m *UserSendMsgReq) XXX_Size() int { - return xxx_messageInfo_UserSendMsgReq.Size(m) -} -func (m *UserSendMsgReq) XXX_DiscardUnknown() { - xxx_messageInfo_UserSendMsgReq.DiscardUnknown(m) -} - -var xxx_messageInfo_UserSendMsgReq proto.InternalMessageInfo - -func (m *UserSendMsgReq) GetReqIdentifier() int32 { - if m != nil { - return m.ReqIdentifier - } - return 0 -} - -func (m *UserSendMsgReq) GetToken() string { +func (m *SendMsgReq) GetToken() string { if m != nil { return m.Token } return "" } -func (m *UserSendMsgReq) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *UserSendMsgReq) GetOperationID() string { +func (m *SendMsgReq) GetOperationID() string { if m != nil { return m.OperationID } return "" } -func (m *UserSendMsgReq) GetSenderNickName() string { +func (m *SendMsgReq) GetMsgData() *sdk_ws.MsgData { if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *UserSendMsgReq) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *UserSendMsgReq) GetPlatformID() int32 { - if m != nil { - return m.PlatformID - } - return 0 -} - -func (m *UserSendMsgReq) GetSessionType() int32 { - if m != nil { - return m.SessionType - } - return 0 -} - -func (m *UserSendMsgReq) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *UserSendMsgReq) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *UserSendMsgReq) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *UserSendMsgReq) GetForceList() []string { - if m != nil { - return m.ForceList + return m.MsgData } return nil } -func (m *UserSendMsgReq) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *UserSendMsgReq) GetOptions() string { - if m != nil { - return m.Options - } - return "" -} - -func (m *UserSendMsgReq) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - -func (m *UserSendMsgReq) GetOffLineInfo() string { - if m != nil { - return m.OffLineInfo - } - return "" -} - -func (m *UserSendMsgReq) GetEx() string { - if m != nil { - return m.Ex - } - return "" -} - -func (m *UserSendMsgReq) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -type UserSendMsgResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - ReqIdentifier int32 `protobuf:"varint,3,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` - ServerMsgID string `protobuf:"bytes,4,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` - ClientMsgID string `protobuf:"bytes,5,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` +type SendMsgResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + ServerMsgID string `protobuf:"bytes,4,opt,name=serverMsgID" json:"serverMsgID,omitempty"` + ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"` SendTime int64 `protobuf:"varint,6,opt,name=sendTime" json:"sendTime,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } -func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } -func (*UserSendMsgResp) ProtoMessage() {} -func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{10} +func (m *SendMsgResp) Reset() { *m = SendMsgResp{} } +func (m *SendMsgResp) String() string { return proto.CompactTextString(m) } +func (*SendMsgResp) ProtoMessage() {} +func (*SendMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_a5e95d84ecbd21a3, []int{6} } -func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) +func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) } -func (m *UserSendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserSendMsgResp.Marshal(b, m, deterministic) +func (m *SendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsgResp.Marshal(b, m, deterministic) } -func (dst *UserSendMsgResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserSendMsgResp.Merge(dst, src) +func (dst *SendMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsgResp.Merge(dst, src) } -func (m *UserSendMsgResp) XXX_Size() int { - return xxx_messageInfo_UserSendMsgResp.Size(m) +func (m *SendMsgResp) XXX_Size() int { + return xxx_messageInfo_SendMsgResp.Size(m) } -func (m *UserSendMsgResp) XXX_DiscardUnknown() { - xxx_messageInfo_UserSendMsgResp.DiscardUnknown(m) +func (m *SendMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsgResp.DiscardUnknown(m) } -var xxx_messageInfo_UserSendMsgResp proto.InternalMessageInfo +var xxx_messageInfo_SendMsgResp proto.InternalMessageInfo -func (m *UserSendMsgResp) GetErrCode() int32 { +func (m *SendMsgResp) GetErrCode() int32 { if m != nil { return m.ErrCode } return 0 } -func (m *UserSendMsgResp) GetErrMsg() string { +func (m *SendMsgResp) GetErrMsg() string { if m != nil { return m.ErrMsg } return "" } -func (m *UserSendMsgResp) GetReqIdentifier() int32 { - if m != nil { - return m.ReqIdentifier - } - return 0 -} - -func (m *UserSendMsgResp) GetServerMsgID() string { +func (m *SendMsgResp) GetServerMsgID() string { if m != nil { return m.ServerMsgID } return "" } -func (m *UserSendMsgResp) GetClientMsgID() string { +func (m *SendMsgResp) GetClientMsgID() string { if m != nil { return m.ClientMsgID } return "" } -func (m *UserSendMsgResp) GetSendTime() int64 { +func (m *SendMsgResp) GetSendTime() int64 { if m != nil { return m.SendTime } @@ -1088,17 +431,13 @@ func (m *UserSendMsgResp) GetSendTime() int64 { } func init() { - proto.RegisterType((*WSToMsgSvrChatMsg)(nil), "pbChat.WSToMsgSvrChatMsg") - proto.RegisterType((*MsgSvrToPushSvrChatMsg)(nil), "pbChat.MsgSvrToPushSvrChatMsg") - proto.RegisterType((*PullMessageReq)(nil), "pbChat.PullMessageReq") - proto.RegisterType((*PullMessageResp)(nil), "pbChat.PullMessageResp") - proto.RegisterType((*PullMessageBySeqListReq)(nil), "pbChat.PullMessageBySeqListReq") + proto.RegisterType((*MsgDataToMQ)(nil), "pbChat.MsgDataToMQ") + proto.RegisterType((*MsgDataToDB)(nil), "pbChat.MsgDataToDB") + proto.RegisterType((*PushMsgDataToMQ)(nil), "pbChat.PushMsgDataToMQ") proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "pbChat.GetMaxAndMinSeqReq") proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "pbChat.GetMaxAndMinSeqResp") - proto.RegisterType((*GatherFormat)(nil), "pbChat.GatherFormat") - proto.RegisterType((*MsgFormat)(nil), "pbChat.MsgFormat") - proto.RegisterType((*UserSendMsgReq)(nil), "pbChat.UserSendMsgReq") - proto.RegisterType((*UserSendMsgResp)(nil), "pbChat.UserSendMsgResp") + proto.RegisterType((*SendMsgReq)(nil), "pbChat.SendMsgReq") + proto.RegisterType((*SendMsgResp)(nil), "pbChat.SendMsgResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -1113,9 +452,8 @@ const _ = grpc.SupportPackageIsVersion4 type ChatClient interface { GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) - PullMessage(ctx context.Context, in *PullMessageReq, opts ...grpc.CallOption) (*PullMessageResp, error) - PullMessageBySeqList(ctx context.Context, in *PullMessageBySeqListReq, opts ...grpc.CallOption) (*PullMessageResp, error) - UserSendMsg(ctx context.Context, in *UserSendMsgReq, opts ...grpc.CallOption) (*UserSendMsgResp, error) + PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) + SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) } type chatClient struct { @@ -1135,17 +473,8 @@ func (c *chatClient) GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq return out, nil } -func (c *chatClient) PullMessage(ctx context.Context, in *PullMessageReq, opts ...grpc.CallOption) (*PullMessageResp, error) { - out := new(PullMessageResp) - err := grpc.Invoke(ctx, "/pbChat.Chat/PullMessage", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *chatClient) PullMessageBySeqList(ctx context.Context, in *PullMessageBySeqListReq, opts ...grpc.CallOption) (*PullMessageResp, error) { - out := new(PullMessageResp) +func (c *chatClient) PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) { + out := new(sdk_ws.PullMessageBySeqListResp) err := grpc.Invoke(ctx, "/pbChat.Chat/PullMessageBySeqList", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1153,9 +482,9 @@ func (c *chatClient) PullMessageBySeqList(ctx context.Context, in *PullMessageBy return out, nil } -func (c *chatClient) UserSendMsg(ctx context.Context, in *UserSendMsgReq, opts ...grpc.CallOption) (*UserSendMsgResp, error) { - out := new(UserSendMsgResp) - err := grpc.Invoke(ctx, "/pbChat.Chat/UserSendMsg", in, out, c.cc, opts...) +func (c *chatClient) SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) { + out := new(SendMsgResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/SendMsg", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1166,9 +495,8 @@ func (c *chatClient) UserSendMsg(ctx context.Context, in *UserSendMsgReq, opts . type ChatServer interface { GetMaxAndMinSeq(context.Context, *GetMaxAndMinSeqReq) (*GetMaxAndMinSeqResp, error) - PullMessage(context.Context, *PullMessageReq) (*PullMessageResp, error) - PullMessageBySeqList(context.Context, *PullMessageBySeqListReq) (*PullMessageResp, error) - UserSendMsg(context.Context, *UserSendMsgReq) (*UserSendMsgResp, error) + PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error) + SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error) } func RegisterChatServer(s *grpc.Server, srv ChatServer) { @@ -1193,26 +521,8 @@ func _Chat_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Chat_PullMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PullMessageReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChatServer).PullMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pbChat.Chat/PullMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).PullMessage(ctx, req.(*PullMessageReq)) - } - return interceptor(ctx, in, info, handler) -} - func _Chat_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PullMessageBySeqListReq) + in := new(sdk_ws.PullMessageBySeqListReq) if err := dec(in); err != nil { return nil, err } @@ -1224,25 +534,25 @@ func _Chat_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, de FullMethod: "/pbChat.Chat/PullMessageBySeqList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).PullMessageBySeqList(ctx, req.(*PullMessageBySeqListReq)) + return srv.(ChatServer).PullMessageBySeqList(ctx, req.(*sdk_ws.PullMessageBySeqListReq)) } return interceptor(ctx, in, info, handler) } -func _Chat_UserSendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserSendMsgReq) +func _Chat_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendMsgReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ChatServer).UserSendMsg(ctx, in) + return srv.(ChatServer).SendMsg(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pbChat.Chat/UserSendMsg", + FullMethod: "/pbChat.Chat/SendMsg", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).UserSendMsg(ctx, req.(*UserSendMsgReq)) + return srv.(ChatServer).SendMsg(ctx, req.(*SendMsgReq)) } return interceptor(ctx, in, info, handler) } @@ -1255,87 +565,52 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ MethodName: "GetMaxAndMinSeq", Handler: _Chat_GetMaxAndMinSeq_Handler, }, - { - MethodName: "PullMessage", - Handler: _Chat_PullMessage_Handler, - }, { MethodName: "PullMessageBySeqList", Handler: _Chat_PullMessageBySeqList_Handler, }, { - MethodName: "UserSendMsg", - Handler: _Chat_UserSendMsg_Handler, + MethodName: "SendMsg", + Handler: _Chat_SendMsg_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "chat/chat.proto", } -func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_feb94a5514034c46) } +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_a5e95d84ecbd21a3) } -var fileDescriptor_chat_feb94a5514034c46 = []byte{ - // 981 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xdd, 0x6a, 0xe3, 0x46, - 0x14, 0xc6, 0x92, 0x2d, 0xdb, 0xc7, 0xbf, 0x99, 0x86, 0xec, 0x90, 0x96, 0xd6, 0x88, 0x6d, 0x31, - 0xbd, 0x48, 0x61, 0x7b, 0x53, 0x5a, 0x58, 0x68, 0x62, 0x27, 0xa8, 0x44, 0xd9, 0x20, 0x7b, 0x29, - 0xf4, 0x4e, 0x6b, 0x8f, 0x15, 0xb1, 0xb6, 0x24, 0xcf, 0x28, 0x69, 0xf6, 0xa6, 0xaf, 0xd0, 0x97, - 0xe8, 0x65, 0x5f, 0xa4, 0x8f, 0xd2, 0x57, 0x28, 0x14, 0xca, 0xcc, 0x48, 0xd6, 0xe8, 0xc7, 0x49, - 0xd8, 0xb2, 0x7b, 0x13, 0x38, 0x9f, 0xce, 0xfc, 0x9c, 0xf3, 0x7d, 0xf3, 0x1d, 0x07, 0x06, 0x8b, - 0x1b, 0x37, 0xfe, 0x86, 0xff, 0x39, 0x89, 0x68, 0x18, 0x87, 0xc8, 0x88, 0xde, 0x9c, 0xdd, 0xb8, - 0xb1, 0xf9, 0x7b, 0x1d, 0x0e, 0x7e, 0x9e, 0xcd, 0x43, 0x9b, 0x79, 0xb3, 0x3b, 0xca, 0x21, 0x9b, - 0x79, 0xe8, 0x08, 0x8c, 0x19, 0x09, 0x96, 0xd6, 0x04, 0xd7, 0x46, 0xb5, 0x71, 0xdb, 0x49, 0x22, - 0x8e, 0x3b, 0x64, 0x71, 0x67, 0x4d, 0xb0, 0x26, 0x71, 0x19, 0x21, 0x0c, 0xcd, 0xb3, 0x30, 0x88, - 0x49, 0x10, 0x63, 0x5d, 0x7c, 0x48, 0x43, 0x74, 0x0c, 0x2d, 0xbe, 0x76, 0xee, 0x6f, 0x08, 0xae, - 0x8f, 0x6a, 0x63, 0xdd, 0xd9, 0xc5, 0x7c, 0x95, 0xcd, 0xbc, 0x73, 0x1a, 0x6e, 0x70, 0x63, 0x54, - 0x1b, 0x37, 0x9c, 0x34, 0x44, 0x5f, 0x41, 0x9f, 0x67, 0x11, 0x7a, 0xe5, 0x2f, 0xde, 0x5e, 0xb9, - 0x1b, 0x82, 0x0d, 0xb1, 0x6d, 0x01, 0x45, 0xcf, 0xa1, 0x27, 0x91, 0x73, 0x77, 0x41, 0x5e, 0x3b, - 0x97, 0xb8, 0x29, 0xd2, 0xf2, 0x20, 0x1a, 0x41, 0x27, 0xb9, 0xce, 0xfc, 0x5d, 0x44, 0x70, 0x4b, - 0x9c, 0xa5, 0x42, 0x3c, 0x63, 0x46, 0x18, 0xf3, 0xc3, 0x40, 0x64, 0xb4, 0x65, 0x86, 0x02, 0xf1, - 0x8c, 0x57, 0x11, 0xa1, 0x6e, 0xec, 0x87, 0x81, 0x35, 0xc1, 0x20, 0xce, 0x51, 0x21, 0x74, 0x08, - 0x0d, 0x9b, 0x79, 0xd6, 0x04, 0x77, 0xc4, 0x37, 0x19, 0x70, 0x74, 0x1e, 0xbe, 0x25, 0x01, 0xee, - 0x4a, 0x54, 0x04, 0x62, 0xb7, 0xd5, 0x6a, 0xed, 0x07, 0xc4, 0x0a, 0x56, 0x21, 0xee, 0x25, 0xbb, - 0x65, 0x10, 0xef, 0xcd, 0xab, 0x88, 0xef, 0xcc, 0x70, 0x5f, 0x76, 0x34, 0x09, 0xd1, 0xe7, 0x00, - 0xd7, 0x6b, 0x37, 0x5e, 0x85, 0x74, 0x63, 0x4d, 0xf0, 0x40, 0x5c, 0x55, 0x41, 0xd0, 0x67, 0xd0, - 0x3e, 0x0f, 0xe9, 0x82, 0x5c, 0xfa, 0x2c, 0xc6, 0xc3, 0x91, 0x3e, 0x6e, 0x3b, 0x19, 0x20, 0x7a, - 0xb1, 0xf6, 0x49, 0x10, 0xcb, 0xbb, 0x1e, 0xc8, 0x93, 0x15, 0xc8, 0xfc, 0x47, 0x87, 0x23, 0xa9, - 0x86, 0x79, 0x78, 0x7d, 0xcb, 0x6e, 0x3e, 0x88, 0x2c, 0x30, 0x34, 0x79, 0xce, 0x8c, 0x6c, 0x13, - 0x55, 0xa4, 0x61, 0x4e, 0x30, 0x8d, 0xfd, 0x82, 0x31, 0x1e, 0x13, 0x4c, 0xf3, 0x69, 0x82, 0x69, - 0x3d, 0x41, 0x30, 0xed, 0x47, 0x05, 0x03, 0x8f, 0x0a, 0xa6, 0xf3, 0x80, 0x60, 0xba, 0xaa, 0x60, - 0x3e, 0xa4, 0x34, 0x0a, 0xe4, 0x0f, 0xcb, 0xe4, 0xff, 0x06, 0xfd, 0xeb, 0xdb, 0xf5, 0xda, 0x26, - 0x8c, 0xb9, 0x1e, 0x71, 0xc8, 0x96, 0x73, 0xfb, 0x9a, 0x11, 0x9a, 0x71, 0x2e, 0x23, 0xc9, 0xd3, - 0xf6, 0x94, 0x78, 0x7e, 0x20, 0x58, 0x17, 0x3c, 0xc9, 0x58, 0xea, 0x64, 0x3b, 0x0d, 0x96, 0x82, - 0x76, 0xdd, 0x49, 0xa2, 0x62, 0x4f, 0xea, 0xa5, 0x9e, 0x98, 0x7f, 0xd7, 0x60, 0x90, 0xbb, 0x00, - 0x8b, 0x78, 0xbd, 0x53, 0x4a, 0xcf, 0xc2, 0x25, 0x11, 0x57, 0x68, 0x38, 0x69, 0xc8, 0xcf, 0x99, - 0x52, 0x6a, 0x33, 0x2f, 0xd5, 0x9d, 0x8c, 0x38, 0x6e, 0xbb, 0xf7, 0x5c, 0x5c, 0xc9, 0xf9, 0x32, - 0x12, 0xb8, 0x1f, 0x64, 0xa2, 0x4b, 0x22, 0xf4, 0x3d, 0xf4, 0x66, 0x7e, 0xe0, 0xad, 0x09, 0xaf, - 0x8d, 0x6f, 0xd7, 0x18, 0xe9, 0xe3, 0xce, 0x8b, 0xc3, 0x13, 0x69, 0x92, 0x27, 0x17, 0x6e, 0x7c, - 0x43, 0xe8, 0x79, 0x48, 0x37, 0x6e, 0xec, 0xe4, 0x53, 0xd1, 0x77, 0xd0, 0xbd, 0xa0, 0xe1, 0x6d, - 0x94, 0x2e, 0x35, 0x1e, 0x58, 0x9a, 0xcb, 0x34, 0x37, 0xf0, 0x4c, 0x29, 0xf5, 0xf4, 0xdd, 0x8c, - 0x6c, 0xf9, 0x13, 0x7d, 0xa8, 0xe9, 0x85, 0x06, 0x6a, 0x65, 0x51, 0x61, 0x68, 0x32, 0xb9, 0x0f, - 0xd6, 0x47, 0x3a, 0x7f, 0x58, 0x49, 0x68, 0x5e, 0x01, 0xba, 0x20, 0xb1, 0xed, 0xde, 0xff, 0x18, - 0x2c, 0x65, 0xdd, 0xff, 0xeb, 0x24, 0xf3, 0x57, 0xf8, 0xa4, 0xb4, 0xdf, 0xc7, 0x60, 0xcb, 0x9c, - 0x42, 0x57, 0xed, 0x2a, 0xea, 0x83, 0xb6, 0xbb, 0xbe, 0x66, 0x4d, 0xd0, 0x97, 0x50, 0x17, 0xf5, - 0x6b, 0x82, 0x89, 0x83, 0x94, 0x09, 0x6e, 0x15, 0x92, 0x06, 0xf1, 0xd9, 0xfc, 0x57, 0x83, 0xf6, - 0x0e, 0x7b, 0x1f, 0x6b, 0x4b, 0xad, 0x48, 0xcf, 0x5b, 0x51, 0xc1, 0x3c, 0xea, 0x7b, 0xcc, 0x83, - 0xde, 0x09, 0x15, 0x58, 0x13, 0xe1, 0x72, 0x6d, 0x47, 0x85, 0x54, 0xe3, 0x34, 0xf2, 0xc6, 0x39, - 0x04, 0x9d, 0x77, 0xa4, 0x29, 0x3a, 0xa2, 0x17, 0x0d, 0xb3, 0x55, 0x30, 0xcc, 0xaf, 0x61, 0x28, - 0x9d, 0x4d, 0xb1, 0x05, 0xe9, 0x66, 0x25, 0xbc, 0xc2, 0x42, 0xe1, 0x69, 0x16, 0xda, 0xd9, 0x67, - 0xa1, 0x8a, 0xd5, 0x74, 0xcb, 0x56, 0xf3, 0x67, 0x1d, 0xfa, 0x5c, 0x6c, 0x7c, 0x9d, 0xcd, 0x3c, - 0x2e, 0xc6, 0xe7, 0xd0, 0x73, 0xc8, 0xd6, 0x5a, 0x92, 0x20, 0xf6, 0x57, 0x3e, 0xa1, 0x89, 0x82, - 0xf2, 0x60, 0x36, 0x52, 0x35, 0x75, 0xa4, 0x66, 0x04, 0xea, 0x39, 0x02, 0x1f, 0xf5, 0x9c, 0x8a, - 0xc2, 0x1b, 0x4f, 0x2b, 0xdc, 0xa8, 0x2a, 0x3c, 0xef, 0xc1, 0xcd, 0x2a, 0x0f, 0x56, 0x27, 0x47, - 0xab, 0x3c, 0x39, 0x14, 0x69, 0xb5, 0x1f, 0x94, 0x16, 0x94, 0xa5, 0x95, 0xc9, 0xb5, 0x93, 0x93, - 0x6b, 0xee, 0x47, 0x41, 0xb7, 0xf8, 0xa3, 0x40, 0x91, 0x5b, 0xaf, 0x34, 0xa7, 0xf7, 0xcc, 0x9a, - 0x02, 0xc1, 0x83, 0x12, 0xc1, 0xc9, 0x24, 0xbb, 0x4c, 0x27, 0xd9, 0x70, 0x37, 0xc9, 0x52, 0x88, - 0xbf, 0xdc, 0xe9, 0x7d, 0xf2, 0x1b, 0x44, 0x9b, 0xde, 0x73, 0x29, 0xb3, 0x54, 0xca, 0x48, 0x4a, - 0x39, 0x8d, 0xcd, 0xbf, 0x6a, 0x30, 0xc8, 0xc9, 0xe5, 0xbd, 0xbc, 0xa6, 0xa4, 0x30, 0xbd, 0x4a, - 0x61, 0x85, 0x07, 0x5a, 0x2f, 0x3f, 0xd0, 0x42, 0xf5, 0x8d, 0x72, 0xf5, 0x6a, 0x2d, 0x46, 0xbe, - 0x96, 0x17, 0x7f, 0x68, 0x50, 0xe7, 0x9e, 0x84, 0x7e, 0x82, 0x41, 0xc1, 0x43, 0xd1, 0xf1, 0x6e, - 0x72, 0x94, 0xcc, 0xfa, 0xf8, 0xd3, 0xbd, 0xdf, 0x58, 0x84, 0x5e, 0x42, 0x47, 0x19, 0x27, 0xe8, - 0x28, 0xcd, 0xcd, 0xcf, 0xf3, 0xe3, 0x67, 0x95, 0x38, 0x8b, 0xd0, 0x35, 0x1c, 0x56, 0x8d, 0x23, - 0xf4, 0x45, 0xc5, 0x02, 0x75, 0x58, 0xed, 0xdf, 0xf1, 0x25, 0x74, 0x14, 0xc6, 0xb2, 0x1b, 0xe5, - 0x5f, 0x7d, 0xb6, 0xbe, 0x40, 0xef, 0xe9, 0xe0, 0x97, 0xde, 0x89, 0xf8, 0x9f, 0xe5, 0x07, 0x99, - 0xf0, 0xc6, 0x10, 0xff, 0xbb, 0x7c, 0xfb, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x44, 0x4e, - 0x52, 0xce, 0x0c, 0x00, 0x00, +var fileDescriptor_chat_a5e95d84ecbd21a3 = []byte{ + // 489 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4f, 0x6f, 0xd3, 0x4e, + 0x10, 0x95, 0xd3, 0x26, 0xf9, 0x65, 0xf2, 0xab, 0x22, 0x6d, 0x2b, 0x64, 0x99, 0x8b, 0xf1, 0x29, + 0x02, 0xc9, 0x96, 0x02, 0x37, 0x4e, 0xa4, 0xae, 0x50, 0x10, 0x4b, 0x8b, 0x13, 0x2e, 0x5c, 0xa2, + 0x6d, 0x3d, 0x72, 0xac, 0x24, 0xf6, 0x66, 0xc7, 0x21, 0x05, 0x3e, 0x03, 0x9f, 0x81, 0x8f, 0xc9, + 0x15, 0x79, 0xd7, 0x69, 0x9d, 0xa6, 0x88, 0x9c, 0xb8, 0x58, 0x7a, 0x6f, 0xc6, 0x6f, 0xde, 0xdb, + 0x7f, 0xd0, 0xbb, 0x99, 0x89, 0x22, 0x28, 0x3f, 0xbe, 0x54, 0x79, 0x91, 0xb3, 0x96, 0xbc, 0x3e, + 0x9f, 0x89, 0xc2, 0x79, 0x76, 0x29, 0x31, 0x9b, 0x8e, 0x78, 0x20, 0xe7, 0x49, 0xa0, 0x4b, 0x01, + 0xc5, 0xf3, 0xe9, 0x86, 0x82, 0x0d, 0x99, 0x56, 0xef, 0x3b, 0x74, 0x39, 0x25, 0xa1, 0x28, 0xc4, + 0x24, 0xe7, 0x1f, 0xd9, 0x19, 0x34, 0x8b, 0x7c, 0x8e, 0x99, 0x6d, 0xb9, 0x56, 0xbf, 0x13, 0x19, + 0xc0, 0x5c, 0xe8, 0xe6, 0x12, 0x95, 0x28, 0xd2, 0x3c, 0x1b, 0x85, 0x76, 0x43, 0xd7, 0xea, 0x14, + 0x7b, 0x05, 0xed, 0xa5, 0x91, 0xb1, 0x8f, 0x5c, 0xab, 0xdf, 0x1d, 0x38, 0x3e, 0xa1, 0xfa, 0x82, + 0x6a, 0x2a, 0x64, 0x3a, 0x95, 0x42, 0x89, 0x25, 0xf9, 0xd5, 0xa0, 0x68, 0xdb, 0xea, 0x61, 0x6d, + 0x78, 0x38, 0xac, 0x8b, 0x58, 0x07, 0x8b, 0xfc, 0xdd, 0x9c, 0xf7, 0xc3, 0x82, 0xde, 0xd5, 0x9a, + 0x66, 0xf5, 0xa0, 0x2e, 0x74, 0x2f, 0x6b, 0x7f, 0x99, 0xb8, 0x75, 0xaa, 0xee, 0xa6, 0x71, 0xb8, + 0x1b, 0x0f, 0xfe, 0x97, 0x6b, 0x9a, 0x4d, 0xf2, 0x4f, 0x84, 0x6a, 0x14, 0xea, 0xd5, 0xe8, 0x44, + 0x3b, 0x9c, 0xf7, 0x01, 0xd8, 0x5b, 0x2c, 0xb8, 0xb8, 0x7d, 0x93, 0xc5, 0x3c, 0xcd, 0xc6, 0xb8, + 0x8a, 0x70, 0xc5, 0x9e, 0x40, 0xab, 0xfa, 0xc7, 0x98, 0xa9, 0xd0, 0x43, 0xa7, 0x8d, 0x3d, 0xa7, + 0xde, 0x06, 0x4e, 0xf7, 0xf4, 0x48, 0x32, 0x1b, 0xda, 0x17, 0x4a, 0x9d, 0xe7, 0x31, 0x6a, 0xc5, + 0x66, 0xb4, 0x85, 0xe5, 0xa8, 0x0b, 0xa5, 0x38, 0x25, 0x95, 0x5a, 0x85, 0x4a, 0x9e, 0x8b, 0xdb, + 0x31, 0xae, 0xb4, 0xed, 0x93, 0xa8, 0x42, 0x9a, 0xd7, 0xba, 0xf6, 0x71, 0xc5, 0x6b, 0xe4, 0x7d, + 0x03, 0x18, 0x63, 0x16, 0x73, 0x4a, 0xca, 0x00, 0xff, 0xf6, 0xec, 0xfc, 0xb4, 0xa0, 0x7b, 0x37, + 0xdc, 0xa4, 0xc5, 0xdd, 0xb4, 0x78, 0x9f, 0x16, 0x77, 0xd2, 0x1a, 0x54, 0x3a, 0x33, 0x73, 0x38, + 0x25, 0xa3, 0x50, 0x47, 0xeb, 0x44, 0x75, 0xaa, 0xec, 0xb8, 0x59, 0xa4, 0x98, 0x15, 0xa6, 0xa3, + 0x69, 0x3a, 0x6a, 0x14, 0x73, 0xe0, 0x3f, 0xc2, 0x2c, 0x9e, 0xa4, 0x4b, 0xb4, 0x5b, 0xae, 0xd5, + 0x3f, 0x8a, 0xee, 0xf0, 0xe0, 0x97, 0x05, 0xc7, 0xe5, 0x35, 0x64, 0xef, 0xa0, 0xf7, 0x60, 0x7f, + 0x98, 0xe3, 0x9b, 0x2b, 0xea, 0xef, 0x1f, 0x04, 0xe7, 0xe9, 0x1f, 0x6b, 0x24, 0x59, 0x0e, 0x67, + 0x57, 0xeb, 0xc5, 0x82, 0x23, 0x91, 0x48, 0x70, 0xf8, 0x75, 0x8c, 0xab, 0xf7, 0x29, 0x15, 0xec, + 0xf9, 0x23, 0x6b, 0xf6, 0x58, 0x63, 0x39, 0xe0, 0xc5, 0xc1, 0xbd, 0x24, 0xd9, 0x00, 0xda, 0xd5, + 0x32, 0x33, 0xb6, 0x35, 0x76, 0xbf, 0xe9, 0xce, 0xe9, 0x1e, 0x47, 0x72, 0xd8, 0xfb, 0x7c, 0xe2, + 0xeb, 0xf7, 0xe8, 0xb5, 0x29, 0x5e, 0xb7, 0xf4, 0x63, 0xf3, 0xf2, 0x77, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xe8, 0xa6, 0x3e, 0x67, 0xaa, 0x04, 0x00, 0x00, } diff --git a/pkg/proto/chat/chat.proto b/pkg/proto/chat/chat.proto index 3c66c99dc..4625d8174 100644 --- a/pkg/proto/chat/chat.proto +++ b/pkg/proto/chat/chat.proto @@ -1,68 +1,46 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; package pbChat;//The package name to which the proto file belongs option go_package = "./chat;pbChat";//The generated go pb file is in the current directory, and the package name is pbChat -message WSToMsgSvrChatMsg{ - string SendID = 1; - string RecvID = 2; - string Content = 3; - int64 SendTime = 4; - int32 MsgFrom = 5; - string SenderNickName = 6; - string SenderFaceURL = 7; - int32 ContentType = 8; - int32 SessionType = 9; - string OperationID = 10; - string MsgID = 11; - string Token = 12; - string OfflineInfo =13; - string Options = 14; - int32 PlatformID =15; - repeated string ForceList = 16; - string ClientMsgID = 17; +message MsgDataToMQ{ + string token =1; + string operationID = 2; + server_api_params.MsgData msgData = 3; } -message MsgSvrToPushSvrChatMsg { - string SendID = 1; - string RecvID = 2; - string Content = 3; - int64 RecvSeq = 4; - int64 SendTime = 5; - int32 MsgFrom = 6; - string SenderNickName = 7; - string SenderFaceURL = 8; - int32 ContentType = 9; - int32 SessionType = 10; - string OperationID = 11; - string MsgID = 12; - string OfflineInfo = 13; - string Options =14; - int32 PlatformID =15; - string ClientMsgID = 16; +message MsgDataToDB { + server_api_params.MsgData msgData = 1; + string operationID = 2; } - -message PullMessageReq { - string UserID = 1; - int64 SeqBegin = 2; - int64 SeqEnd = 3; - string OperationID = 4; +message PushMsgDataToMQ{ + string OperationID = 1; + server_api_params.MsgData msgData = 2; + string pushToUserID = 3; } -message PullMessageResp { - int32 ErrCode = 1; - string ErrMsg = 2; - int64 MaxSeq = 3; - int64 MinSeq = 4; - repeated GatherFormat SingleUserMsg = 5; - repeated GatherFormat GroupUserMsg = 6; -} -message PullMessageBySeqListReq{ - string UserID = 1; - string OperationID = 2; - repeated int64 seqList =3; -} +//message PullMessageReq { +// string UserID = 1; +// int64 SeqBegin = 2; +// int64 SeqEnd = 3; +// string OperationID = 4; +//} +// +//message PullMessageResp { +// int32 ErrCode = 1; +// string ErrMsg = 2; +// int64 MaxSeq = 3; +// int64 MinSeq = 4; +// repeated GatherFormat SingleUserMsg = 5; +// repeated GatherFormat GroupUserMsg = 6; +//} +//message PullMessageBySeqListReq{ +// string UserID = 1; +// string OperationID = 2; +// repeated int64 seqList =3; +//} message GetMaxAndMinSeqReq { string UserID = 1; string OperationID = 2; @@ -70,78 +48,29 @@ message GetMaxAndMinSeqReq { message GetMaxAndMinSeqResp { int32 ErrCode = 1; string ErrMsg = 2; - int64 MaxSeq = 3; - int64 MinSeq = 4; -} -message GatherFormat{ - // @inject_tag: json:"id" - string ID = 1; - // @inject_tag: json:"list" - repeated MsgFormat List = 2;//detail msg -} -message MsgFormat{ - // @inject_tag: json:"sendID" - string SendID = 1; - // @inject_tag: json:"recvID" - string RecvID = 2; - // @inject_tag: json:"msgFrom" - int32 MsgFrom = 3; - // @inject_tag: json:"contentType" - int32 ContentType = 4; - // @inject_tag: json:"serverMsgID" - string ServerMsgID = 5; - // @inject_tag: json:"content" - string Content = 6; - // @inject_tag: json:"seq" - int64 Seq = 7; - // @inject_tag: json:"sendTime" - int64 SendTime = 8; - // @inject_tag: json:"senderPlatformID" - int32 SenderPlatformID = 9; - // @inject_tag: json:"senderNickName" - string SenderNickName = 10; - // @inject_tag: json:"senderFaceUrl" - string SenderFaceURL = 11; - // @inject_tag: json:"clientMsgID" - string ClientMsgID = 12; + uint32 MaxSeq = 3; + uint32 MinSeq = 4; } -message UserSendMsgReq { +message SendMsgReq { - int32 ReqIdentifier = 1; - string Token = 2; - string SendID = 3; - string OperationID = 4; - string SenderNickName = 5; - string SenderFaceURL = 6; - int32 PlatformID = 7; - int32 SessionType = 8; - int32 MsgFrom = 9; - int32 ContentType = 10; - string RecvID = 11; - repeated string ForceList = 12; - string Content = 13; - string Options = 14; - string ClientMsgID = 15; - string OffLineInfo = 16; - string Ex = 17; - int64 sendTime = 18; +string token =1; +string operationID = 2; +server_api_params.MsgData msgData = 3; } -message UserSendMsgResp { - int32 ErrCode = 1; - string ErrMsg = 2; - int32 ReqIdentifier = 3; - string ServerMsgID = 4; - string ClientMsgID = 5; +message SendMsgResp { + int32 errCode = 1; + string errMsg = 2; + string serverMsgID = 4; + string clientMsgID = 5; int64 sendTime = 6; } service Chat { rpc GetMaxAndMinSeq(GetMaxAndMinSeqReq) returns(GetMaxAndMinSeqResp); - rpc PullMessage(PullMessageReq) returns(PullMessageResp); - rpc PullMessageBySeqList(PullMessageBySeqListReq) returns(PullMessageResp); - rpc UserSendMsg(UserSendMsgReq) returns(UserSendMsgResp); + rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); + rpc SendMsg(SendMsgReq) returns(SendMsgResp); } diff --git a/pkg/proto/friend/friend.pb.go b/pkg/proto/friend/friend.pb.go index a393857af..88e92e2f5 100644 --- a/pkg/proto/friend/friend.pb.go +++ b/pkg/proto/friend/friend.pb.go @@ -6,6 +6,7 @@ package friend // import "./friend" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" import ( context "golang.org/x/net/context" @@ -24,8 +25,8 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type CommonResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -35,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{0} + return fileDescriptor_friend_74b4824fb8c5de90, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -55,24 +56,84 @@ func (m *CommonResp) XXX_DiscardUnknown() { var xxx_messageInfo_CommonResp proto.InternalMessageInfo -func (m *CommonResp) GetErrorCode() int32 { +func (m *CommonResp) GetErrCode() int32 { if m != nil { - return m.ErrorCode + return m.ErrCode } return 0 } -func (m *CommonResp) GetErrorMsg() string { +func (m *CommonResp) GetErrMsg() string { if m != nil { - return m.ErrorMsg + return m.ErrMsg + } + return "" +} + +type CommID struct { + OpUserID string `protobuf:"bytes,1,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + ToUserID string `protobuf:"bytes,4,opt,name=ToUserID" json:"ToUserID,omitempty"` + FromUserID string `protobuf:"bytes,5,opt,name=FromUserID" json:"FromUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommID) Reset() { *m = CommID{} } +func (m *CommID) String() string { return proto.CompactTextString(m) } +func (*CommID) ProtoMessage() {} +func (*CommID) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{1} +} +func (m *CommID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommID.Unmarshal(m, b) +} +func (m *CommID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommID.Marshal(b, m, deterministic) +} +func (dst *CommID) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommID.Merge(dst, src) +} +func (m *CommID) XXX_Size() int { + return xxx_messageInfo_CommID.Size(m) +} +func (m *CommID) XXX_DiscardUnknown() { + xxx_messageInfo_CommID.DiscardUnknown(m) +} + +var xxx_messageInfo_CommID proto.InternalMessageInfo + +func (m *CommID) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *CommID) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CommID) GetToUserID() string { + if m != nil { + return m.ToUserID + } + return "" +} + +func (m *CommID) GetFromUserID() string { + if m != nil { + return m.FromUserID } return "" } type GetFriendsInfoReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -82,7 +143,7 @@ func (m *GetFriendsInfoReq) Reset() { *m = GetFriendsInfoReq{} } func (m *GetFriendsInfoReq) String() string { return proto.CompactTextString(m) } func (*GetFriendsInfoReq) ProtoMessage() {} func (*GetFriendsInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{1} + return fileDescriptor_friend_74b4824fb8c5de90, []int{2} } func (m *GetFriendsInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendsInfoReq.Unmarshal(m, b) @@ -102,41 +163,27 @@ func (m *GetFriendsInfoReq) XXX_DiscardUnknown() { var xxx_messageInfo_GetFriendsInfoReq proto.InternalMessageInfo -func (m *GetFriendsInfoReq) GetUid() string { +func (m *GetFriendsInfoReq) GetCommID() *CommID { if m != nil { - return m.Uid + return m.CommID } - return "" -} - -func (m *GetFriendsInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *GetFriendsInfoReq) GetToken() string { - if m != nil { - return m.Token - } - return "" + return nil } type GetFriendInfoResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Data *GetFriendData `protobuf:"bytes,3,opt,name=Data" json:"Data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendInfoList []*sdk_ws.FriendInfo `protobuf:"bytes,3,rep,name=FriendInfoList" json:"FriendInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetFriendInfoResp) Reset() { *m = GetFriendInfoResp{} } func (m *GetFriendInfoResp) String() string { return proto.CompactTextString(m) } func (*GetFriendInfoResp) ProtoMessage() {} func (*GetFriendInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{2} + return fileDescriptor_friend_74b4824fb8c5de90, []int{3} } func (m *GetFriendInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendInfoResp.Unmarshal(m, b) @@ -156,150 +203,30 @@ func (m *GetFriendInfoResp) XXX_DiscardUnknown() { var xxx_messageInfo_GetFriendInfoResp proto.InternalMessageInfo -func (m *GetFriendInfoResp) GetErrorCode() int32 { +func (m *GetFriendInfoResp) GetErrCode() int32 { if m != nil { - return m.ErrorCode + return m.ErrCode } return 0 } -func (m *GetFriendInfoResp) GetErrorMsg() string { +func (m *GetFriendInfoResp) GetErrMsg() string { if m != nil { - return m.ErrorMsg + return m.ErrMsg } return "" } -func (m *GetFriendInfoResp) GetData() *GetFriendData { +func (m *GetFriendInfoResp) GetFriendInfoList() []*sdk_ws.FriendInfo { if m != nil { - return m.Data + return m.FriendInfoList } return nil } -type GetFriendData struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - Icon string `protobuf:"bytes,2,opt,name=icon" json:"icon,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` - Comment string `protobuf:"bytes,9,opt,name=comment" json:"comment,omitempty"` - IsFriend int32 `protobuf:"varint,10,opt,name=isFriend" json:"isFriend,omitempty"` - IsInBlackList int32 `protobuf:"varint,11,opt,name=isInBlackList" json:"isInBlackList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetFriendData) Reset() { *m = GetFriendData{} } -func (m *GetFriendData) String() string { return proto.CompactTextString(m) } -func (*GetFriendData) ProtoMessage() {} -func (*GetFriendData) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{3} -} -func (m *GetFriendData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetFriendData.Unmarshal(m, b) -} -func (m *GetFriendData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetFriendData.Marshal(b, m, deterministic) -} -func (dst *GetFriendData) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendData.Merge(dst, src) -} -func (m *GetFriendData) XXX_Size() int { - return xxx_messageInfo_GetFriendData.Size(m) -} -func (m *GetFriendData) XXX_DiscardUnknown() { - xxx_messageInfo_GetFriendData.DiscardUnknown(m) -} - -var xxx_messageInfo_GetFriendData proto.InternalMessageInfo - -func (m *GetFriendData) GetUid() string { - if m != nil { - return m.Uid - } - return "" -} - -func (m *GetFriendData) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *GetFriendData) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *GetFriendData) GetGender() int32 { - if m != nil { - return m.Gender - } - return 0 -} - -func (m *GetFriendData) GetMobile() string { - if m != nil { - return m.Mobile - } - return "" -} - -func (m *GetFriendData) GetBirth() string { - if m != nil { - return m.Birth - } - return "" -} - -func (m *GetFriendData) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -func (m *GetFriendData) GetEx() string { - if m != nil { - return m.Ex - } - return "" -} - -func (m *GetFriendData) GetComment() string { - if m != nil { - return m.Comment - } - return "" -} - -func (m *GetFriendData) GetIsFriend() int32 { - if m != nil { - return m.IsFriend - } - return 0 -} - -func (m *GetFriendData) GetIsInBlackList() int32 { - if m != nil { - return m.IsInBlackList - } - return 0 -} - type AddFriendReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` - ReqMessage string `protobuf:"bytes,4,opt,name=ReqMessage" json:"ReqMessage,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + ReqMsg string `protobuf:"bytes,2,opt,name=ReqMsg" json:"ReqMsg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -309,7 +236,7 @@ func (m *AddFriendReq) Reset() { *m = AddFriendReq{} } func (m *AddFriendReq) String() string { return proto.CompactTextString(m) } func (*AddFriendReq) ProtoMessage() {} func (*AddFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{4} + return fileDescriptor_friend_74b4824fb8c5de90, []int{4} } func (m *AddFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddFriendReq.Unmarshal(m, b) @@ -329,39 +256,63 @@ func (m *AddFriendReq) XXX_DiscardUnknown() { var xxx_messageInfo_AddFriendReq proto.InternalMessageInfo -func (m *AddFriendReq) GetUid() string { +func (m *AddFriendReq) GetCommID() *CommID { if m != nil { - return m.Uid + return m.CommID + } + return nil +} + +func (m *AddFriendReq) GetReqMsg() string { + if m != nil { + return m.ReqMsg } return "" } -func (m *AddFriendReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" +type AddFriendResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *AddFriendReq) GetToken() string { - if m != nil { - return m.Token - } - return "" +func (m *AddFriendResp) Reset() { *m = AddFriendResp{} } +func (m *AddFriendResp) String() string { return proto.CompactTextString(m) } +func (*AddFriendResp) ProtoMessage() {} +func (*AddFriendResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{5} +} +func (m *AddFriendResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddFriendResp.Unmarshal(m, b) +} +func (m *AddFriendResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddFriendResp.Marshal(b, m, deterministic) +} +func (dst *AddFriendResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendResp.Merge(dst, src) +} +func (m *AddFriendResp) XXX_Size() int { + return xxx_messageInfo_AddFriendResp.Size(m) +} +func (m *AddFriendResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddFriendResp.DiscardUnknown(m) } -func (m *AddFriendReq) GetReqMessage() string { +var xxx_messageInfo_AddFriendResp proto.InternalMessageInfo + +func (m *AddFriendResp) GetCommonResp() *CommonResp { if m != nil { - return m.ReqMessage + return m.CommonResp } - return "" + return nil } type ImportFriendReq struct { - UidList []string `protobuf:"bytes,1,rep,name=uidList" json:"uidList,omitempty"` + FriendUserIDList []string `protobuf:"bytes,1,rep,name=FriendUserIDList" json:"FriendUserIDList,omitempty"` OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` - OwnerUid string `protobuf:"bytes,4,opt,name=OwnerUid" json:"OwnerUid,omitempty"` + FromUserID string `protobuf:"bytes,3,opt,name=FromUserID" json:"FromUserID,omitempty"` + OpUserID string `protobuf:"bytes,4,opt,name=OpUserID" json:"OpUserID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -371,7 +322,7 @@ func (m *ImportFriendReq) Reset() { *m = ImportFriendReq{} } func (m *ImportFriendReq) String() string { return proto.CompactTextString(m) } func (*ImportFriendReq) ProtoMessage() {} func (*ImportFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{5} + return fileDescriptor_friend_74b4824fb8c5de90, []int{6} } func (m *ImportFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ImportFriendReq.Unmarshal(m, b) @@ -391,9 +342,9 @@ func (m *ImportFriendReq) XXX_DiscardUnknown() { var xxx_messageInfo_ImportFriendReq proto.InternalMessageInfo -func (m *ImportFriendReq) GetUidList() []string { +func (m *ImportFriendReq) GetFriendUserIDList() []string { if m != nil { - return m.UidList + return m.FriendUserIDList } return nil } @@ -405,33 +356,79 @@ func (m *ImportFriendReq) GetOperationID() string { return "" } -func (m *ImportFriendReq) GetToken() string { +func (m *ImportFriendReq) GetFromUserID() string { if m != nil { - return m.Token + return m.FromUserID } return "" } -func (m *ImportFriendReq) GetOwnerUid() string { +func (m *ImportFriendReq) GetOpUserID() string { if m != nil { - return m.OwnerUid + return m.OpUserID } return "" } +type UserIDResult struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + Result int32 `protobuf:"varint,2,opt,name=Result" json:"Result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserIDResult) Reset() { *m = UserIDResult{} } +func (m *UserIDResult) String() string { return proto.CompactTextString(m) } +func (*UserIDResult) ProtoMessage() {} +func (*UserIDResult) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{7} +} +func (m *UserIDResult) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserIDResult.Unmarshal(m, b) +} +func (m *UserIDResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserIDResult.Marshal(b, m, deterministic) +} +func (dst *UserIDResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserIDResult.Merge(dst, src) +} +func (m *UserIDResult) XXX_Size() int { + return xxx_messageInfo_UserIDResult.Size(m) +} +func (m *UserIDResult) XXX_DiscardUnknown() { + xxx_messageInfo_UserIDResult.DiscardUnknown(m) +} + +var xxx_messageInfo_UserIDResult proto.InternalMessageInfo + +func (m *UserIDResult) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *UserIDResult) GetResult() int32 { + if m != nil { + return m.Result + } + return 0 +} + type ImportFriendResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - FailedUidList []string `protobuf:"bytes,2,rep,name=failedUidList" json:"failedUidList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + UserIDResultList []*UserIDResult `protobuf:"bytes,2,rep,name=UserIDResultList" json:"UserIDResultList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ImportFriendResp) Reset() { *m = ImportFriendResp{} } func (m *ImportFriendResp) String() string { return proto.CompactTextString(m) } func (*ImportFriendResp) ProtoMessage() {} func (*ImportFriendResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{6} + return fileDescriptor_friend_74b4824fb8c5de90, []int{8} } func (m *ImportFriendResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ImportFriendResp.Unmarshal(m, b) @@ -458,234 +455,107 @@ func (m *ImportFriendResp) GetCommonResp() *CommonResp { return nil } -func (m *ImportFriendResp) GetFailedUidList() []string { +func (m *ImportFriendResp) GetUserIDResultList() []*UserIDResult { if m != nil { - return m.FailedUidList + return m.UserIDResultList } return nil } -type GetFriendApplyReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` +type GetFriendApplyListReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *GetFriendApplyReq) Reset() { *m = GetFriendApplyReq{} } -func (m *GetFriendApplyReq) String() string { return proto.CompactTextString(m) } -func (*GetFriendApplyReq) ProtoMessage() {} -func (*GetFriendApplyReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{7} +func (m *GetFriendApplyListReq) Reset() { *m = GetFriendApplyListReq{} } +func (m *GetFriendApplyListReq) String() string { return proto.CompactTextString(m) } +func (*GetFriendApplyListReq) ProtoMessage() {} +func (*GetFriendApplyListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{9} } -func (m *GetFriendApplyReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetFriendApplyReq.Unmarshal(m, b) +func (m *GetFriendApplyListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendApplyListReq.Unmarshal(m, b) } -func (m *GetFriendApplyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetFriendApplyReq.Marshal(b, m, deterministic) +func (m *GetFriendApplyListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendApplyListReq.Marshal(b, m, deterministic) } -func (dst *GetFriendApplyReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendApplyReq.Merge(dst, src) +func (dst *GetFriendApplyListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendApplyListReq.Merge(dst, src) } -func (m *GetFriendApplyReq) XXX_Size() int { - return xxx_messageInfo_GetFriendApplyReq.Size(m) +func (m *GetFriendApplyListReq) XXX_Size() int { + return xxx_messageInfo_GetFriendApplyListReq.Size(m) } -func (m *GetFriendApplyReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetFriendApplyReq.DiscardUnknown(m) +func (m *GetFriendApplyListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendApplyListReq.DiscardUnknown(m) } -var xxx_messageInfo_GetFriendApplyReq proto.InternalMessageInfo +var xxx_messageInfo_GetFriendApplyListReq proto.InternalMessageInfo -func (m *GetFriendApplyReq) GetOperationID() string { +func (m *GetFriendApplyListReq) GetCommID() *CommID { if m != nil { - return m.OperationID - } - return "" -} - -func (m *GetFriendApplyReq) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -type GetFriendApplyResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Data []*ApplyUserInfo `protobuf:"bytes,4,rep,name=data" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetFriendApplyResp) Reset() { *m = GetFriendApplyResp{} } -func (m *GetFriendApplyResp) String() string { return proto.CompactTextString(m) } -func (*GetFriendApplyResp) ProtoMessage() {} -func (*GetFriendApplyResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{8} -} -func (m *GetFriendApplyResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetFriendApplyResp.Unmarshal(m, b) -} -func (m *GetFriendApplyResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetFriendApplyResp.Marshal(b, m, deterministic) -} -func (dst *GetFriendApplyResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetFriendApplyResp.Merge(dst, src) -} -func (m *GetFriendApplyResp) XXX_Size() int { - return xxx_messageInfo_GetFriendApplyResp.Size(m) -} -func (m *GetFriendApplyResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetFriendApplyResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetFriendApplyResp proto.InternalMessageInfo - -func (m *GetFriendApplyResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode - } - return 0 -} - -func (m *GetFriendApplyResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg - } - return "" -} - -func (m *GetFriendApplyResp) GetData() []*ApplyUserInfo { - if m != nil { - return m.Data + return m.CommID } return nil } -type ApplyUserInfo struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon" json:"icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` - Flag int32 `protobuf:"varint,9,opt,name=flag" json:"flag,omitempty"` - ApplyTime string `protobuf:"bytes,10,opt,name=applyTime" json:"applyTime,omitempty"` - ReqMessage string `protobuf:"bytes,11,opt,name=reqMessage" json:"reqMessage,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type GetFriendApplyListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendRequestList []*sdk_ws.FriendRequest `protobuf:"bytes,3,rep,name=FriendRequestList" json:"FriendRequestList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ApplyUserInfo) Reset() { *m = ApplyUserInfo{} } -func (m *ApplyUserInfo) String() string { return proto.CompactTextString(m) } -func (*ApplyUserInfo) ProtoMessage() {} -func (*ApplyUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{9} +func (m *GetFriendApplyListResp) Reset() { *m = GetFriendApplyListResp{} } +func (m *GetFriendApplyListResp) String() string { return proto.CompactTextString(m) } +func (*GetFriendApplyListResp) ProtoMessage() {} +func (*GetFriendApplyListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{10} } -func (m *ApplyUserInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApplyUserInfo.Unmarshal(m, b) +func (m *GetFriendApplyListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendApplyListResp.Unmarshal(m, b) } -func (m *ApplyUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApplyUserInfo.Marshal(b, m, deterministic) +func (m *GetFriendApplyListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendApplyListResp.Marshal(b, m, deterministic) } -func (dst *ApplyUserInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApplyUserInfo.Merge(dst, src) +func (dst *GetFriendApplyListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendApplyListResp.Merge(dst, src) } -func (m *ApplyUserInfo) XXX_Size() int { - return xxx_messageInfo_ApplyUserInfo.Size(m) +func (m *GetFriendApplyListResp) XXX_Size() int { + return xxx_messageInfo_GetFriendApplyListResp.Size(m) } -func (m *ApplyUserInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ApplyUserInfo.DiscardUnknown(m) +func (m *GetFriendApplyListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendApplyListResp.DiscardUnknown(m) } -var xxx_messageInfo_ApplyUserInfo proto.InternalMessageInfo +var xxx_messageInfo_GetFriendApplyListResp proto.InternalMessageInfo -func (m *ApplyUserInfo) GetUid() string { +func (m *GetFriendApplyListResp) GetErrCode() int32 { if m != nil { - return m.Uid - } - return "" -} - -func (m *ApplyUserInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ApplyUserInfo) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *ApplyUserInfo) GetGender() int32 { - if m != nil { - return m.Gender + return m.ErrCode } return 0 } -func (m *ApplyUserInfo) GetMobile() string { +func (m *GetFriendApplyListResp) GetErrMsg() string { if m != nil { - return m.Mobile + return m.ErrMsg } return "" } -func (m *ApplyUserInfo) GetBirth() string { +func (m *GetFriendApplyListResp) GetFriendRequestList() []*sdk_ws.FriendRequest { if m != nil { - return m.Birth + return m.FriendRequestList } - return "" -} - -func (m *ApplyUserInfo) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -func (m *ApplyUserInfo) GetEx() string { - if m != nil { - return m.Ex - } - return "" -} - -func (m *ApplyUserInfo) GetFlag() int32 { - if m != nil { - return m.Flag - } - return 0 -} - -func (m *ApplyUserInfo) GetApplyTime() string { - if m != nil { - return m.ApplyTime - } - return "" -} - -func (m *ApplyUserInfo) GetReqMessage() string { - if m != nil { - return m.ReqMessage - } - return "" + return nil } type GetFriendListReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -695,7 +565,7 @@ func (m *GetFriendListReq) Reset() { *m = GetFriendListReq{} } func (m *GetFriendListReq) String() string { return proto.CompactTextString(m) } func (*GetFriendListReq) ProtoMessage() {} func (*GetFriendListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{10} + return fileDescriptor_friend_74b4824fb8c5de90, []int{11} } func (m *GetFriendListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendListReq.Unmarshal(m, b) @@ -715,34 +585,27 @@ func (m *GetFriendListReq) XXX_DiscardUnknown() { var xxx_messageInfo_GetFriendListReq proto.InternalMessageInfo -func (m *GetFriendListReq) GetOperationID() string { +func (m *GetFriendListReq) GetCommID() *CommID { if m != nil { - return m.OperationID + return m.CommID } - return "" -} - -func (m *GetFriendListReq) GetToken() string { - if m != nil { - return m.Token - } - return "" + return nil } type GetFriendListResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Data []*UserInfo `protobuf:"bytes,3,rep,name=data" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendInfoList []*sdk_ws.FriendInfo `protobuf:"bytes,3,rep,name=FriendInfoList" json:"FriendInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetFriendListResp) Reset() { *m = GetFriendListResp{} } func (m *GetFriendListResp) String() string { return proto.CompactTextString(m) } func (*GetFriendListResp) ProtoMessage() {} func (*GetFriendListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{11} + return fileDescriptor_friend_74b4824fb8c5de90, []int{12} } func (m *GetFriendListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendListResp.Unmarshal(m, b) @@ -762,142 +625,29 @@ func (m *GetFriendListResp) XXX_DiscardUnknown() { var xxx_messageInfo_GetFriendListResp proto.InternalMessageInfo -func (m *GetFriendListResp) GetErrorCode() int32 { +func (m *GetFriendListResp) GetErrCode() int32 { if m != nil { - return m.ErrorCode + return m.ErrCode } return 0 } -func (m *GetFriendListResp) GetErrorMsg() string { +func (m *GetFriendListResp) GetErrMsg() string { if m != nil { - return m.ErrorMsg + return m.ErrMsg } return "" } -func (m *GetFriendListResp) GetData() []*UserInfo { +func (m *GetFriendListResp) GetFriendInfoList() []*sdk_ws.FriendInfo { if m != nil { - return m.Data + return m.FriendInfoList } return nil } -type UserInfo struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - Icon string `protobuf:"bytes,2,opt,name=icon" json:"icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` - Comment string `protobuf:"bytes,9,opt,name=comment" json:"comment,omitempty"` - IsInBlackList int32 `protobuf:"varint,10,opt,name=isInBlackList" json:"isInBlackList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserInfo) Reset() { *m = UserInfo{} } -func (m *UserInfo) String() string { return proto.CompactTextString(m) } -func (*UserInfo) ProtoMessage() {} -func (*UserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{12} -} -func (m *UserInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserInfo.Unmarshal(m, b) -} -func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserInfo.Marshal(b, m, deterministic) -} -func (dst *UserInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserInfo.Merge(dst, src) -} -func (m *UserInfo) XXX_Size() int { - return xxx_messageInfo_UserInfo.Size(m) -} -func (m *UserInfo) XXX_DiscardUnknown() { - xxx_messageInfo_UserInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_UserInfo proto.InternalMessageInfo - -func (m *UserInfo) GetUid() string { - if m != nil { - return m.Uid - } - return "" -} - -func (m *UserInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *UserInfo) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *UserInfo) GetGender() int32 { - if m != nil { - return m.Gender - } - return 0 -} - -func (m *UserInfo) GetMobile() string { - if m != nil { - return m.Mobile - } - return "" -} - -func (m *UserInfo) GetBirth() string { - if m != nil { - return m.Birth - } - return "" -} - -func (m *UserInfo) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -func (m *UserInfo) GetEx() string { - if m != nil { - return m.Ex - } - return "" -} - -func (m *UserInfo) GetComment() string { - if m != nil { - return m.Comment - } - return "" -} - -func (m *UserInfo) GetIsInBlackList() int32 { - if m != nil { - return m.IsInBlackList - } - return 0 -} - type AddBlacklistReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` - OwnerUid string `protobuf:"bytes,4,opt,name=OwnerUid" json:"OwnerUid,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -907,7 +657,7 @@ func (m *AddBlacklistReq) Reset() { *m = AddBlacklistReq{} } func (m *AddBlacklistReq) String() string { return proto.CompactTextString(m) } func (*AddBlacklistReq) ProtoMessage() {} func (*AddBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{13} + return fileDescriptor_friend_74b4824fb8c5de90, []int{13} } func (m *AddBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddBlacklistReq.Unmarshal(m, b) @@ -927,38 +677,53 @@ func (m *AddBlacklistReq) XXX_DiscardUnknown() { var xxx_messageInfo_AddBlacklistReq proto.InternalMessageInfo -func (m *AddBlacklistReq) GetUid() string { +func (m *AddBlacklistReq) GetCommID() *CommID { if m != nil { - return m.Uid + return m.CommID } - return "" + return nil } -func (m *AddBlacklistReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" +type AddBlacklistResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *AddBlacklistReq) GetToken() string { - if m != nil { - return m.Token - } - return "" +func (m *AddBlacklistResp) Reset() { *m = AddBlacklistResp{} } +func (m *AddBlacklistResp) String() string { return proto.CompactTextString(m) } +func (*AddBlacklistResp) ProtoMessage() {} +func (*AddBlacklistResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{14} +} +func (m *AddBlacklistResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddBlacklistResp.Unmarshal(m, b) +} +func (m *AddBlacklistResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddBlacklistResp.Marshal(b, m, deterministic) +} +func (dst *AddBlacklistResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddBlacklistResp.Merge(dst, src) +} +func (m *AddBlacklistResp) XXX_Size() int { + return xxx_messageInfo_AddBlacklistResp.Size(m) +} +func (m *AddBlacklistResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddBlacklistResp.DiscardUnknown(m) } -func (m *AddBlacklistReq) GetOwnerUid() string { +var xxx_messageInfo_AddBlacklistResp proto.InternalMessageInfo + +func (m *AddBlacklistResp) GetCommonResp() *CommonResp { if m != nil { - return m.OwnerUid + return m.CommonResp } - return "" + return nil } type RemoveBlacklistReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -968,7 +733,7 @@ func (m *RemoveBlacklistReq) Reset() { *m = RemoveBlacklistReq{} } func (m *RemoveBlacklistReq) String() string { return proto.CompactTextString(m) } func (*RemoveBlacklistReq) ProtoMessage() {} func (*RemoveBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{14} + return fileDescriptor_friend_74b4824fb8c5de90, []int{15} } func (m *RemoveBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RemoveBlacklistReq.Unmarshal(m, b) @@ -988,30 +753,53 @@ func (m *RemoveBlacklistReq) XXX_DiscardUnknown() { var xxx_messageInfo_RemoveBlacklistReq proto.InternalMessageInfo -func (m *RemoveBlacklistReq) GetUid() string { +func (m *RemoveBlacklistReq) GetCommID() *CommID { if m != nil { - return m.Uid + return m.CommID } - return "" + return nil } -func (m *RemoveBlacklistReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" +type RemoveBlacklistResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RemoveBlacklistReq) GetToken() string { +func (m *RemoveBlacklistResp) Reset() { *m = RemoveBlacklistResp{} } +func (m *RemoveBlacklistResp) String() string { return proto.CompactTextString(m) } +func (*RemoveBlacklistResp) ProtoMessage() {} +func (*RemoveBlacklistResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{16} +} +func (m *RemoveBlacklistResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveBlacklistResp.Unmarshal(m, b) +} +func (m *RemoveBlacklistResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveBlacklistResp.Marshal(b, m, deterministic) +} +func (dst *RemoveBlacklistResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveBlacklistResp.Merge(dst, src) +} +func (m *RemoveBlacklistResp) XXX_Size() int { + return xxx_messageInfo_RemoveBlacklistResp.Size(m) +} +func (m *RemoveBlacklistResp) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveBlacklistResp.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveBlacklistResp proto.InternalMessageInfo + +func (m *RemoveBlacklistResp) GetCommonResp() *CommonResp { if m != nil { - return m.Token + return m.CommonResp } - return "" + return nil } type GetBlacklistReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1021,7 +809,7 @@ func (m *GetBlacklistReq) Reset() { *m = GetBlacklistReq{} } func (m *GetBlacklistReq) String() string { return proto.CompactTextString(m) } func (*GetBlacklistReq) ProtoMessage() {} func (*GetBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{15} + return fileDescriptor_friend_74b4824fb8c5de90, []int{17} } func (m *GetBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlacklistReq.Unmarshal(m, b) @@ -1041,34 +829,27 @@ func (m *GetBlacklistReq) XXX_DiscardUnknown() { var xxx_messageInfo_GetBlacklistReq proto.InternalMessageInfo -func (m *GetBlacklistReq) GetOperationID() string { +func (m *GetBlacklistReq) GetCommID() *CommID { if m != nil { - return m.OperationID + return m.CommID } - return "" -} - -func (m *GetBlacklistReq) GetToken() string { - if m != nil { - return m.Token - } - return "" + return nil } type GetBlacklistResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Data []*UserInfo `protobuf:"bytes,3,rep,name=data" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + BlackUserInfoList []*sdk_ws.PublicUserInfo `protobuf:"bytes,3,rep,name=BlackUserInfoList" json:"BlackUserInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetBlacklistResp) Reset() { *m = GetBlacklistResp{} } func (m *GetBlacklistResp) String() string { return proto.CompactTextString(m) } func (*GetBlacklistResp) ProtoMessage() {} func (*GetBlacklistResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{16} + return fileDescriptor_friend_74b4824fb8c5de90, []int{18} } func (m *GetBlacklistResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlacklistResp.Unmarshal(m, b) @@ -1088,31 +869,29 @@ func (m *GetBlacklistResp) XXX_DiscardUnknown() { var xxx_messageInfo_GetBlacklistResp proto.InternalMessageInfo -func (m *GetBlacklistResp) GetErrorCode() int32 { +func (m *GetBlacklistResp) GetErrCode() int32 { if m != nil { - return m.ErrorCode + return m.ErrCode } return 0 } -func (m *GetBlacklistResp) GetErrorMsg() string { +func (m *GetBlacklistResp) GetErrMsg() string { if m != nil { - return m.ErrorMsg + return m.ErrMsg } return "" } -func (m *GetBlacklistResp) GetData() []*UserInfo { +func (m *GetBlacklistResp) GetBlackUserInfoList() []*sdk_ws.PublicUserInfo { if m != nil { - return m.Data + return m.BlackUserInfoList } return nil } type IsFriendReq struct { - Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` - ReceiveUid string `protobuf:"bytes,2,opt,name=receiveUid" json:"receiveUid,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1122,7 +901,7 @@ func (m *IsFriendReq) Reset() { *m = IsFriendReq{} } func (m *IsFriendReq) String() string { return proto.CompactTextString(m) } func (*IsFriendReq) ProtoMessage() {} func (*IsFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{17} + return fileDescriptor_friend_74b4824fb8c5de90, []int{19} } func (m *IsFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsFriendReq.Unmarshal(m, b) @@ -1142,31 +921,17 @@ func (m *IsFriendReq) XXX_DiscardUnknown() { var xxx_messageInfo_IsFriendReq proto.InternalMessageInfo -func (m *IsFriendReq) GetToken() string { +func (m *IsFriendReq) GetCommID() *CommID { if m != nil { - return m.Token + return m.CommID } - return "" -} - -func (m *IsFriendReq) GetReceiveUid() string { - if m != nil { - return m.ReceiveUid - } - return "" -} - -func (m *IsFriendReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" + return nil } type IsFriendResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - ShipType int32 `protobuf:"varint,3,opt,name=shipType" json:"shipType,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Response bool `protobuf:"varint,3,opt,name=Response" json:"Response,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1176,7 +941,7 @@ func (m *IsFriendResp) Reset() { *m = IsFriendResp{} } func (m *IsFriendResp) String() string { return proto.CompactTextString(m) } func (*IsFriendResp) ProtoMessage() {} func (*IsFriendResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{18} + return fileDescriptor_friend_74b4824fb8c5de90, []int{20} } func (m *IsFriendResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsFriendResp.Unmarshal(m, b) @@ -1196,31 +961,29 @@ func (m *IsFriendResp) XXX_DiscardUnknown() { var xxx_messageInfo_IsFriendResp proto.InternalMessageInfo -func (m *IsFriendResp) GetErrorCode() int32 { +func (m *IsFriendResp) GetErrCode() int32 { if m != nil { - return m.ErrorCode + return m.ErrCode } return 0 } -func (m *IsFriendResp) GetErrorMsg() string { +func (m *IsFriendResp) GetErrMsg() string { if m != nil { - return m.ErrorMsg + return m.ErrMsg } return "" } -func (m *IsFriendResp) GetShipType() int32 { +func (m *IsFriendResp) GetResponse() bool { if m != nil { - return m.ShipType + return m.Response } - return 0 + return false } type IsInBlackListReq struct { - SendUid string `protobuf:"bytes,1,opt,name=sendUid" json:"sendUid,omitempty"` - ReceiveUid string `protobuf:"bytes,2,opt,name=receiveUid" json:"receiveUid,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1230,7 +993,7 @@ func (m *IsInBlackListReq) Reset() { *m = IsInBlackListReq{} } func (m *IsInBlackListReq) String() string { return proto.CompactTextString(m) } func (*IsInBlackListReq) ProtoMessage() {} func (*IsInBlackListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{19} + return fileDescriptor_friend_74b4824fb8c5de90, []int{21} } func (m *IsInBlackListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsInBlackListReq.Unmarshal(m, b) @@ -1250,31 +1013,17 @@ func (m *IsInBlackListReq) XXX_DiscardUnknown() { var xxx_messageInfo_IsInBlackListReq proto.InternalMessageInfo -func (m *IsInBlackListReq) GetSendUid() string { +func (m *IsInBlackListReq) GetCommID() *CommID { if m != nil { - return m.SendUid + return m.CommID } - return "" -} - -func (m *IsInBlackListReq) GetReceiveUid() string { - if m != nil { - return m.ReceiveUid - } - return "" -} - -func (m *IsInBlackListReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" + return nil } type IsInBlackListResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Response bool `protobuf:"varint,3,opt,name=response" json:"response,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Response bool `protobuf:"varint,3,opt,name=Response" json:"Response,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1284,7 +1033,7 @@ func (m *IsInBlackListResp) Reset() { *m = IsInBlackListResp{} } func (m *IsInBlackListResp) String() string { return proto.CompactTextString(m) } func (*IsInBlackListResp) ProtoMessage() {} func (*IsInBlackListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{20} + return fileDescriptor_friend_74b4824fb8c5de90, []int{22} } func (m *IsInBlackListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsInBlackListResp.Unmarshal(m, b) @@ -1304,16 +1053,16 @@ func (m *IsInBlackListResp) XXX_DiscardUnknown() { var xxx_messageInfo_IsInBlackListResp proto.InternalMessageInfo -func (m *IsInBlackListResp) GetErrorCode() int32 { +func (m *IsInBlackListResp) GetErrCode() int32 { if m != nil { - return m.ErrorCode + return m.ErrCode } return 0 } -func (m *IsInBlackListResp) GetErrorMsg() string { +func (m *IsInBlackListResp) GetErrMsg() string { if m != nil { - return m.ErrorMsg + return m.ErrMsg } return "" } @@ -1326,9 +1075,7 @@ func (m *IsInBlackListResp) GetResponse() bool { } type DeleteFriendReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=Token" json:"Token,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1338,7 +1085,7 @@ func (m *DeleteFriendReq) Reset() { *m = DeleteFriendReq{} } func (m *DeleteFriendReq) String() string { return proto.CompactTextString(m) } func (*DeleteFriendReq) ProtoMessage() {} func (*DeleteFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{21} + return fileDescriptor_friend_74b4824fb8c5de90, []int{23} } func (m *DeleteFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteFriendReq.Unmarshal(m, b) @@ -1358,32 +1105,56 @@ func (m *DeleteFriendReq) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteFriendReq proto.InternalMessageInfo -func (m *DeleteFriendReq) GetUid() string { +func (m *DeleteFriendReq) GetCommID() *CommID { if m != nil { - return m.Uid + return m.CommID } - return "" + return nil } -func (m *DeleteFriendReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" +type DeleteFriendResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *DeleteFriendReq) GetToken() string { - if m != nil { - return m.Token - } - return "" +func (m *DeleteFriendResp) Reset() { *m = DeleteFriendResp{} } +func (m *DeleteFriendResp) String() string { return proto.CompactTextString(m) } +func (*DeleteFriendResp) ProtoMessage() {} +func (*DeleteFriendResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{24} +} +func (m *DeleteFriendResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteFriendResp.Unmarshal(m, b) +} +func (m *DeleteFriendResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteFriendResp.Marshal(b, m, deterministic) +} +func (dst *DeleteFriendResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFriendResp.Merge(dst, src) +} +func (m *DeleteFriendResp) XXX_Size() int { + return xxx_messageInfo_DeleteFriendResp.Size(m) +} +func (m *DeleteFriendResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteFriendResp.DiscardUnknown(m) } +var xxx_messageInfo_DeleteFriendResp proto.InternalMessageInfo + +func (m *DeleteFriendResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +// process type AddFriendResponseReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - Flag int32 `protobuf:"varint,2,opt,name=flag" json:"flag,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,4,opt,name=Token" json:"Token,omitempty"` + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + HandleResult int32 `protobuf:"varint,2,opt,name=handleResult" json:"handleResult,omitempty"` + HandleMsg string `protobuf:"bytes,3,opt,name=handleMsg" json:"handleMsg,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1393,7 +1164,7 @@ func (m *AddFriendResponseReq) Reset() { *m = AddFriendResponseReq{} } func (m *AddFriendResponseReq) String() string { return proto.CompactTextString(m) } func (*AddFriendResponseReq) ProtoMessage() {} func (*AddFriendResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{22} + return fileDescriptor_friend_74b4824fb8c5de90, []int{25} } func (m *AddFriendResponseReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddFriendResponseReq.Unmarshal(m, b) @@ -1413,112 +1184,259 @@ func (m *AddFriendResponseReq) XXX_DiscardUnknown() { var xxx_messageInfo_AddFriendResponseReq proto.InternalMessageInfo -func (m *AddFriendResponseReq) GetUid() string { +func (m *AddFriendResponseReq) GetCommID() *CommID { if m != nil { - return m.Uid + return m.CommID } - return "" + return nil } -func (m *AddFriendResponseReq) GetFlag() int32 { +func (m *AddFriendResponseReq) GetHandleResult() int32 { if m != nil { - return m.Flag + return m.HandleResult } return 0 } -func (m *AddFriendResponseReq) GetOperationID() string { +func (m *AddFriendResponseReq) GetHandleMsg() string { if m != nil { - return m.OperationID + return m.HandleMsg } return "" } -func (m *AddFriendResponseReq) GetToken() string { - if m != nil { - return m.Token - } - return "" +type AddFriendResponseResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -type SetFriendCommentReq struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - Comment string `protobuf:"bytes,3,opt,name=comment" json:"comment,omitempty"` - Token string `protobuf:"bytes,4,opt,name=token" json:"token,omitempty"` +func (m *AddFriendResponseResp) Reset() { *m = AddFriendResponseResp{} } +func (m *AddFriendResponseResp) String() string { return proto.CompactTextString(m) } +func (*AddFriendResponseResp) ProtoMessage() {} +func (*AddFriendResponseResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{26} +} +func (m *AddFriendResponseResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddFriendResponseResp.Unmarshal(m, b) +} +func (m *AddFriendResponseResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddFriendResponseResp.Marshal(b, m, deterministic) +} +func (dst *AddFriendResponseResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendResponseResp.Merge(dst, src) +} +func (m *AddFriendResponseResp) XXX_Size() int { + return xxx_messageInfo_AddFriendResponseResp.Size(m) +} +func (m *AddFriendResponseResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddFriendResponseResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AddFriendResponseResp proto.InternalMessageInfo + +func (m *AddFriendResponseResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SetFriendRemarkReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + Remark string `protobuf:"bytes,2,opt,name=Remark" json:"Remark,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *SetFriendCommentReq) Reset() { *m = SetFriendCommentReq{} } -func (m *SetFriendCommentReq) String() string { return proto.CompactTextString(m) } -func (*SetFriendCommentReq) ProtoMessage() {} -func (*SetFriendCommentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_03bf5fbe59a174aa, []int{23} +func (m *SetFriendRemarkReq) Reset() { *m = SetFriendRemarkReq{} } +func (m *SetFriendRemarkReq) String() string { return proto.CompactTextString(m) } +func (*SetFriendRemarkReq) ProtoMessage() {} +func (*SetFriendRemarkReq) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{27} } -func (m *SetFriendCommentReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetFriendCommentReq.Unmarshal(m, b) +func (m *SetFriendRemarkReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetFriendRemarkReq.Unmarshal(m, b) } -func (m *SetFriendCommentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetFriendCommentReq.Marshal(b, m, deterministic) +func (m *SetFriendRemarkReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetFriendRemarkReq.Marshal(b, m, deterministic) } -func (dst *SetFriendCommentReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetFriendCommentReq.Merge(dst, src) +func (dst *SetFriendRemarkReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetFriendRemarkReq.Merge(dst, src) } -func (m *SetFriendCommentReq) XXX_Size() int { - return xxx_messageInfo_SetFriendCommentReq.Size(m) +func (m *SetFriendRemarkReq) XXX_Size() int { + return xxx_messageInfo_SetFriendRemarkReq.Size(m) } -func (m *SetFriendCommentReq) XXX_DiscardUnknown() { - xxx_messageInfo_SetFriendCommentReq.DiscardUnknown(m) +func (m *SetFriendRemarkReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetFriendRemarkReq.DiscardUnknown(m) } -var xxx_messageInfo_SetFriendCommentReq proto.InternalMessageInfo +var xxx_messageInfo_SetFriendRemarkReq proto.InternalMessageInfo -func (m *SetFriendCommentReq) GetUid() string { +func (m *SetFriendRemarkReq) GetCommID() *CommID { if m != nil { - return m.Uid + return m.CommID + } + return nil +} + +func (m *SetFriendRemarkReq) GetRemark() string { + if m != nil { + return m.Remark } return "" } -func (m *SetFriendCommentReq) GetOperationID() string { +type SetFriendRemarkResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetFriendRemarkResp) Reset() { *m = SetFriendRemarkResp{} } +func (m *SetFriendRemarkResp) String() string { return proto.CompactTextString(m) } +func (*SetFriendRemarkResp) ProtoMessage() {} +func (*SetFriendRemarkResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{28} +} +func (m *SetFriendRemarkResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetFriendRemarkResp.Unmarshal(m, b) +} +func (m *SetFriendRemarkResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetFriendRemarkResp.Marshal(b, m, deterministic) +} +func (dst *SetFriendRemarkResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetFriendRemarkResp.Merge(dst, src) +} +func (m *SetFriendRemarkResp) XXX_Size() int { + return xxx_messageInfo_SetFriendRemarkResp.Size(m) +} +func (m *SetFriendRemarkResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetFriendRemarkResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetFriendRemarkResp proto.InternalMessageInfo + +func (m *SetFriendRemarkResp) GetCommonResp() *CommonResp { if m != nil { - return m.OperationID + return m.CommonResp + } + return nil +} + +type GetSelfApplyListReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSelfApplyListReq) Reset() { *m = GetSelfApplyListReq{} } +func (m *GetSelfApplyListReq) String() string { return proto.CompactTextString(m) } +func (*GetSelfApplyListReq) ProtoMessage() {} +func (*GetSelfApplyListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{29} +} +func (m *GetSelfApplyListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSelfApplyListReq.Unmarshal(m, b) +} +func (m *GetSelfApplyListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSelfApplyListReq.Marshal(b, m, deterministic) +} +func (dst *GetSelfApplyListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSelfApplyListReq.Merge(dst, src) +} +func (m *GetSelfApplyListReq) XXX_Size() int { + return xxx_messageInfo_GetSelfApplyListReq.Size(m) +} +func (m *GetSelfApplyListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetSelfApplyListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSelfApplyListReq proto.InternalMessageInfo + +func (m *GetSelfApplyListReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type GetSelfApplyListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendRequestList []*sdk_ws.FriendRequest `protobuf:"bytes,3,rep,name=FriendRequestList" json:"FriendRequestList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSelfApplyListResp) Reset() { *m = GetSelfApplyListResp{} } +func (m *GetSelfApplyListResp) String() string { return proto.CompactTextString(m) } +func (*GetSelfApplyListResp) ProtoMessage() {} +func (*GetSelfApplyListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{30} +} +func (m *GetSelfApplyListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSelfApplyListResp.Unmarshal(m, b) +} +func (m *GetSelfApplyListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSelfApplyListResp.Marshal(b, m, deterministic) +} +func (dst *GetSelfApplyListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSelfApplyListResp.Merge(dst, src) +} +func (m *GetSelfApplyListResp) XXX_Size() int { + return xxx_messageInfo_GetSelfApplyListResp.Size(m) +} +func (m *GetSelfApplyListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetSelfApplyListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSelfApplyListResp proto.InternalMessageInfo + +func (m *GetSelfApplyListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetSelfApplyListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg } return "" } -func (m *SetFriendCommentReq) GetComment() string { +func (m *GetSelfApplyListResp) GetFriendRequestList() []*sdk_ws.FriendRequest { if m != nil { - return m.Comment + return m.FriendRequestList } - return "" -} - -func (m *SetFriendCommentReq) GetToken() string { - if m != nil { - return m.Token - } - return "" + return nil } func init() { proto.RegisterType((*CommonResp)(nil), "friend.CommonResp") + proto.RegisterType((*CommID)(nil), "friend.CommID") proto.RegisterType((*GetFriendsInfoReq)(nil), "friend.GetFriendsInfoReq") proto.RegisterType((*GetFriendInfoResp)(nil), "friend.GetFriendInfoResp") - proto.RegisterType((*GetFriendData)(nil), "friend.GetFriendData") proto.RegisterType((*AddFriendReq)(nil), "friend.AddFriendReq") + proto.RegisterType((*AddFriendResp)(nil), "friend.AddFriendResp") proto.RegisterType((*ImportFriendReq)(nil), "friend.ImportFriendReq") + proto.RegisterType((*UserIDResult)(nil), "friend.UserIDResult") proto.RegisterType((*ImportFriendResp)(nil), "friend.ImportFriendResp") - proto.RegisterType((*GetFriendApplyReq)(nil), "friend.GetFriendApplyReq") - proto.RegisterType((*GetFriendApplyResp)(nil), "friend.GetFriendApplyResp") - proto.RegisterType((*ApplyUserInfo)(nil), "friend.ApplyUserInfo") - proto.RegisterType((*GetFriendListReq)(nil), "friend.getFriendListReq") - proto.RegisterType((*GetFriendListResp)(nil), "friend.getFriendListResp") - proto.RegisterType((*UserInfo)(nil), "friend.UserInfo") + proto.RegisterType((*GetFriendApplyListReq)(nil), "friend.GetFriendApplyListReq") + proto.RegisterType((*GetFriendApplyListResp)(nil), "friend.GetFriendApplyListResp") + proto.RegisterType((*GetFriendListReq)(nil), "friend.GetFriendListReq") + proto.RegisterType((*GetFriendListResp)(nil), "friend.GetFriendListResp") proto.RegisterType((*AddBlacklistReq)(nil), "friend.AddBlacklistReq") + proto.RegisterType((*AddBlacklistResp)(nil), "friend.AddBlacklistResp") proto.RegisterType((*RemoveBlacklistReq)(nil), "friend.RemoveBlacklistReq") + proto.RegisterType((*RemoveBlacklistResp)(nil), "friend.RemoveBlacklistResp") proto.RegisterType((*GetBlacklistReq)(nil), "friend.GetBlacklistReq") proto.RegisterType((*GetBlacklistResp)(nil), "friend.GetBlacklistResp") proto.RegisterType((*IsFriendReq)(nil), "friend.IsFriendReq") @@ -1526,8 +1444,13 @@ func init() { proto.RegisterType((*IsInBlackListReq)(nil), "friend.IsInBlackListReq") proto.RegisterType((*IsInBlackListResp)(nil), "friend.IsInBlackListResp") proto.RegisterType((*DeleteFriendReq)(nil), "friend.DeleteFriendReq") + proto.RegisterType((*DeleteFriendResp)(nil), "friend.DeleteFriendResp") proto.RegisterType((*AddFriendResponseReq)(nil), "friend.AddFriendResponseReq") - proto.RegisterType((*SetFriendCommentReq)(nil), "friend.SetFriendCommentReq") + proto.RegisterType((*AddFriendResponseResp)(nil), "friend.AddFriendResponseResp") + proto.RegisterType((*SetFriendRemarkReq)(nil), "friend.SetFriendRemarkReq") + proto.RegisterType((*SetFriendRemarkResp)(nil), "friend.SetFriendRemarkResp") + proto.RegisterType((*GetSelfApplyListReq)(nil), "friend.GetSelfApplyListReq") + proto.RegisterType((*GetSelfApplyListResp)(nil), "friend.GetSelfApplyListResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -1541,19 +1464,19 @@ const _ = grpc.SupportPackageIsVersion4 // Client API for Friend service type FriendClient interface { - GetFriendsInfo(ctx context.Context, in *GetFriendsInfoReq, opts ...grpc.CallOption) (*GetFriendInfoResp, error) - AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*CommonResp, error) - GetFriendApplyList(ctx context.Context, in *GetFriendApplyReq, opts ...grpc.CallOption) (*GetFriendApplyResp, error) - GetSelfApplyList(ctx context.Context, in *GetFriendApplyReq, opts ...grpc.CallOption) (*GetFriendApplyResp, error) + // rpc getFriendsInfo(GetFriendsInfoReq) returns(GetFriendInfoResp); + AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*AddFriendResp, error) + GetFriendApplyList(ctx context.Context, in *GetFriendApplyListReq, opts ...grpc.CallOption) (*GetFriendApplyListResp, error) + GetSelfApplyList(ctx context.Context, in *GetSelfApplyListReq, opts ...grpc.CallOption) (*GetSelfApplyListResp, error) GetFriendList(ctx context.Context, in *GetFriendListReq, opts ...grpc.CallOption) (*GetFriendListResp, error) - AddBlacklist(ctx context.Context, in *AddBlacklistReq, opts ...grpc.CallOption) (*CommonResp, error) - RemoveBlacklist(ctx context.Context, in *RemoveBlacklistReq, opts ...grpc.CallOption) (*CommonResp, error) + AddBlacklist(ctx context.Context, in *AddBlacklistReq, opts ...grpc.CallOption) (*AddBlacklistResp, error) + RemoveBlacklist(ctx context.Context, in *RemoveBlacklistReq, opts ...grpc.CallOption) (*RemoveBlacklistResp, error) IsFriend(ctx context.Context, in *IsFriendReq, opts ...grpc.CallOption) (*IsFriendResp, error) IsInBlackList(ctx context.Context, in *IsInBlackListReq, opts ...grpc.CallOption) (*IsInBlackListResp, error) GetBlacklist(ctx context.Context, in *GetBlacklistReq, opts ...grpc.CallOption) (*GetBlacklistResp, error) - DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*CommonResp, error) - AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*CommonResp, error) - SetFriendComment(ctx context.Context, in *SetFriendCommentReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*DeleteFriendResp, error) + AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*AddFriendResponseResp, error) + SetFriendRemark(ctx context.Context, in *SetFriendRemarkReq, opts ...grpc.CallOption) (*SetFriendRemarkResp, error) ImportFriend(ctx context.Context, in *ImportFriendReq, opts ...grpc.CallOption) (*ImportFriendResp, error) } @@ -1565,17 +1488,8 @@ func NewFriendClient(cc *grpc.ClientConn) FriendClient { return &friendClient{cc} } -func (c *friendClient) GetFriendsInfo(ctx context.Context, in *GetFriendsInfoReq, opts ...grpc.CallOption) (*GetFriendInfoResp, error) { - out := new(GetFriendInfoResp) - err := grpc.Invoke(ctx, "/friend.friend/getFriendsInfo", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *friendClient) AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) +func (c *friendClient) AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*AddFriendResp, error) { + out := new(AddFriendResp) err := grpc.Invoke(ctx, "/friend.friend/addFriend", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1583,8 +1497,8 @@ func (c *friendClient) AddFriend(ctx context.Context, in *AddFriendReq, opts ... return out, nil } -func (c *friendClient) GetFriendApplyList(ctx context.Context, in *GetFriendApplyReq, opts ...grpc.CallOption) (*GetFriendApplyResp, error) { - out := new(GetFriendApplyResp) +func (c *friendClient) GetFriendApplyList(ctx context.Context, in *GetFriendApplyListReq, opts ...grpc.CallOption) (*GetFriendApplyListResp, error) { + out := new(GetFriendApplyListResp) err := grpc.Invoke(ctx, "/friend.friend/getFriendApplyList", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1592,8 +1506,8 @@ func (c *friendClient) GetFriendApplyList(ctx context.Context, in *GetFriendAppl return out, nil } -func (c *friendClient) GetSelfApplyList(ctx context.Context, in *GetFriendApplyReq, opts ...grpc.CallOption) (*GetFriendApplyResp, error) { - out := new(GetFriendApplyResp) +func (c *friendClient) GetSelfApplyList(ctx context.Context, in *GetSelfApplyListReq, opts ...grpc.CallOption) (*GetSelfApplyListResp, error) { + out := new(GetSelfApplyListResp) err := grpc.Invoke(ctx, "/friend.friend/getSelfApplyList", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1610,8 +1524,8 @@ func (c *friendClient) GetFriendList(ctx context.Context, in *GetFriendListReq, return out, nil } -func (c *friendClient) AddBlacklist(ctx context.Context, in *AddBlacklistReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) +func (c *friendClient) AddBlacklist(ctx context.Context, in *AddBlacklistReq, opts ...grpc.CallOption) (*AddBlacklistResp, error) { + out := new(AddBlacklistResp) err := grpc.Invoke(ctx, "/friend.friend/addBlacklist", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1619,8 +1533,8 @@ func (c *friendClient) AddBlacklist(ctx context.Context, in *AddBlacklistReq, op return out, nil } -func (c *friendClient) RemoveBlacklist(ctx context.Context, in *RemoveBlacklistReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) +func (c *friendClient) RemoveBlacklist(ctx context.Context, in *RemoveBlacklistReq, opts ...grpc.CallOption) (*RemoveBlacklistResp, error) { + out := new(RemoveBlacklistResp) err := grpc.Invoke(ctx, "/friend.friend/removeBlacklist", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1655,8 +1569,8 @@ func (c *friendClient) GetBlacklist(ctx context.Context, in *GetBlacklistReq, op return out, nil } -func (c *friendClient) DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) +func (c *friendClient) DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*DeleteFriendResp, error) { + out := new(DeleteFriendResp) err := grpc.Invoke(ctx, "/friend.friend/deleteFriend", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1664,8 +1578,8 @@ func (c *friendClient) DeleteFriend(ctx context.Context, in *DeleteFriendReq, op return out, nil } -func (c *friendClient) AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) +func (c *friendClient) AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*AddFriendResponseResp, error) { + out := new(AddFriendResponseResp) err := grpc.Invoke(ctx, "/friend.friend/addFriendResponse", in, out, c.cc, opts...) if err != nil { return nil, err @@ -1673,9 +1587,9 @@ func (c *friendClient) AddFriendResponse(ctx context.Context, in *AddFriendRespo return out, nil } -func (c *friendClient) SetFriendComment(ctx context.Context, in *SetFriendCommentReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) - err := grpc.Invoke(ctx, "/friend.friend/setFriendComment", in, out, c.cc, opts...) +func (c *friendClient) SetFriendRemark(ctx context.Context, in *SetFriendRemarkReq, opts ...grpc.CallOption) (*SetFriendRemarkResp, error) { + out := new(SetFriendRemarkResp) + err := grpc.Invoke(ctx, "/friend.friend/setFriendRemark", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1684,7 +1598,7 @@ func (c *friendClient) SetFriendComment(ctx context.Context, in *SetFriendCommen func (c *friendClient) ImportFriend(ctx context.Context, in *ImportFriendReq, opts ...grpc.CallOption) (*ImportFriendResp, error) { out := new(ImportFriendResp) - err := grpc.Invoke(ctx, "/friend.friend/ImportFriend", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/friend.friend/importFriend", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1694,19 +1608,19 @@ func (c *friendClient) ImportFriend(ctx context.Context, in *ImportFriendReq, op // Server API for Friend service type FriendServer interface { - GetFriendsInfo(context.Context, *GetFriendsInfoReq) (*GetFriendInfoResp, error) - AddFriend(context.Context, *AddFriendReq) (*CommonResp, error) - GetFriendApplyList(context.Context, *GetFriendApplyReq) (*GetFriendApplyResp, error) - GetSelfApplyList(context.Context, *GetFriendApplyReq) (*GetFriendApplyResp, error) + // rpc getFriendsInfo(GetFriendsInfoReq) returns(GetFriendInfoResp); + AddFriend(context.Context, *AddFriendReq) (*AddFriendResp, error) + GetFriendApplyList(context.Context, *GetFriendApplyListReq) (*GetFriendApplyListResp, error) + GetSelfApplyList(context.Context, *GetSelfApplyListReq) (*GetSelfApplyListResp, error) GetFriendList(context.Context, *GetFriendListReq) (*GetFriendListResp, error) - AddBlacklist(context.Context, *AddBlacklistReq) (*CommonResp, error) - RemoveBlacklist(context.Context, *RemoveBlacklistReq) (*CommonResp, error) + AddBlacklist(context.Context, *AddBlacklistReq) (*AddBlacklistResp, error) + RemoveBlacklist(context.Context, *RemoveBlacklistReq) (*RemoveBlacklistResp, error) IsFriend(context.Context, *IsFriendReq) (*IsFriendResp, error) IsInBlackList(context.Context, *IsInBlackListReq) (*IsInBlackListResp, error) GetBlacklist(context.Context, *GetBlacklistReq) (*GetBlacklistResp, error) - DeleteFriend(context.Context, *DeleteFriendReq) (*CommonResp, error) - AddFriendResponse(context.Context, *AddFriendResponseReq) (*CommonResp, error) - SetFriendComment(context.Context, *SetFriendCommentReq) (*CommonResp, error) + DeleteFriend(context.Context, *DeleteFriendReq) (*DeleteFriendResp, error) + AddFriendResponse(context.Context, *AddFriendResponseReq) (*AddFriendResponseResp, error) + SetFriendRemark(context.Context, *SetFriendRemarkReq) (*SetFriendRemarkResp, error) ImportFriend(context.Context, *ImportFriendReq) (*ImportFriendResp, error) } @@ -1714,24 +1628,6 @@ func RegisterFriendServer(s *grpc.Server, srv FriendServer) { s.RegisterService(&_Friend_serviceDesc, srv) } -func _Friend_GetFriendsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetFriendsInfoReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FriendServer).GetFriendsInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/friend.friend/GetFriendsInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FriendServer).GetFriendsInfo(ctx, req.(*GetFriendsInfoReq)) - } - return interceptor(ctx, in, info, handler) -} - func _Friend_AddFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddFriendReq) if err := dec(in); err != nil { @@ -1751,7 +1647,7 @@ func _Friend_AddFriend_Handler(srv interface{}, ctx context.Context, dec func(in } func _Friend_GetFriendApplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetFriendApplyReq) + in := new(GetFriendApplyListReq) if err := dec(in); err != nil { return nil, err } @@ -1763,13 +1659,13 @@ func _Friend_GetFriendApplyList_Handler(srv interface{}, ctx context.Context, de FullMethod: "/friend.friend/GetFriendApplyList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FriendServer).GetFriendApplyList(ctx, req.(*GetFriendApplyReq)) + return srv.(FriendServer).GetFriendApplyList(ctx, req.(*GetFriendApplyListReq)) } return interceptor(ctx, in, info, handler) } func _Friend_GetSelfApplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetFriendApplyReq) + in := new(GetSelfApplyListReq) if err := dec(in); err != nil { return nil, err } @@ -1781,7 +1677,7 @@ func _Friend_GetSelfApplyList_Handler(srv interface{}, ctx context.Context, dec FullMethod: "/friend.friend/GetSelfApplyList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FriendServer).GetSelfApplyList(ctx, req.(*GetFriendApplyReq)) + return srv.(FriendServer).GetSelfApplyList(ctx, req.(*GetSelfApplyListReq)) } return interceptor(ctx, in, info, handler) } @@ -1930,20 +1826,20 @@ func _Friend_AddFriendResponse_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Friend_SetFriendComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetFriendCommentReq) +func _Friend_SetFriendRemark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetFriendRemarkReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(FriendServer).SetFriendComment(ctx, in) + return srv.(FriendServer).SetFriendRemark(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/friend.friend/SetFriendComment", + FullMethod: "/friend.friend/SetFriendRemark", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FriendServer).SetFriendComment(ctx, req.(*SetFriendCommentReq)) + return srv.(FriendServer).SetFriendRemark(ctx, req.(*SetFriendRemarkReq)) } return interceptor(ctx, in, info, handler) } @@ -1970,10 +1866,6 @@ var _Friend_serviceDesc = grpc.ServiceDesc{ ServiceName: "friend.friend", HandlerType: (*FriendServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "getFriendsInfo", - Handler: _Friend_GetFriendsInfo_Handler, - }, { MethodName: "addFriend", Handler: _Friend_AddFriend_Handler, @@ -2019,11 +1911,11 @@ var _Friend_serviceDesc = grpc.ServiceDesc{ Handler: _Friend_AddFriendResponse_Handler, }, { - MethodName: "setFriendComment", - Handler: _Friend_SetFriendComment_Handler, + MethodName: "setFriendRemark", + Handler: _Friend_SetFriendRemark_Handler, }, { - MethodName: "ImportFriend", + MethodName: "importFriend", Handler: _Friend_ImportFriend_Handler, }, }, @@ -2031,72 +1923,68 @@ var _Friend_serviceDesc = grpc.ServiceDesc{ Metadata: "friend/friend.proto", } -func init() { proto.RegisterFile("friend/friend.proto", fileDescriptor_friend_03bf5fbe59a174aa) } +func init() { proto.RegisterFile("friend/friend.proto", fileDescriptor_friend_74b4824fb8c5de90) } -var fileDescriptor_friend_03bf5fbe59a174aa = []byte{ - // 1013 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x86, 0x48, 0xc9, 0x96, 0x46, 0x72, 0x24, 0xad, 0xdd, 0x96, 0x65, 0x83, 0x42, 0x20, 0x72, - 0x48, 0x2f, 0x2e, 0xe0, 0x22, 0xa7, 0x9c, 0x14, 0xbb, 0x0e, 0xd4, 0x34, 0x08, 0xc0, 0xd8, 0x97, - 0x16, 0x2d, 0x40, 0x8b, 0x23, 0x66, 0x11, 0xfe, 0x85, 0xcb, 0x24, 0xf6, 0xa9, 0xc7, 0x9e, 0xfb, - 0x28, 0x7d, 0xb3, 0x3e, 0x42, 0xb1, 0xbb, 0x24, 0x77, 0xf9, 0xa3, 0x34, 0xa8, 0x1c, 0xe7, 0x24, - 0xce, 0x70, 0x35, 0x3b, 0xdf, 0xcc, 0x7c, 0x33, 0x43, 0x38, 0xdc, 0x64, 0x14, 0x63, 0xff, 0x7b, - 0xf9, 0x73, 0x9c, 0x66, 0x49, 0x9e, 0x90, 0x3d, 0x29, 0x39, 0xe7, 0x00, 0xa7, 0x49, 0x14, 0x25, - 0xb1, 0x8b, 0x2c, 0x25, 0xf7, 0x61, 0x84, 0x59, 0x96, 0x64, 0xa7, 0x89, 0x8f, 0x56, 0x6f, 0xd1, - 0x7b, 0x38, 0x70, 0x95, 0x82, 0xd8, 0x30, 0x14, 0xc2, 0x73, 0x16, 0x58, 0xc6, 0xa2, 0xf7, 0x70, - 0xe4, 0x56, 0xb2, 0xf3, 0x1b, 0xcc, 0x9f, 0x62, 0x7e, 0x2e, 0x8c, 0xb2, 0x55, 0xbc, 0x49, 0x5c, - 0x7c, 0x43, 0x66, 0x60, 0xbe, 0xa5, 0xbe, 0x30, 0x34, 0x72, 0xf9, 0x23, 0x59, 0xc0, 0xf8, 0x45, - 0x8a, 0x99, 0x97, 0xd3, 0x24, 0x5e, 0x9d, 0x15, 0x56, 0x74, 0x15, 0x39, 0x82, 0xc1, 0x45, 0xf2, - 0x1a, 0x63, 0xcb, 0x14, 0xef, 0xa4, 0xe0, 0x5c, 0x6b, 0xe6, 0xa5, 0xf5, 0x5d, 0xbc, 0x25, 0xdf, - 0x41, 0xff, 0xcc, 0xcb, 0x3d, 0x71, 0xc7, 0xf8, 0xe4, 0x8b, 0xe3, 0x22, 0x34, 0xd5, 0x15, 0xfc, - 0xa5, 0x2b, 0x8e, 0x38, 0x7f, 0x19, 0x70, 0x50, 0xd3, 0x77, 0xa0, 0x22, 0xd0, 0xa7, 0xeb, 0x24, - 0x2e, 0xae, 0x11, 0xcf, 0x5c, 0x17, 0x7b, 0x11, 0x16, 0x30, 0xc4, 0x33, 0xf9, 0x12, 0xf6, 0x02, - 0x8c, 0x7d, 0xcc, 0xac, 0xbe, 0xf0, 0xb6, 0x90, 0xb8, 0x3e, 0x4a, 0xae, 0x68, 0x88, 0xd6, 0x40, - 0x9c, 0x2e, 0x24, 0x1e, 0x8b, 0x2b, 0x9a, 0xe5, 0xaf, 0xac, 0x3d, 0x19, 0x0b, 0x21, 0x70, 0x2d, - 0x46, 0x1e, 0x0d, 0xad, 0x7d, 0xa9, 0x15, 0x02, 0xb9, 0x07, 0x06, 0x5e, 0x5b, 0x43, 0xa1, 0x32, - 0xf0, 0x9a, 0x58, 0xb0, 0xbf, 0x4e, 0xa2, 0x08, 0xe3, 0xdc, 0x1a, 0x09, 0x65, 0x29, 0xf2, 0xc0, - 0x50, 0x26, 0xf1, 0x58, 0x20, 0xfc, 0xa8, 0x64, 0xf2, 0x00, 0x0e, 0x28, 0x5b, 0xc5, 0x4f, 0x42, - 0x6f, 0xfd, 0xfa, 0x67, 0xca, 0x72, 0x6b, 0x2c, 0x0e, 0xd4, 0x95, 0xce, 0x35, 0x4c, 0x96, 0xbe, - 0x2f, 0xff, 0x72, 0xab, 0x79, 0x26, 0xdf, 0x02, 0xb8, 0xf8, 0xe6, 0x39, 0x32, 0xe6, 0x05, 0x28, - 0xa2, 0x34, 0x72, 0x35, 0x8d, 0xf3, 0x07, 0x4c, 0x57, 0x51, 0x9a, 0x64, 0xb9, 0xba, 0xdc, 0x82, - 0xfd, 0xb7, 0xd4, 0x17, 0xce, 0xf6, 0x16, 0x26, 0x07, 0x5a, 0x88, 0xff, 0xdb, 0x09, 0x1b, 0x86, - 0x2f, 0xde, 0xc7, 0x98, 0x5d, 0x52, 0xbf, 0x70, 0xa1, 0x92, 0x9d, 0x10, 0x66, 0x75, 0x07, 0x58, - 0x4a, 0x4e, 0x00, 0xd6, 0x15, 0x87, 0x44, 0x14, 0xc6, 0x27, 0xa4, 0xac, 0x29, 0xc5, 0x2e, 0x57, - 0x3b, 0xc5, 0x03, 0xbd, 0xf1, 0x68, 0x88, 0xfe, 0x65, 0xe1, 0xbb, 0x21, 0x7c, 0xaf, 0x2b, 0x9d, - 0x67, 0x5a, 0xd9, 0x2f, 0xd3, 0x34, 0xbc, 0xe1, 0x80, 0x1b, 0xb0, 0x7a, 0x1f, 0x80, 0x65, 0xe8, - 0x1c, 0xba, 0x01, 0xd2, 0x34, 0xb6, 0x2b, 0x89, 0x7c, 0x4e, 0xa2, 0xfe, 0xc2, 0xd4, 0x49, 0x24, - 0x4c, 0x5f, 0x32, 0xcc, 0x04, 0x4f, 0xc5, 0x11, 0xe7, 0x4f, 0x03, 0x0e, 0x6a, 0xfa, 0x6e, 0x12, - 0x09, 0xc2, 0x18, 0x1a, 0x61, 0x4a, 0x62, 0x99, 0x1a, 0xb1, 0xee, 0x92, 0x44, 0x04, 0xfa, 0x9b, - 0xd0, 0x0b, 0x04, 0x83, 0x06, 0xae, 0x78, 0xe6, 0x01, 0xf3, 0x38, 0x94, 0x0b, 0x1a, 0xa1, 0xe0, - 0xcf, 0xc8, 0x55, 0x0a, 0x5e, 0xc0, 0x99, 0x2a, 0xe0, 0xb1, 0x2c, 0x60, 0xa5, 0x71, 0x7e, 0x82, - 0x59, 0x50, 0x26, 0x81, 0xa7, 0x78, 0x97, 0x84, 0x32, 0x98, 0x37, 0x6c, 0xed, 0x94, 0xcf, 0x07, - 0x45, 0x3e, 0x4d, 0x91, 0xcf, 0x59, 0x99, 0xcf, 0x46, 0x2a, 0xff, 0xe9, 0xc1, 0xf0, 0x23, 0xb2, - 0x68, 0x76, 0x64, 0xd1, 0xf8, 0x4c, 0x59, 0xdc, 0xde, 0x0a, 0x5b, 0xed, 0x0e, 0xba, 0xda, 0xdd, - 0x7b, 0x98, 0x2e, 0x7d, 0x5f, 0xc8, 0x61, 0x91, 0xb2, 0xdb, 0xeb, 0x78, 0x1f, 0x6a, 0x36, 0xbf, - 0x03, 0x71, 0x31, 0x4a, 0xde, 0xe1, 0xa7, 0xb9, 0xdb, 0x59, 0xc1, 0xf4, 0x29, 0xe6, 0x35, 0xe3, - 0x1f, 0x55, 0x8b, 0xb9, 0x5e, 0x8b, 0x42, 0x70, 0x32, 0x98, 0xd5, 0x4d, 0xdd, 0x41, 0x29, 0x22, - 0x8c, 0x57, 0x4c, 0x0d, 0x82, 0xca, 0xb1, 0x9e, 0xe6, 0x98, 0x24, 0xe4, 0x1a, 0xe9, 0x3b, 0xe4, - 0x11, 0x36, 0x4a, 0x42, 0x96, 0x9a, 0x26, 0x60, 0xb3, 0x05, 0xd8, 0xf1, 0x61, 0xa2, 0xae, 0xd9, - 0x09, 0x96, 0x0d, 0x43, 0xf6, 0x8a, 0xa6, 0x17, 0x37, 0xa9, 0x24, 0xc8, 0xc0, 0xad, 0x64, 0x27, - 0x86, 0xd9, 0x4a, 0xaf, 0xba, 0x62, 0xb4, 0x31, 0x8c, 0xf9, 0x34, 0x28, 0x30, 0x95, 0xe2, 0x2d, - 0xa0, 0xa2, 0x30, 0x6f, 0xdc, 0xb7, 0x2b, 0xb4, 0x0c, 0x59, 0x9a, 0xc4, 0x4c, 0x42, 0x1b, 0xba, - 0x95, 0xec, 0xfc, 0x0a, 0xd3, 0x33, 0x0c, 0x31, 0xc7, 0x4f, 0xb0, 0x31, 0x38, 0x39, 0x1c, 0x69, - 0xbb, 0x88, 0xbc, 0xb1, 0xfb, 0x86, 0xb2, 0x99, 0x1b, 0x5a, 0x33, 0xff, 0xcf, 0x38, 0xa9, 0x5b, - 0xfb, 0xf5, 0x59, 0x7a, 0xf8, 0xb2, 0x6c, 0xbd, 0xa7, 0xb2, 0x99, 0x6c, 0x85, 0x95, 0xb4, 0x61, - 0x69, 0x2a, 0xbd, 0x3b, 0x99, 0xf5, 0xee, 0x54, 0x15, 0x74, 0x5f, 0x2b, 0xe8, 0x93, 0xbf, 0xf7, - 0xa1, 0x58, 0xde, 0xc9, 0x39, 0xdc, 0x0b, 0x6a, 0x4b, 0x37, 0xf9, 0xba, 0xb5, 0xca, 0x96, 0xcb, - 0xb8, 0xdd, 0x7e, 0x55, 0x2d, 0xd2, 0x8f, 0x60, 0xe4, 0x95, 0x31, 0x24, 0x47, 0xd5, 0x20, 0xd7, - 0x56, 0x3c, 0xbb, 0x63, 0x9f, 0x21, 0xcf, 0x80, 0x04, 0xb5, 0x85, 0x42, 0x6c, 0x5d, 0xed, 0x7b, - 0xca, 0xcd, 0xc5, 0xb6, 0xb7, 0xbd, 0x62, 0x29, 0x59, 0x89, 0xc1, 0xf8, 0x12, 0xc3, 0xcd, 0xce, - 0xa6, 0xce, 0xe0, 0xa0, 0x36, 0x17, 0x89, 0x55, 0x1e, 0x6e, 0x8e, 0x5e, 0x15, 0x94, 0xf6, 0x20, - 0x7d, 0x0c, 0x13, 0x4f, 0xeb, 0xfa, 0xe4, 0x2b, 0x2d, 0x2e, 0x7a, 0xcb, 0xec, 0x0c, 0xcd, 0x12, - 0xa6, 0x59, 0xbd, 0x73, 0x93, 0xca, 0xe3, 0x76, 0x4b, 0xef, 0x34, 0xf1, 0x48, 0xad, 0xe9, 0xe4, - 0xb0, 0x7c, 0xaf, 0xf5, 0x3b, 0xfb, 0xa8, 0xad, 0x94, 0xe0, 0x6b, 0xd3, 0x4b, 0x81, 0x6f, 0xb6, - 0x17, 0x05, 0xbe, 0xdd, 0x08, 0x96, 0x30, 0x09, 0xb4, 0x76, 0xae, 0xc0, 0x37, 0xe6, 0x85, 0x6d, - 0x75, 0xbf, 0x90, 0xf1, 0xf3, 0x35, 0xd6, 0x2b, 0x13, 0x8d, 0x5e, 0xd0, 0x09, 0xfe, 0x47, 0x98, - 0x7b, 0x4d, 0x56, 0x93, 0xfb, 0x1d, 0x95, 0x59, 0x11, 0xbe, 0xd3, 0xcc, 0x29, 0xcc, 0x58, 0x83, - 0xa6, 0xe4, 0x9b, 0xf2, 0x5c, 0x07, 0x81, 0xb7, 0xe4, 0x72, 0xa2, 0xaf, 0xfc, 0x0a, 0x48, 0xe3, - 0x4b, 0x44, 0xc5, 0xa2, 0xf9, 0x85, 0xf0, 0x64, 0xfe, 0xcb, 0xf4, 0xb8, 0xf8, 0xfe, 0x7e, 0x2c, - 0x7f, 0xae, 0xf6, 0xc4, 0x77, 0xf8, 0x0f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xf2, 0x29, - 0xc4, 0x9e, 0x0f, 0x00, 0x00, +var fileDescriptor_friend_74b4824fb8c5de90 = []byte{ + // 950 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x8f, 0xdb, 0x44, + 0x14, 0x96, 0x9b, 0x6e, 0x9a, 0xbc, 0xa4, 0x4d, 0x32, 0xc9, 0x96, 0xe0, 0xee, 0x56, 0xa9, 0x0f, + 0x28, 0xe2, 0x90, 0x48, 0x41, 0x95, 0x58, 0x0a, 0x85, 0x74, 0x93, 0xac, 0x0c, 0x6c, 0x53, 0xcd, + 0x96, 0x0b, 0x42, 0x8a, 0xdc, 0x7a, 0x36, 0x58, 0x71, 0xec, 0xa9, 0xc7, 0xdb, 0x15, 0x37, 0xc4, + 0x89, 0x03, 0x57, 0x24, 0x04, 0x07, 0xfe, 0x55, 0x64, 0x8f, 0x1d, 0xcf, 0xd8, 0xce, 0x0a, 0x9b, + 0x3d, 0x70, 0xda, 0x7d, 0xef, 0xcd, 0xf7, 0xf2, 0x7e, 0xcd, 0xfb, 0xc6, 0xd0, 0xbd, 0xf4, 0x2c, + 0xe2, 0x98, 0x63, 0xfe, 0x67, 0x44, 0x3d, 0xd7, 0x77, 0x51, 0x95, 0x4b, 0xea, 0x93, 0x25, 0x25, + 0xce, 0x4a, 0x3f, 0x1f, 0xd3, 0xcd, 0x7a, 0x1c, 0x9a, 0xc6, 0xcc, 0xdc, 0xac, 0xae, 0xd9, 0xf8, + 0x9a, 0xf1, 0xa3, 0xda, 0x73, 0x80, 0x53, 0x77, 0xbb, 0x75, 0x1d, 0x4c, 0x18, 0x45, 0x7d, 0xb8, + 0x47, 0x3c, 0xef, 0xd4, 0x35, 0x49, 0x5f, 0x19, 0x28, 0xc3, 0x03, 0x1c, 0x8b, 0xe8, 0x21, 0x54, + 0x89, 0xe7, 0x9d, 0xb3, 0x75, 0xff, 0xce, 0x40, 0x19, 0xd6, 0x71, 0x24, 0x69, 0xbf, 0x28, 0x50, + 0x0d, 0x1c, 0xe8, 0x33, 0xa4, 0x42, 0x6d, 0x49, 0xbf, 0x63, 0xc4, 0xd3, 0x67, 0x21, 0xba, 0x8e, + 0x77, 0x32, 0x1a, 0x40, 0x63, 0x49, 0x89, 0x67, 0xf8, 0x96, 0xeb, 0xe8, 0xb3, 0xc8, 0x87, 0xa8, + 0x0a, 0xd0, 0xaf, 0xdd, 0x08, 0x7d, 0x97, 0xa3, 0x63, 0x19, 0x3d, 0x06, 0x58, 0x78, 0xee, 0x36, + 0xb2, 0x1e, 0x84, 0x56, 0x41, 0xa3, 0x3d, 0x83, 0xce, 0x19, 0xf1, 0x17, 0x61, 0xd2, 0x4c, 0x77, + 0x2e, 0x5d, 0x4c, 0xde, 0xa1, 0x8f, 0xe2, 0xc0, 0xc2, 0x60, 0x1a, 0x93, 0x07, 0xa3, 0xa8, 0x46, + 0x5c, 0x8b, 0x23, 0xab, 0xf6, 0x9b, 0x22, 0xa0, 0x39, 0x98, 0x57, 0x62, 0x2e, 0x57, 0x62, 0x9e, + 0x54, 0x62, 0x2e, 0x55, 0x82, 0x4b, 0x68, 0x0e, 0x0f, 0x12, 0x1f, 0xdf, 0x5a, 0xcc, 0xef, 0x57, + 0x06, 0x95, 0x61, 0x63, 0x72, 0x3c, 0x62, 0xc4, 0x7b, 0x4f, 0xbc, 0x95, 0x41, 0xad, 0x15, 0x35, + 0x3c, 0x63, 0xcb, 0x46, 0xc2, 0x8f, 0xa5, 0x40, 0xda, 0x4b, 0x68, 0x4e, 0x4d, 0x93, 0x2b, 0x0b, + 0xa4, 0x11, 0x84, 0x85, 0xc9, 0x3b, 0x21, 0x2c, 0x2e, 0x69, 0xa7, 0x70, 0x5f, 0xf0, 0xc7, 0x28, + 0x9a, 0x88, 0x1d, 0x8f, 0x9c, 0x22, 0xd1, 0x29, 0xb7, 0x60, 0xe1, 0x94, 0xf6, 0x97, 0x02, 0x2d, + 0x7d, 0x4b, 0x5d, 0xcf, 0x4f, 0x02, 0xfb, 0x18, 0xda, 0x5c, 0xe0, 0x4d, 0x08, 0x33, 0x56, 0x06, + 0x95, 0x61, 0x1d, 0x67, 0xf4, 0xff, 0xa2, 0xfd, 0x72, 0x8b, 0x2b, 0xe9, 0x16, 0x4b, 0xc3, 0x75, + 0x57, 0x1e, 0x2e, 0xed, 0x39, 0x34, 0xf9, 0x7f, 0x98, 0xb0, 0x2b, 0xdb, 0x0f, 0x4a, 0x21, 0x8d, + 0x61, 0x24, 0xf1, 0x12, 0x05, 0x27, 0xc2, 0x00, 0x0e, 0x70, 0x24, 0x69, 0xbf, 0x2a, 0xd0, 0x96, + 0xb3, 0x2b, 0x57, 0x26, 0xf4, 0x15, 0xb4, 0xc5, 0x40, 0xc2, 0x92, 0xdc, 0x09, 0x87, 0xa0, 0x17, + 0x23, 0x45, 0x3b, 0xce, 0x9c, 0xd6, 0xbe, 0x84, 0xc3, 0xdd, 0x2c, 0x4e, 0x29, 0xb5, 0x7f, 0x0a, + 0xb4, 0x45, 0xa6, 0xf9, 0x4f, 0x05, 0x1e, 0xe6, 0x79, 0x28, 0x35, 0xd2, 0x2f, 0xa1, 0xb3, 0xeb, + 0xf7, 0x15, 0x61, 0xbe, 0x30, 0xd5, 0x83, 0xbd, 0x53, 0x1d, 0x9d, 0xc5, 0x59, 0xa8, 0xf6, 0x19, + 0xb4, 0x77, 0xb1, 0x15, 0x4d, 0x4c, 0xba, 0xa6, 0xff, 0x21, 0xa7, 0x5b, 0xba, 0xa6, 0x27, 0xd0, + 0x9a, 0x9a, 0xe6, 0x0b, 0xdb, 0x78, 0xbb, 0xb1, 0x0b, 0x66, 0xb2, 0x80, 0xb6, 0x0c, 0x2d, 0x79, + 0x29, 0x3f, 0x07, 0x84, 0xc9, 0xd6, 0x7d, 0x4f, 0x4a, 0x45, 0xa1, 0x43, 0x37, 0x83, 0x2e, 0x19, + 0xc8, 0x09, 0xb4, 0xce, 0x88, 0x5f, 0x2a, 0x8a, 0xdf, 0x95, 0x70, 0x24, 0xe4, 0x18, 0x8a, 0x37, + 0x75, 0x09, 0x9d, 0xd0, 0x45, 0x78, 0x9f, 0xe4, 0xbe, 0x3e, 0xc9, 0xe9, 0xeb, 0xab, 0xab, 0x37, + 0xb6, 0xf5, 0x36, 0x3e, 0x8c, 0xb3, 0x58, 0xed, 0x29, 0x34, 0x74, 0x56, 0x78, 0x09, 0x6b, 0x3f, + 0x40, 0x33, 0x81, 0x95, 0xca, 0x44, 0x85, 0x5a, 0x80, 0x74, 0x1d, 0x46, 0xc2, 0x2d, 0x58, 0xc3, + 0x3b, 0x39, 0xb8, 0x3e, 0x3a, 0xd3, 0x9d, 0x30, 0xda, 0xa2, 0xd7, 0xc7, 0x80, 0x4e, 0x0a, 0x7b, + 0xeb, 0xe1, 0x9d, 0x40, 0x6b, 0x46, 0x6c, 0xe2, 0x93, 0xe2, 0x75, 0x5b, 0x40, 0x5b, 0x86, 0x96, + 0x9c, 0xc4, 0x9f, 0x15, 0xe8, 0x49, 0x6c, 0x17, 0x04, 0x56, 0x84, 0x45, 0x35, 0x68, 0xfe, 0x68, + 0x38, 0xa6, 0x4d, 0x24, 0xa2, 0x90, 0x74, 0xe8, 0x08, 0xea, 0x5c, 0x0e, 0xca, 0xc3, 0x99, 0x2a, + 0x51, 0x68, 0xdf, 0xc0, 0x61, 0x4e, 0x04, 0x25, 0xf3, 0x79, 0x0d, 0xe8, 0x82, 0xec, 0x58, 0x69, + 0x6b, 0x78, 0x9b, 0xc2, 0x4f, 0x82, 0x00, 0x94, 0x3c, 0x09, 0x02, 0x29, 0xb8, 0xfa, 0x19, 0xaf, + 0x25, 0x03, 0xfc, 0x02, 0xba, 0x67, 0xc4, 0xbf, 0x20, 0xf6, 0x65, 0x29, 0xb6, 0xfa, 0x43, 0x81, + 0x5e, 0x16, 0xff, 0x7f, 0xe0, 0xaa, 0xc9, 0xdf, 0xf7, 0x20, 0x7a, 0x46, 0xa3, 0x4f, 0xa1, 0x6e, + 0xc4, 0x2d, 0x45, 0x3b, 0x26, 0x17, 0x5f, 0x69, 0xea, 0x61, 0x8e, 0x96, 0x51, 0x74, 0x01, 0x68, + 0x9d, 0x21, 0x63, 0x74, 0x1c, 0x1f, 0xce, 0xa5, 0x7a, 0xf5, 0xf1, 0x4d, 0x66, 0x46, 0xd1, 0x39, + 0xb4, 0xd7, 0xa9, 0x9a, 0xa1, 0x47, 0x02, 0x26, 0xdd, 0x0d, 0xf5, 0x68, 0xbf, 0x91, 0x51, 0x34, + 0x83, 0xfb, 0x6b, 0x91, 0x57, 0x51, 0x3f, 0xf3, 0xfb, 0xb1, 0xa3, 0x0f, 0xf7, 0x58, 0x18, 0x45, + 0x53, 0x68, 0x1a, 0x02, 0xa9, 0xa1, 0x0f, 0x84, 0x82, 0x88, 0xcc, 0xa0, 0xf6, 0xf3, 0x0d, 0x8c, + 0xa2, 0xaf, 0xa1, 0xe5, 0xc9, 0x8c, 0x84, 0xd4, 0xf8, 0x70, 0x96, 0xe8, 0xd4, 0x47, 0x7b, 0x6d, + 0x8c, 0xa2, 0xa7, 0x50, 0xb3, 0xa2, 0x45, 0x8c, 0xba, 0xf1, 0x41, 0x61, 0xa3, 0xab, 0xbd, 0xac, + 0x92, 0xd7, 0xc2, 0x12, 0xb7, 0x64, 0x52, 0x8b, 0xf4, 0xe2, 0x4d, 0x6a, 0x91, 0x5d, 0xab, 0x53, + 0x68, 0xae, 0x05, 0x4e, 0x4b, 0x6a, 0x91, 0x62, 0x49, 0xb5, 0x9f, 0x6f, 0xe0, 0x2e, 0x4c, 0x61, + 0x21, 0x26, 0x2e, 0x52, 0x1b, 0x36, 0x71, 0x91, 0xd9, 0x9f, 0xaf, 0xa0, 0x63, 0xa4, 0x17, 0x11, + 0x3a, 0xca, 0x9d, 0xd3, 0x68, 0x4b, 0xaa, 0xc7, 0x37, 0x58, 0x79, 0x83, 0x98, 0xbc, 0x37, 0x92, + 0x06, 0x65, 0xd7, 0x54, 0xd2, 0xa0, 0xbc, 0x65, 0x33, 0x85, 0xa6, 0x25, 0x3c, 0xb9, 0x93, 0x04, + 0x53, 0x9f, 0x19, 0x49, 0x82, 0xe9, 0x17, 0xfa, 0x8b, 0xce, 0xf7, 0xad, 0x51, 0xf4, 0xdd, 0xfb, + 0x8c, 0xff, 0x79, 0x53, 0x0d, 0x3f, 0x6a, 0x3f, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 0x26, 0xd5, + 0xdf, 0x90, 0x16, 0x0f, 0x00, 0x00, } diff --git a/pkg/proto/friend/friend.proto b/pkg/proto/friend/friend.proto index 52b50d277..0050582d1 100644 --- a/pkg/proto/friend/friend.proto +++ b/pkg/proto/friend/friend.proto @@ -1,183 +1,169 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; option go_package = "./friend;friend"; package friend; message CommonResp{ - int32 errorCode = 1; - string errorMsg = 2; + int32 errCode = 1; + string errMsg = 2; } +message CommID{ + string OpUserID = 1; + string OperationID = 2; + string ToUserID = 4; + string FromUserID = 5; +} + + message GetFriendsInfoReq{ - string uid = 1; - string OperationID = 2; - string Token = 3; + CommID CommID = 1; } message GetFriendInfoResp{ - int32 errorCode = 1; - string errorMsg = 2; - GetFriendData Data = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendInfo FriendInfoList = 3; +// int32 IsBlack = 4; } -message GetFriendData{ - string uid = 1; - string icon = 2; - string name = 3; - int32 gender = 4; - string mobile = 5; - string birth = 6; - string email = 7; - string ex = 8; - string comment = 9; - int32 isFriend = 10; - int32 isInBlackList = 11; -} message AddFriendReq{ - string uid = 1; - string OperationID = 2; - string Token = 3; - string ReqMessage = 4; + CommID CommID = 1; + string ReqMsg = 2; +} +message AddFriendResp{ + CommonResp CommonResp = 1; } message ImportFriendReq{ - repeated string uidList = 1; + repeated string FriendUserIDList = 1; string OperationID = 2; - string Token = 3; - string OwnerUid = 4; + string FromUserID = 3; + string OpUserID = 4; +} +message UserIDResult{ + string UserID = 1; + int32 Result = 2; } message ImportFriendResp{ - CommonResp commonResp = 1; - repeated string failedUidList = 2; -} - -message GetFriendApplyReq{ - string OperationID = 1; - string Token = 2; -} -message GetFriendApplyResp{ - int32 errorCode = 1; - string errorMsg = 2; - repeated ApplyUserInfo data = 4; -} - -message ApplyUserInfo{ - string uid = 1; - string name = 2; - string icon = 3; - int32 gender = 4; - string mobile = 5; - string birth = 6; - string email = 7; - string ex = 8; - int32 flag = 9; - string applyTime = 10; - string reqMessage = 11; + CommonResp CommonResp = 1; + repeated UserIDResult UserIDResultList = 2; } -message getFriendListReq{ - string OperationID = 1; - string Token = 2; +message GetFriendApplyListReq{ + CommID CommID = 1; } -message getFriendListResp{ - int32 errorCode = 1; - string errorMsg = 2; - repeated UserInfo data = 3; +message GetFriendApplyListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendRequest FriendRequestList = 3; } -message UserInfo{ - string uid = 1; - string name = 3; - string icon = 2; - int32 gender = 4; - string mobile = 5; - string birth = 6; - string email = 7; - string ex = 8; - string comment = 9; - int32 isInBlackList = 10; + + +message GetFriendListReq{ + CommID CommID = 1; } +message GetFriendListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendInfo FriendInfoList = 3; +} + message AddBlacklistReq{ - string uid = 1; - string OperationID = 2; - string Token = 3; - string OwnerUid = 4; + CommID CommID = 1; +} +message AddBlacklistResp{ + CommonResp CommonResp = 1; } message RemoveBlacklistReq{ - string uid = 1; - string OperationID = 2; - string Token = 3; + CommID CommID = 1; +} +message RemoveBlacklistResp{ + CommonResp CommonResp = 1; } - message GetBlacklistReq{ - string OperationID = 1; - string token = 2; + CommID CommID = 1; } message GetBlacklistResp{ - int32 errorCode = 1; - string errorMsg = 2; - repeated UserInfo data = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.PublicUserInfo BlackUserInfoList = 3; } + message IsFriendReq{ - string token = 1; - string receiveUid = 2; - string OperationID = 3; + CommID CommID = 1; } message IsFriendResp{ - int32 errorCode = 1; - string errorMsg = 2; - int32 shipType = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + bool Response = 3; } + + message IsInBlackListReq{ - string sendUid = 1; - string receiveUid = 2; - string OperationID = 3; + CommID CommID = 1; } message IsInBlackListResp{ - int32 errorCode = 1; - string errorMsg = 2; - bool response = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + bool Response = 3; } + message DeleteFriendReq{ - string uid = 1; - string OperationID = 2; - string Token = 3; + CommID CommID = 1; +} +message DeleteFriendResp{ + CommonResp CommonResp = 1; } - +//process message AddFriendResponseReq{ - string uid = 1; - int32 flag = 2; - string OperationID = 3; - string Token = 4; + CommID CommID = 1; + int32 handleResult = 2; + string handleMsg = 3; +} +message AddFriendResponseResp{ + CommonResp CommonResp = 1; } -message SetFriendCommentReq{ - string uid = 1; - string operationID = 2; - string comment = 3; - string token = 4; +message SetFriendRemarkReq{ + CommID CommID = 1; + string Remark = 2; +} +message SetFriendRemarkResp{ + CommonResp CommonResp = 1; +} + +message GetSelfApplyListReq{ + CommID CommID = 1; +} +message GetSelfApplyListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendRequest FriendRequestList = 3; } service friend{ - rpc getFriendsInfo(GetFriendsInfoReq) returns(GetFriendInfoResp); - rpc addFriend(AddFriendReq) returns(CommonResp); - rpc getFriendApplyList(GetFriendApplyReq) returns(GetFriendApplyResp); - rpc getSelfApplyList(GetFriendApplyReq) returns(GetFriendApplyResp); - rpc getFriendList(getFriendListReq) returns(getFriendListResp); - rpc addBlacklist(AddBlacklistReq) returns(CommonResp); - rpc removeBlacklist(RemoveBlacklistReq) returns(CommonResp); + // rpc getFriendsInfo(GetFriendsInfoReq) returns(GetFriendInfoResp); + rpc addFriend(AddFriendReq) returns(AddFriendResp); + rpc getFriendApplyList(GetFriendApplyListReq) returns(GetFriendApplyListResp); + rpc getSelfApplyList(GetSelfApplyListReq) returns(GetSelfApplyListResp); + rpc getFriendList(GetFriendListReq) returns(GetFriendListResp); + rpc addBlacklist(AddBlacklistReq) returns(AddBlacklistResp); + rpc removeBlacklist(RemoveBlacklistReq) returns(RemoveBlacklistResp); rpc isFriend(IsFriendReq) returns(IsFriendResp); rpc isInBlackList(IsInBlackListReq) returns(IsInBlackListResp); rpc getBlacklist(GetBlacklistReq) returns(GetBlacklistResp); - rpc deleteFriend(DeleteFriendReq) returns(CommonResp); - rpc addFriendResponse(AddFriendResponseReq) returns(CommonResp); - rpc setFriendComment(SetFriendCommentReq) returns(CommonResp); - rpc ImportFriend(ImportFriendReq) returns(ImportFriendResp); + rpc deleteFriend(DeleteFriendReq) returns(DeleteFriendResp); + rpc addFriendResponse(AddFriendResponseReq) returns(AddFriendResponseResp); + rpc setFriendRemark(SetFriendRemarkReq) returns(SetFriendRemarkResp); + rpc importFriend(ImportFriendReq) returns(ImportFriendResp); } \ No newline at end of file diff --git a/pkg/proto/group/group.pb.go b/pkg/proto/group/group.pb.go index fae312019..d6dc9ccd9 100644 --- a/pkg/proto/group/group.pb.go +++ b/pkg/proto/group/group.pb.go @@ -1,2358 +1,4700 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.15.5 // source: group/group.proto -package group // import "./group" - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +package group import ( - context "golang.org/x/net/context" + sdk_ws "Open_IM/pkg/proto/sdk_ws" + context "context" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type CommonResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=ErrorCode" json:"ErrorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=ErrorMsg" json:"ErrorMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` } -func (m *CommonResp) Reset() { *m = CommonResp{} } -func (m *CommonResp) String() string { return proto.CompactTextString(m) } -func (*CommonResp) ProtoMessage() {} +func (x *CommonResp) Reset() { + *x = CommonResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommonResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResp) ProtoMessage() {} + +func (x *CommonResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonResp.ProtoReflect.Descriptor instead. func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{0} -} -func (m *CommonResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommonResp.Unmarshal(m, b) -} -func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) -} -func (dst *CommonResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommonResp.Merge(dst, src) -} -func (m *CommonResp) XXX_Size() int { - return xxx_messageInfo_CommonResp.Size(m) -} -func (m *CommonResp) XXX_DiscardUnknown() { - xxx_messageInfo_CommonResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{0} } -var xxx_messageInfo_CommonResp proto.InternalMessageInfo - -func (m *CommonResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *CommonResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *CommonResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg - } - return "" -} - -type CreateGroupReq struct { - MemberList []*GroupAddMemberInfo `protobuf:"bytes,1,rep,name=memberList" json:"memberList,omitempty"` - GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` - Introduction string `protobuf:"bytes,3,opt,name=introduction" json:"introduction,omitempty"` - Notification string `protobuf:"bytes,4,opt,name=notification" json:"notification,omitempty"` - FaceUrl string `protobuf:"bytes,5,opt,name=faceUrl" json:"faceUrl,omitempty"` - Token string `protobuf:"bytes,6,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,7,opt,name=operationID" json:"operationID,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CreateGroupReq) Reset() { *m = CreateGroupReq{} } -func (m *CreateGroupReq) String() string { return proto.CompactTextString(m) } -func (*CreateGroupReq) ProtoMessage() {} -func (*CreateGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{1} -} -func (m *CreateGroupReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateGroupReq.Unmarshal(m, b) -} -func (m *CreateGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateGroupReq.Marshal(b, m, deterministic) -} -func (dst *CreateGroupReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateGroupReq.Merge(dst, src) -} -func (m *CreateGroupReq) XXX_Size() int { - return xxx_messageInfo_CreateGroupReq.Size(m) -} -func (m *CreateGroupReq) XXX_DiscardUnknown() { - xxx_messageInfo_CreateGroupReq.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateGroupReq proto.InternalMessageInfo - -func (m *CreateGroupReq) GetMemberList() []*GroupAddMemberInfo { - if m != nil { - return m.MemberList - } - return nil -} - -func (m *CreateGroupReq) GetGroupName() string { - if m != nil { - return m.GroupName - } - return "" -} - -func (m *CreateGroupReq) GetIntroduction() string { - if m != nil { - return m.Introduction - } - return "" -} - -func (m *CreateGroupReq) GetNotification() string { - if m != nil { - return m.Notification - } - return "" -} - -func (m *CreateGroupReq) GetFaceUrl() string { - if m != nil { - return m.FaceUrl - } - return "" -} - -func (m *CreateGroupReq) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *CreateGroupReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *CreateGroupReq) GetEx() string { - if m != nil { - return m.Ex +func (x *CommonResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg } return "" } type GroupAddMemberInfo struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - SetRole int32 `protobuf:"varint,2,opt,name=setRole" json:"setRole,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"` + RoleLevel int32 `protobuf:"varint,2,opt,name=RoleLevel,proto3" json:"RoleLevel,omitempty"` } -func (m *GroupAddMemberInfo) Reset() { *m = GroupAddMemberInfo{} } -func (m *GroupAddMemberInfo) String() string { return proto.CompactTextString(m) } -func (*GroupAddMemberInfo) ProtoMessage() {} +func (x *GroupAddMemberInfo) Reset() { + *x = GroupAddMemberInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupAddMemberInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupAddMemberInfo) ProtoMessage() {} + +func (x *GroupAddMemberInfo) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupAddMemberInfo.ProtoReflect.Descriptor instead. func (*GroupAddMemberInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{2} -} -func (m *GroupAddMemberInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupAddMemberInfo.Unmarshal(m, b) -} -func (m *GroupAddMemberInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupAddMemberInfo.Marshal(b, m, deterministic) -} -func (dst *GroupAddMemberInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupAddMemberInfo.Merge(dst, src) -} -func (m *GroupAddMemberInfo) XXX_Size() int { - return xxx_messageInfo_GroupAddMemberInfo.Size(m) -} -func (m *GroupAddMemberInfo) XXX_DiscardUnknown() { - xxx_messageInfo_GroupAddMemberInfo.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{1} } -var xxx_messageInfo_GroupAddMemberInfo proto.InternalMessageInfo - -func (m *GroupAddMemberInfo) GetUid() string { - if m != nil { - return m.Uid +func (x *GroupAddMemberInfo) GetUserID() string { + if x != nil { + return x.UserID } return "" } -func (m *GroupAddMemberInfo) GetSetRole() int32 { - if m != nil { - return m.SetRole +func (x *GroupAddMemberInfo) GetRoleLevel() int32 { + if x != nil { + return x.RoleLevel } return 0 } -type CreateGroupResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=ErrorCode" json:"ErrorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=ErrorMsg" json:"ErrorMsg,omitempty"` - GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type CreateGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InitMemberList []*GroupAddMemberInfo `protobuf:"bytes,1,rep,name=InitMemberList,proto3" json:"InitMemberList,omitempty"` + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,2,opt,name=GroupInfo,proto3" json:"GroupInfo,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,4,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //app manager or group owner + OwnerUserID string `protobuf:"bytes,5,opt,name=OwnerUserID,proto3" json:"OwnerUserID,omitempty"` //owner } -func (m *CreateGroupResp) Reset() { *m = CreateGroupResp{} } -func (m *CreateGroupResp) String() string { return proto.CompactTextString(m) } -func (*CreateGroupResp) ProtoMessage() {} -func (*CreateGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{3} -} -func (m *CreateGroupResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CreateGroupResp.Unmarshal(m, b) -} -func (m *CreateGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CreateGroupResp.Marshal(b, m, deterministic) -} -func (dst *CreateGroupResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CreateGroupResp.Merge(dst, src) -} -func (m *CreateGroupResp) XXX_Size() int { - return xxx_messageInfo_CreateGroupResp.Size(m) -} -func (m *CreateGroupResp) XXX_DiscardUnknown() { - xxx_messageInfo_CreateGroupResp.DiscardUnknown(m) -} - -var xxx_messageInfo_CreateGroupResp proto.InternalMessageInfo - -func (m *CreateGroupResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *CreateGroupReq) Reset() { + *x = CreateGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 } -func (m *CreateGroupResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *CreateGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateGroupReq) ProtoMessage() {} + +func (x *CreateGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (m *CreateGroupResp) GetGroupID() string { - if m != nil { - return m.GroupID - } - return "" +// Deprecated: Use CreateGroupReq.ProtoReflect.Descriptor instead. +func (*CreateGroupReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{2} } -type GetGroupsInfoReq struct { - GroupIDList []string `protobuf:"bytes,1,rep,name=groupIDList" json:"groupIDList,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetGroupsInfoReq) Reset() { *m = GetGroupsInfoReq{} } -func (m *GetGroupsInfoReq) String() string { return proto.CompactTextString(m) } -func (*GetGroupsInfoReq) ProtoMessage() {} -func (*GetGroupsInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{4} -} -func (m *GetGroupsInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupsInfoReq.Unmarshal(m, b) -} -func (m *GetGroupsInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupsInfoReq.Marshal(b, m, deterministic) -} -func (dst *GetGroupsInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupsInfoReq.Merge(dst, src) -} -func (m *GetGroupsInfoReq) XXX_Size() int { - return xxx_messageInfo_GetGroupsInfoReq.Size(m) -} -func (m *GetGroupsInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupsInfoReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetGroupsInfoReq proto.InternalMessageInfo - -func (m *GetGroupsInfoReq) GetGroupIDList() []string { - if m != nil { - return m.GroupIDList +func (x *CreateGroupReq) GetInitMemberList() []*GroupAddMemberInfo { + if x != nil { + return x.InitMemberList } return nil } -func (m *GetGroupsInfoReq) GetToken() string { - if m != nil { - return m.Token +func (x *CreateGroupReq) GetGroupInfo() *sdk_ws.GroupInfo { + if x != nil { + return x.GroupInfo + } + return nil +} + +func (x *CreateGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *GetGroupsInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *CreateGroupReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *CreateGroupReq) GetOwnerUserID() string { + if x != nil { + return x.OwnerUserID + } + return "" +} + +type CreateGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,3,opt,name=GroupInfo,proto3" json:"GroupInfo,omitempty"` +} + +func (x *CreateGroupResp) Reset() { + *x = CreateGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateGroupResp) ProtoMessage() {} + +func (x *CreateGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateGroupResp.ProtoReflect.Descriptor instead. +func (*CreateGroupResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateGroupResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode + } + return 0 +} + +func (x *CreateGroupResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +func (x *CreateGroupResp) GetGroupInfo() *sdk_ws.GroupInfo { + if x != nil { + return x.GroupInfo + } + return nil +} + +type GetGroupsInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupIDList []string `protobuf:"bytes,1,rep,name=GroupIDList,proto3" json:"GroupIDList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //No verification permission +} + +func (x *GetGroupsInfoReq) Reset() { + *x = GetGroupsInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupsInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupsInfoReq) ProtoMessage() {} + +func (x *GetGroupsInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupsInfoReq.ProtoReflect.Descriptor instead. +func (*GetGroupsInfoReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{4} +} + +func (x *GetGroupsInfoReq) GetGroupIDList() []string { + if x != nil { + return x.GroupIDList + } + return nil +} + +func (x *GetGroupsInfoReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *GetGroupsInfoReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } type GetGroupsInfoResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=ErrorCode" json:"ErrorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=ErrorMsg" json:"ErrorMsg,omitempty"` - Data []*GroupInfo `protobuf:"bytes,3,rep,name=data" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + GroupInfoList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupInfoList,proto3" json:"GroupInfoList,omitempty"` } -func (m *GetGroupsInfoResp) Reset() { *m = GetGroupsInfoResp{} } -func (m *GetGroupsInfoResp) String() string { return proto.CompactTextString(m) } -func (*GetGroupsInfoResp) ProtoMessage() {} +func (x *GetGroupsInfoResp) Reset() { + *x = GetGroupsInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupsInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupsInfoResp) ProtoMessage() {} + +func (x *GetGroupsInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupsInfoResp.ProtoReflect.Descriptor instead. func (*GetGroupsInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{5} -} -func (m *GetGroupsInfoResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupsInfoResp.Unmarshal(m, b) -} -func (m *GetGroupsInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupsInfoResp.Marshal(b, m, deterministic) -} -func (dst *GetGroupsInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupsInfoResp.Merge(dst, src) -} -func (m *GetGroupsInfoResp) XXX_Size() int { - return xxx_messageInfo_GetGroupsInfoResp.Size(m) -} -func (m *GetGroupsInfoResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupsInfoResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{5} } -var xxx_messageInfo_GetGroupsInfoResp proto.InternalMessageInfo - -func (m *GetGroupsInfoResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *GetGroupsInfoResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *GetGroupsInfoResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *GetGroupsInfoResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg } return "" } -func (m *GetGroupsInfoResp) GetData() []*GroupInfo { - if m != nil { - return m.Data +func (x *GetGroupsInfoResp) GetGroupInfoList() []*sdk_ws.GroupInfo { + if x != nil { + return x.GroupInfoList } return nil } type SetGroupInfoReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` - Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"` - Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"` - FaceUrl string `protobuf:"bytes,5,opt,name=faceUrl" json:"faceUrl,omitempty"` - Token string `protobuf:"bytes,6,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,7,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,1,opt,name=GroupInfo,proto3" json:"GroupInfo,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //app manager or group owner + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` } -func (m *SetGroupInfoReq) Reset() { *m = SetGroupInfoReq{} } -func (m *SetGroupInfoReq) String() string { return proto.CompactTextString(m) } -func (*SetGroupInfoReq) ProtoMessage() {} +func (x *SetGroupInfoReq) Reset() { + *x = SetGroupInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetGroupInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetGroupInfoReq) ProtoMessage() {} + +func (x *SetGroupInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetGroupInfoReq.ProtoReflect.Descriptor instead. func (*SetGroupInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{6} -} -func (m *SetGroupInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetGroupInfoReq.Unmarshal(m, b) -} -func (m *SetGroupInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetGroupInfoReq.Marshal(b, m, deterministic) -} -func (dst *SetGroupInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetGroupInfoReq.Merge(dst, src) -} -func (m *SetGroupInfoReq) XXX_Size() int { - return xxx_messageInfo_SetGroupInfoReq.Size(m) -} -func (m *SetGroupInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_SetGroupInfoReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{6} } -var xxx_messageInfo_SetGroupInfoReq proto.InternalMessageInfo - -func (m *SetGroupInfoReq) GetGroupID() string { - if m != nil { - return m.GroupID - } - return "" -} - -func (m *SetGroupInfoReq) GetGroupName() string { - if m != nil { - return m.GroupName - } - return "" -} - -func (m *SetGroupInfoReq) GetNotification() string { - if m != nil { - return m.Notification - } - return "" -} - -func (m *SetGroupInfoReq) GetIntroduction() string { - if m != nil { - return m.Introduction - } - return "" -} - -func (m *SetGroupInfoReq) GetFaceUrl() string { - if m != nil { - return m.FaceUrl - } - return "" -} - -func (m *SetGroupInfoReq) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *SetGroupInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetGroupApplicationListReq struct { - UID string `protobuf:"bytes,1,opt,name=UID" json:"UID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetGroupApplicationListReq) Reset() { *m = GetGroupApplicationListReq{} } -func (m *GetGroupApplicationListReq) String() string { return proto.CompactTextString(m) } -func (*GetGroupApplicationListReq) ProtoMessage() {} -func (*GetGroupApplicationListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{7} -} -func (m *GetGroupApplicationListReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupApplicationListReq.Unmarshal(m, b) -} -func (m *GetGroupApplicationListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupApplicationListReq.Marshal(b, m, deterministic) -} -func (dst *GetGroupApplicationListReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupApplicationListReq.Merge(dst, src) -} -func (m *GetGroupApplicationListReq) XXX_Size() int { - return xxx_messageInfo_GetGroupApplicationListReq.Size(m) -} -func (m *GetGroupApplicationListReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupApplicationListReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetGroupApplicationListReq proto.InternalMessageInfo - -func (m *GetGroupApplicationListReq) GetUID() string { - if m != nil { - return m.UID - } - return "" -} - -func (m *GetGroupApplicationListReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetGroupApplicationList_Data_User struct { - ID string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"` - GroupID string `protobuf:"bytes,2,opt,name=GroupID" json:"GroupID,omitempty"` - FromUserID string `protobuf:"bytes,3,opt,name=FromUserID" json:"FromUserID,omitempty"` - ToUserID string `protobuf:"bytes,4,opt,name=ToUserID" json:"ToUserID,omitempty"` - Flag int32 `protobuf:"varint,5,opt,name=Flag" json:"Flag,omitempty"` - RequestMsg string `protobuf:"bytes,6,opt,name=RequestMsg" json:"RequestMsg,omitempty"` - HandledMsg string `protobuf:"bytes,7,opt,name=HandledMsg" json:"HandledMsg,omitempty"` - AddTime int64 `protobuf:"varint,8,opt,name=AddTime" json:"AddTime,omitempty"` - FromUserNickname string `protobuf:"bytes,9,opt,name=FromUserNickname" json:"FromUserNickname,omitempty"` - ToUserNickname string `protobuf:"bytes,10,opt,name=ToUserNickname" json:"ToUserNickname,omitempty"` - FromUserFaceUrl string `protobuf:"bytes,11,opt,name=FromUserFaceUrl" json:"FromUserFaceUrl,omitempty"` - ToUserFaceUrl string `protobuf:"bytes,12,opt,name=ToUserFaceUrl" json:"ToUserFaceUrl,omitempty"` - HandledUser string `protobuf:"bytes,13,opt,name=HandledUser" json:"HandledUser,omitempty"` - Type int32 `protobuf:"varint,14,opt,name=Type" json:"Type,omitempty"` - HandleStatus int32 `protobuf:"varint,15,opt,name=HandleStatus" json:"HandleStatus,omitempty"` - HandleResult int32 `protobuf:"varint,16,opt,name=HandleResult" json:"HandleResult,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetGroupApplicationList_Data_User) Reset() { *m = GetGroupApplicationList_Data_User{} } -func (m *GetGroupApplicationList_Data_User) String() string { return proto.CompactTextString(m) } -func (*GetGroupApplicationList_Data_User) ProtoMessage() {} -func (*GetGroupApplicationList_Data_User) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{8} -} -func (m *GetGroupApplicationList_Data_User) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupApplicationList_Data_User.Unmarshal(m, b) -} -func (m *GetGroupApplicationList_Data_User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupApplicationList_Data_User.Marshal(b, m, deterministic) -} -func (dst *GetGroupApplicationList_Data_User) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupApplicationList_Data_User.Merge(dst, src) -} -func (m *GetGroupApplicationList_Data_User) XXX_Size() int { - return xxx_messageInfo_GetGroupApplicationList_Data_User.Size(m) -} -func (m *GetGroupApplicationList_Data_User) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupApplicationList_Data_User.DiscardUnknown(m) -} - -var xxx_messageInfo_GetGroupApplicationList_Data_User proto.InternalMessageInfo - -func (m *GetGroupApplicationList_Data_User) GetID() string { - if m != nil { - return m.ID - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetGroupID() string { - if m != nil { - return m.GroupID - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetFromUserID() string { - if m != nil { - return m.FromUserID - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetToUserID() string { - if m != nil { - return m.ToUserID - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetFlag() int32 { - if m != nil { - return m.Flag - } - return 0 -} - -func (m *GetGroupApplicationList_Data_User) GetRequestMsg() string { - if m != nil { - return m.RequestMsg - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetHandledMsg() string { - if m != nil { - return m.HandledMsg - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetAddTime() int64 { - if m != nil { - return m.AddTime - } - return 0 -} - -func (m *GetGroupApplicationList_Data_User) GetFromUserNickname() string { - if m != nil { - return m.FromUserNickname - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetToUserNickname() string { - if m != nil { - return m.ToUserNickname - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetFromUserFaceUrl() string { - if m != nil { - return m.FromUserFaceUrl - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetToUserFaceUrl() string { - if m != nil { - return m.ToUserFaceUrl - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetHandledUser() string { - if m != nil { - return m.HandledUser - } - return "" -} - -func (m *GetGroupApplicationList_Data_User) GetType() int32 { - if m != nil { - return m.Type - } - return 0 -} - -func (m *GetGroupApplicationList_Data_User) GetHandleStatus() int32 { - if m != nil { - return m.HandleStatus - } - return 0 -} - -func (m *GetGroupApplicationList_Data_User) GetHandleResult() int32 { - if m != nil { - return m.HandleResult - } - return 0 -} - -type GetGroupApplicationListData struct { - Count int32 `protobuf:"varint,1,opt,name=Count" json:"Count,omitempty"` - User []*GetGroupApplicationList_Data_User `protobuf:"bytes,2,rep,name=User" json:"User,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetGroupApplicationListData) Reset() { *m = GetGroupApplicationListData{} } -func (m *GetGroupApplicationListData) String() string { return proto.CompactTextString(m) } -func (*GetGroupApplicationListData) ProtoMessage() {} -func (*GetGroupApplicationListData) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{9} -} -func (m *GetGroupApplicationListData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupApplicationListData.Unmarshal(m, b) -} -func (m *GetGroupApplicationListData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupApplicationListData.Marshal(b, m, deterministic) -} -func (dst *GetGroupApplicationListData) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupApplicationListData.Merge(dst, src) -} -func (m *GetGroupApplicationListData) XXX_Size() int { - return xxx_messageInfo_GetGroupApplicationListData.Size(m) -} -func (m *GetGroupApplicationListData) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupApplicationListData.DiscardUnknown(m) -} - -var xxx_messageInfo_GetGroupApplicationListData proto.InternalMessageInfo - -func (m *GetGroupApplicationListData) GetCount() int32 { - if m != nil { - return m.Count - } - return 0 -} - -func (m *GetGroupApplicationListData) GetUser() []*GetGroupApplicationList_Data_User { - if m != nil { - return m.User +func (x *SetGroupInfoReq) GetGroupInfo() *sdk_ws.GroupInfo { + if x != nil { + return x.GroupInfo } return nil } -type GetGroupApplicationListResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - Data *GetGroupApplicationListData `protobuf:"bytes,3,opt,name=Data" json:"Data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetGroupApplicationListResp) Reset() { *m = GetGroupApplicationListResp{} } -func (m *GetGroupApplicationListResp) String() string { return proto.CompactTextString(m) } -func (*GetGroupApplicationListResp) ProtoMessage() {} -func (*GetGroupApplicationListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{10} -} -func (m *GetGroupApplicationListResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupApplicationListResp.Unmarshal(m, b) -} -func (m *GetGroupApplicationListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupApplicationListResp.Marshal(b, m, deterministic) -} -func (dst *GetGroupApplicationListResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupApplicationListResp.Merge(dst, src) -} -func (m *GetGroupApplicationListResp) XXX_Size() int { - return xxx_messageInfo_GetGroupApplicationListResp.Size(m) -} -func (m *GetGroupApplicationListResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupApplicationListResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetGroupApplicationListResp proto.InternalMessageInfo - -func (m *GetGroupApplicationListResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *GetGroupApplicationListResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg +func (x *SetGroupInfoReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *GetGroupApplicationListResp) GetData() *GetGroupApplicationListData { - if m != nil { - return m.Data +func (x *SetGroupInfoReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type SetGroupInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` +} + +func (x *SetGroupInfoResp) Reset() { + *x = SetGroupInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetGroupInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetGroupInfoResp) ProtoMessage() {} + +func (x *SetGroupInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetGroupInfoResp.ProtoReflect.Descriptor instead. +func (*SetGroupInfoResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{7} +} + +func (x *SetGroupInfoResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +type GetGroupApplicationListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //app manager or group owner(manager) + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + FromUserID string `protobuf:"bytes,3,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` //owner or manager +} + +func (x *GetGroupApplicationListReq) Reset() { + *x = GetGroupApplicationListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupApplicationListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupApplicationListReq) ProtoMessage() {} + +func (x *GetGroupApplicationListReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupApplicationListReq.ProtoReflect.Descriptor instead. +func (*GetGroupApplicationListReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{8} +} + +func (x *GetGroupApplicationListReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *GetGroupApplicationListReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *GetGroupApplicationListReq) GetFromUserID() string { + if x != nil { + return x.FromUserID + } + return "" +} + +type GetGroupApplicationListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + GroupRequestList []*sdk_ws.GroupRequest `protobuf:"bytes,3,rep,name=GroupRequestList,proto3" json:"GroupRequestList,omitempty"` +} + +func (x *GetGroupApplicationListResp) Reset() { + *x = GetGroupApplicationListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupApplicationListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupApplicationListResp) ProtoMessage() {} + +func (x *GetGroupApplicationListResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupApplicationListResp.ProtoReflect.Descriptor instead. +func (*GetGroupApplicationListResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{9} +} + +func (x *GetGroupApplicationListResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode + } + return 0 +} + +func (x *GetGroupApplicationListResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +func (x *GetGroupApplicationListResp) GetGroupRequestList() []*sdk_ws.GroupRequest { + if x != nil { + return x.GroupRequestList + } + return nil +} + +type GetUserReqApplicationListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetUserReqApplicationListReq) Reset() { + *x = GetUserReqApplicationListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserReqApplicationListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserReqApplicationListReq) ProtoMessage() {} + +func (x *GetUserReqApplicationListReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserReqApplicationListReq.ProtoReflect.Descriptor instead. +func (*GetUserReqApplicationListReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{10} +} + +func (x *GetUserReqApplicationListReq) GetUserID() string { + if x != nil { + return x.UserID + } + return "" +} + +func (x *GetUserReqApplicationListReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *GetUserReqApplicationListReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetUserReqApplicationListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + GroupRequestList []*sdk_ws.GroupRequest `protobuf:"bytes,2,rep,name=GroupRequestList,proto3" json:"GroupRequestList,omitempty"` +} + +func (x *GetUserReqApplicationListResp) Reset() { + *x = GetUserReqApplicationListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserReqApplicationListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserReqApplicationListResp) ProtoMessage() {} + +func (x *GetUserReqApplicationListResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserReqApplicationListResp.ProtoReflect.Descriptor instead. +func (*GetUserReqApplicationListResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{11} +} + +func (x *GetUserReqApplicationListResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *GetUserReqApplicationListResp) GetGroupRequestList() []*sdk_ws.GroupRequest { + if x != nil { + return x.GroupRequestList } return nil } type TransferGroupOwnerReq struct { - GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` - OldOwner string `protobuf:"bytes,2,opt,name=OldOwner" json:"OldOwner,omitempty"` - NewOwner string `protobuf:"bytes,3,opt,name=NewOwner" json:"NewOwner,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + OldOwnerUserID string `protobuf:"bytes,2,opt,name=OldOwnerUserID,proto3" json:"OldOwnerUserID,omitempty"` + NewOwnerUserID string `protobuf:"bytes,3,opt,name=NewOwnerUserID,proto3" json:"NewOwnerUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,5,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //app manager or group owner } -func (m *TransferGroupOwnerReq) Reset() { *m = TransferGroupOwnerReq{} } -func (m *TransferGroupOwnerReq) String() string { return proto.CompactTextString(m) } -func (*TransferGroupOwnerReq) ProtoMessage() {} +func (x *TransferGroupOwnerReq) Reset() { + *x = TransferGroupOwnerReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferGroupOwnerReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferGroupOwnerReq) ProtoMessage() {} + +func (x *TransferGroupOwnerReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferGroupOwnerReq.ProtoReflect.Descriptor instead. func (*TransferGroupOwnerReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{11} -} -func (m *TransferGroupOwnerReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TransferGroupOwnerReq.Unmarshal(m, b) -} -func (m *TransferGroupOwnerReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TransferGroupOwnerReq.Marshal(b, m, deterministic) -} -func (dst *TransferGroupOwnerReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransferGroupOwnerReq.Merge(dst, src) -} -func (m *TransferGroupOwnerReq) XXX_Size() int { - return xxx_messageInfo_TransferGroupOwnerReq.Size(m) -} -func (m *TransferGroupOwnerReq) XXX_DiscardUnknown() { - xxx_messageInfo_TransferGroupOwnerReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{12} } -var xxx_messageInfo_TransferGroupOwnerReq proto.InternalMessageInfo - -func (m *TransferGroupOwnerReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *TransferGroupOwnerReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *TransferGroupOwnerReq) GetOldOwner() string { - if m != nil { - return m.OldOwner +func (x *TransferGroupOwnerReq) GetOldOwnerUserID() string { + if x != nil { + return x.OldOwnerUserID } return "" } -func (m *TransferGroupOwnerReq) GetNewOwner() string { - if m != nil { - return m.NewOwner +func (x *TransferGroupOwnerReq) GetNewOwnerUserID() string { + if x != nil { + return x.NewOwnerUserID } return "" } -func (m *TransferGroupOwnerReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *TransferGroupOwnerReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *TransferGroupOwnerReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } type TransferGroupOwnerResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` } -func (m *TransferGroupOwnerResp) Reset() { *m = TransferGroupOwnerResp{} } -func (m *TransferGroupOwnerResp) String() string { return proto.CompactTextString(m) } -func (*TransferGroupOwnerResp) ProtoMessage() {} +func (x *TransferGroupOwnerResp) Reset() { + *x = TransferGroupOwnerResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransferGroupOwnerResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferGroupOwnerResp) ProtoMessage() {} + +func (x *TransferGroupOwnerResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferGroupOwnerResp.ProtoReflect.Descriptor instead. func (*TransferGroupOwnerResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{12} -} -func (m *TransferGroupOwnerResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TransferGroupOwnerResp.Unmarshal(m, b) -} -func (m *TransferGroupOwnerResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TransferGroupOwnerResp.Marshal(b, m, deterministic) -} -func (dst *TransferGroupOwnerResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransferGroupOwnerResp.Merge(dst, src) -} -func (m *TransferGroupOwnerResp) XXX_Size() int { - return xxx_messageInfo_TransferGroupOwnerResp.Size(m) -} -func (m *TransferGroupOwnerResp) XXX_DiscardUnknown() { - xxx_messageInfo_TransferGroupOwnerResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{13} } -var xxx_messageInfo_TransferGroupOwnerResp proto.InternalMessageInfo - -func (m *TransferGroupOwnerResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode +func (x *TransferGroupOwnerResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp } - return 0 -} - -func (m *TransferGroupOwnerResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" + return nil } type JoinGroupReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - Token string `protobuf:"bytes,3,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + ReqMessage string `protobuf:"bytes,2,opt,name=ReqMessage,proto3" json:"ReqMessage,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` } -func (m *JoinGroupReq) Reset() { *m = JoinGroupReq{} } -func (m *JoinGroupReq) String() string { return proto.CompactTextString(m) } -func (*JoinGroupReq) ProtoMessage() {} +func (x *JoinGroupReq) Reset() { + *x = JoinGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JoinGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JoinGroupReq) ProtoMessage() {} + +func (x *JoinGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use JoinGroupReq.ProtoReflect.Descriptor instead. func (*JoinGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{13} -} -func (m *JoinGroupReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JoinGroupReq.Unmarshal(m, b) -} -func (m *JoinGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JoinGroupReq.Marshal(b, m, deterministic) -} -func (dst *JoinGroupReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinGroupReq.Merge(dst, src) -} -func (m *JoinGroupReq) XXX_Size() int { - return xxx_messageInfo_JoinGroupReq.Size(m) -} -func (m *JoinGroupReq) XXX_DiscardUnknown() { - xxx_messageInfo_JoinGroupReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{14} } -var xxx_messageInfo_JoinGroupReq proto.InternalMessageInfo - -func (m *JoinGroupReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *JoinGroupReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *JoinGroupReq) GetMessage() string { - if m != nil { - return m.Message +func (x *JoinGroupReq) GetReqMessage() string { + if x != nil { + return x.ReqMessage } return "" } -func (m *JoinGroupReq) GetToken() string { - if m != nil { - return m.Token +func (x *JoinGroupReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *JoinGroupReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *JoinGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } +type JoinGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` +} + +func (x *JoinGroupResp) Reset() { + *x = JoinGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JoinGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JoinGroupResp) ProtoMessage() {} + +func (x *JoinGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use JoinGroupResp.ProtoReflect.Descriptor instead. +func (*JoinGroupResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{15} +} + +func (x *JoinGroupResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + type GroupApplicationResponseReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` - OwnerID string `protobuf:"bytes,2,opt,name=OwnerID" json:"OwnerID,omitempty"` - GroupID string `protobuf:"bytes,3,opt,name=GroupID" json:"GroupID,omitempty"` - FromUserID string `protobuf:"bytes,4,opt,name=FromUserID" json:"FromUserID,omitempty"` - FromUserNickName string `protobuf:"bytes,5,opt,name=FromUserNickName" json:"FromUserNickName,omitempty"` - FromUserFaceUrl string `protobuf:"bytes,6,opt,name=FromUserFaceUrl" json:"FromUserFaceUrl,omitempty"` - ToUserID string `protobuf:"bytes,7,opt,name=ToUserID" json:"ToUserID,omitempty"` - ToUserNickName string `protobuf:"bytes,8,opt,name=ToUserNickName" json:"ToUserNickName,omitempty"` - ToUserFaceUrl string `protobuf:"bytes,9,opt,name=ToUserFaceUrl" json:"ToUserFaceUrl,omitempty"` - AddTime int64 `protobuf:"varint,10,opt,name=AddTime" json:"AddTime,omitempty"` - RequestMsg string `protobuf:"bytes,11,opt,name=RequestMsg" json:"RequestMsg,omitempty"` - HandledMsg string `protobuf:"bytes,12,opt,name=HandledMsg" json:"HandledMsg,omitempty"` - Type int32 `protobuf:"varint,13,opt,name=Type" json:"Type,omitempty"` - HandleStatus int32 `protobuf:"varint,14,opt,name=HandleStatus" json:"HandleStatus,omitempty"` - HandleResult int32 `protobuf:"varint,15,opt,name=HandleResult" json:"HandleResult,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + FromUserID string `protobuf:"bytes,4,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` // + HandledMsg string `protobuf:"bytes,5,opt,name=HandledMsg,proto3" json:"HandledMsg,omitempty"` + HandleResult int32 `protobuf:"varint,6,opt,name=HandleResult,proto3" json:"HandleResult,omitempty"` } -func (m *GroupApplicationResponseReq) Reset() { *m = GroupApplicationResponseReq{} } -func (m *GroupApplicationResponseReq) String() string { return proto.CompactTextString(m) } -func (*GroupApplicationResponseReq) ProtoMessage() {} +func (x *GroupApplicationResponseReq) Reset() { + *x = GroupApplicationResponseReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupApplicationResponseReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupApplicationResponseReq) ProtoMessage() {} + +func (x *GroupApplicationResponseReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupApplicationResponseReq.ProtoReflect.Descriptor instead. func (*GroupApplicationResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{14} -} -func (m *GroupApplicationResponseReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupApplicationResponseReq.Unmarshal(m, b) -} -func (m *GroupApplicationResponseReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupApplicationResponseReq.Marshal(b, m, deterministic) -} -func (dst *GroupApplicationResponseReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupApplicationResponseReq.Merge(dst, src) -} -func (m *GroupApplicationResponseReq) XXX_Size() int { - return xxx_messageInfo_GroupApplicationResponseReq.Size(m) -} -func (m *GroupApplicationResponseReq) XXX_DiscardUnknown() { - xxx_messageInfo_GroupApplicationResponseReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{16} } -var xxx_messageInfo_GroupApplicationResponseReq proto.InternalMessageInfo - -func (m *GroupApplicationResponseReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *GroupApplicationResponseReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *GroupApplicationResponseReq) GetOwnerID() string { - if m != nil { - return m.OwnerID +func (x *GroupApplicationResponseReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *GroupApplicationResponseReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *GroupApplicationResponseReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *GroupApplicationResponseReq) GetFromUserID() string { - if m != nil { - return m.FromUserID +func (x *GroupApplicationResponseReq) GetFromUserID() string { + if x != nil { + return x.FromUserID } return "" } -func (m *GroupApplicationResponseReq) GetFromUserNickName() string { - if m != nil { - return m.FromUserNickName +func (x *GroupApplicationResponseReq) GetHandledMsg() string { + if x != nil { + return x.HandledMsg } return "" } -func (m *GroupApplicationResponseReq) GetFromUserFaceUrl() string { - if m != nil { - return m.FromUserFaceUrl - } - return "" -} - -func (m *GroupApplicationResponseReq) GetToUserID() string { - if m != nil { - return m.ToUserID - } - return "" -} - -func (m *GroupApplicationResponseReq) GetToUserNickName() string { - if m != nil { - return m.ToUserNickName - } - return "" -} - -func (m *GroupApplicationResponseReq) GetToUserFaceUrl() string { - if m != nil { - return m.ToUserFaceUrl - } - return "" -} - -func (m *GroupApplicationResponseReq) GetAddTime() int64 { - if m != nil { - return m.AddTime - } - return 0 -} - -func (m *GroupApplicationResponseReq) GetRequestMsg() string { - if m != nil { - return m.RequestMsg - } - return "" -} - -func (m *GroupApplicationResponseReq) GetHandledMsg() string { - if m != nil { - return m.HandledMsg - } - return "" -} - -func (m *GroupApplicationResponseReq) GetType() int32 { - if m != nil { - return m.Type - } - return 0 -} - -func (m *GroupApplicationResponseReq) GetHandleStatus() int32 { - if m != nil { - return m.HandleStatus - } - return 0 -} - -func (m *GroupApplicationResponseReq) GetHandleResult() int32 { - if m != nil { - return m.HandleResult +func (x *GroupApplicationResponseReq) GetHandleResult() int32 { + if x != nil { + return x.HandleResult } return 0 } type GroupApplicationResponseResp struct { - ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` } -func (m *GroupApplicationResponseResp) Reset() { *m = GroupApplicationResponseResp{} } -func (m *GroupApplicationResponseResp) String() string { return proto.CompactTextString(m) } -func (*GroupApplicationResponseResp) ProtoMessage() {} +func (x *GroupApplicationResponseResp) Reset() { + *x = GroupApplicationResponseResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupApplicationResponseResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupApplicationResponseResp) ProtoMessage() {} + +func (x *GroupApplicationResponseResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupApplicationResponseResp.ProtoReflect.Descriptor instead. func (*GroupApplicationResponseResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{15} -} -func (m *GroupApplicationResponseResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupApplicationResponseResp.Unmarshal(m, b) -} -func (m *GroupApplicationResponseResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupApplicationResponseResp.Marshal(b, m, deterministic) -} -func (dst *GroupApplicationResponseResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupApplicationResponseResp.Merge(dst, src) -} -func (m *GroupApplicationResponseResp) XXX_Size() int { - return xxx_messageInfo_GroupApplicationResponseResp.Size(m) -} -func (m *GroupApplicationResponseResp) XXX_DiscardUnknown() { - xxx_messageInfo_GroupApplicationResponseResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{17} } -var xxx_messageInfo_GroupApplicationResponseResp proto.InternalMessageInfo - -func (m *GroupApplicationResponseResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode +func (x *GroupApplicationResponseResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp } - return 0 -} - -func (m *GroupApplicationResponseResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -type SetOwnerGroupNickNameReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - NickName string `protobuf:"bytes,2,opt,name=nickName" json:"nickName,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,4,opt,name=token" json:"token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SetOwnerGroupNickNameReq) Reset() { *m = SetOwnerGroupNickNameReq{} } -func (m *SetOwnerGroupNickNameReq) String() string { return proto.CompactTextString(m) } -func (*SetOwnerGroupNickNameReq) ProtoMessage() {} -func (*SetOwnerGroupNickNameReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{16} -} -func (m *SetOwnerGroupNickNameReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SetOwnerGroupNickNameReq.Unmarshal(m, b) -} -func (m *SetOwnerGroupNickNameReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SetOwnerGroupNickNameReq.Marshal(b, m, deterministic) -} -func (dst *SetOwnerGroupNickNameReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_SetOwnerGroupNickNameReq.Merge(dst, src) -} -func (m *SetOwnerGroupNickNameReq) XXX_Size() int { - return xxx_messageInfo_SetOwnerGroupNickNameReq.Size(m) -} -func (m *SetOwnerGroupNickNameReq) XXX_DiscardUnknown() { - xxx_messageInfo_SetOwnerGroupNickNameReq.DiscardUnknown(m) -} - -var xxx_messageInfo_SetOwnerGroupNickNameReq proto.InternalMessageInfo - -func (m *SetOwnerGroupNickNameReq) GetGroupID() string { - if m != nil { - return m.GroupID - } - return "" -} - -func (m *SetOwnerGroupNickNameReq) GetNickName() string { - if m != nil { - return m.NickName - } - return "" -} - -func (m *SetOwnerGroupNickNameReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *SetOwnerGroupNickNameReq) GetToken() string { - if m != nil { - return m.Token - } - return "" + return nil } type QuitGroupReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - Token string `protobuf:"bytes,3,opt,name=token" json:"token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` } -func (m *QuitGroupReq) Reset() { *m = QuitGroupReq{} } -func (m *QuitGroupReq) String() string { return proto.CompactTextString(m) } -func (*QuitGroupReq) ProtoMessage() {} +func (x *QuitGroupReq) Reset() { + *x = QuitGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuitGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuitGroupReq) ProtoMessage() {} + +func (x *QuitGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuitGroupReq.ProtoReflect.Descriptor instead. func (*QuitGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{17} -} -func (m *QuitGroupReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QuitGroupReq.Unmarshal(m, b) -} -func (m *QuitGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QuitGroupReq.Marshal(b, m, deterministic) -} -func (dst *QuitGroupReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuitGroupReq.Merge(dst, src) -} -func (m *QuitGroupReq) XXX_Size() int { - return xxx_messageInfo_QuitGroupReq.Size(m) -} -func (m *QuitGroupReq) XXX_DiscardUnknown() { - xxx_messageInfo_QuitGroupReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{18} } -var xxx_messageInfo_QuitGroupReq proto.InternalMessageInfo - -func (m *QuitGroupReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *QuitGroupReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *QuitGroupReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *QuitGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *QuitGroupReq) GetToken() string { - if m != nil { - return m.Token +func (x *QuitGroupReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -type GroupApplicationUserInfo struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - Uid string `protobuf:"bytes,2,opt,name=uid" json:"uid,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` - Icon string `protobuf:"bytes,4,opt,name=icon" json:"icon,omitempty"` - ReqMsg string `protobuf:"bytes,5,opt,name=reqMsg" json:"reqMsg,omitempty"` - ApplicationTime int64 `protobuf:"varint,6,opt,name=applicationTime" json:"applicationTime,omitempty"` - Flag int32 `protobuf:"varint,7,opt,name=flag" json:"flag,omitempty"` - OperatorID string `protobuf:"bytes,8,opt,name=operatorID" json:"operatorID,omitempty"` - HandledMsg string `protobuf:"bytes,9,opt,name=handledMsg" json:"handledMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type QuitGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` } -func (m *GroupApplicationUserInfo) Reset() { *m = GroupApplicationUserInfo{} } -func (m *GroupApplicationUserInfo) String() string { return proto.CompactTextString(m) } -func (*GroupApplicationUserInfo) ProtoMessage() {} -func (*GroupApplicationUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{18} -} -func (m *GroupApplicationUserInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupApplicationUserInfo.Unmarshal(m, b) -} -func (m *GroupApplicationUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupApplicationUserInfo.Marshal(b, m, deterministic) -} -func (dst *GroupApplicationUserInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupApplicationUserInfo.Merge(dst, src) -} -func (m *GroupApplicationUserInfo) XXX_Size() int { - return xxx_messageInfo_GroupApplicationUserInfo.Size(m) -} -func (m *GroupApplicationUserInfo) XXX_DiscardUnknown() { - xxx_messageInfo_GroupApplicationUserInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupApplicationUserInfo proto.InternalMessageInfo - -func (m *GroupApplicationUserInfo) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *QuitGroupResp) Reset() { + *x = QuitGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return "" } -func (m *GroupApplicationUserInfo) GetUid() string { - if m != nil { - return m.Uid +func (x *QuitGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuitGroupResp) ProtoMessage() {} + +func (x *QuitGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (m *GroupApplicationUserInfo) GetName() string { - if m != nil { - return m.Name +// Deprecated: Use QuitGroupResp.ProtoReflect.Descriptor instead. +func (*QuitGroupResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{19} +} + +func (x *QuitGroupResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp } - return "" -} - -func (m *GroupApplicationUserInfo) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *GroupApplicationUserInfo) GetReqMsg() string { - if m != nil { - return m.ReqMsg - } - return "" -} - -func (m *GroupApplicationUserInfo) GetApplicationTime() int64 { - if m != nil { - return m.ApplicationTime - } - return 0 -} - -func (m *GroupApplicationUserInfo) GetFlag() int32 { - if m != nil { - return m.Flag - } - return 0 -} - -func (m *GroupApplicationUserInfo) GetOperatorID() string { - if m != nil { - return m.OperatorID - } - return "" -} - -func (m *GroupApplicationUserInfo) GetHandledMsg() string { - if m != nil { - return m.HandledMsg - } - return "" -} - -type GroupMemberFullInfo struct { - UserId string `protobuf:"bytes,1,opt,name=userId" json:"userId,omitempty"` - Role int32 `protobuf:"varint,2,opt,name=role" json:"role,omitempty"` - JoinTime uint64 `protobuf:"varint,3,opt,name=joinTime" json:"joinTime,omitempty"` - NickName string `protobuf:"bytes,4,opt,name=nickName" json:"nickName,omitempty"` - FaceUrl string `protobuf:"bytes,5,opt,name=faceUrl" json:"faceUrl,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GroupMemberFullInfo) Reset() { *m = GroupMemberFullInfo{} } -func (m *GroupMemberFullInfo) String() string { return proto.CompactTextString(m) } -func (*GroupMemberFullInfo) ProtoMessage() {} -func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{19} -} -func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) -} -func (m *GroupMemberFullInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupMemberFullInfo.Marshal(b, m, deterministic) -} -func (dst *GroupMemberFullInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupMemberFullInfo.Merge(dst, src) -} -func (m *GroupMemberFullInfo) XXX_Size() int { - return xxx_messageInfo_GroupMemberFullInfo.Size(m) -} -func (m *GroupMemberFullInfo) XXX_DiscardUnknown() { - xxx_messageInfo_GroupMemberFullInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupMemberFullInfo proto.InternalMessageInfo - -func (m *GroupMemberFullInfo) GetUserId() string { - if m != nil { - return m.UserId - } - return "" -} - -func (m *GroupMemberFullInfo) GetRole() int32 { - if m != nil { - return m.Role - } - return 0 -} - -func (m *GroupMemberFullInfo) GetJoinTime() uint64 { - if m != nil { - return m.JoinTime - } - return 0 -} - -func (m *GroupMemberFullInfo) GetNickName() string { - if m != nil { - return m.NickName - } - return "" -} - -func (m *GroupMemberFullInfo) GetFaceUrl() string { - if m != nil { - return m.FaceUrl - } - return "" + return nil } type GetGroupMemberListReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - Filter int32 `protobuf:"varint,4,opt,name=filter" json:"filter,omitempty"` - NextSeq int32 `protobuf:"varint,5,opt,name=nextSeq" json:"nextSeq,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //No verification permission + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + Filter int32 `protobuf:"varint,4,opt,name=Filter,proto3" json:"Filter,omitempty"` + NextSeq int32 `protobuf:"varint,5,opt,name=NextSeq,proto3" json:"NextSeq,omitempty"` } -func (m *GetGroupMemberListReq) Reset() { *m = GetGroupMemberListReq{} } -func (m *GetGroupMemberListReq) String() string { return proto.CompactTextString(m) } -func (*GetGroupMemberListReq) ProtoMessage() {} +func (x *GetGroupMemberListReq) Reset() { + *x = GetGroupMemberListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupMemberListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupMemberListReq) ProtoMessage() {} + +func (x *GetGroupMemberListReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupMemberListReq.ProtoReflect.Descriptor instead. func (*GetGroupMemberListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{20} -} -func (m *GetGroupMemberListReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupMemberListReq.Unmarshal(m, b) -} -func (m *GetGroupMemberListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupMemberListReq.Marshal(b, m, deterministic) -} -func (dst *GetGroupMemberListReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupMemberListReq.Merge(dst, src) -} -func (m *GetGroupMemberListReq) XXX_Size() int { - return xxx_messageInfo_GetGroupMemberListReq.Size(m) -} -func (m *GetGroupMemberListReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupMemberListReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{20} } -var xxx_messageInfo_GetGroupMemberListReq proto.InternalMessageInfo - -func (m *GetGroupMemberListReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *GetGroupMemberListReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *GetGroupMemberListReq) GetToken() string { - if m != nil { - return m.Token +func (x *GetGroupMemberListReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *GetGroupMemberListReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *GetGroupMemberListReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *GetGroupMemberListReq) GetFilter() int32 { - if m != nil { - return m.Filter +func (x *GetGroupMemberListReq) GetFilter() int32 { + if x != nil { + return x.Filter } return 0 } -func (m *GetGroupMemberListReq) GetNextSeq() int32 { - if m != nil { - return m.NextSeq +func (x *GetGroupMemberListReq) GetNextSeq() int32 { + if x != nil { + return x.NextSeq } return 0 } type GetGroupMemberListResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - MemberList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` - NextSeq int32 `protobuf:"varint,4,opt,name=nextSeq" json:"nextSeq,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + MemberList []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList,proto3" json:"memberList,omitempty"` + NextSeq int32 `protobuf:"varint,4,opt,name=nextSeq,proto3" json:"nextSeq,omitempty"` } -func (m *GetGroupMemberListResp) Reset() { *m = GetGroupMemberListResp{} } -func (m *GetGroupMemberListResp) String() string { return proto.CompactTextString(m) } -func (*GetGroupMemberListResp) ProtoMessage() {} +func (x *GetGroupMemberListResp) Reset() { + *x = GetGroupMemberListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupMemberListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupMemberListResp) ProtoMessage() {} + +func (x *GetGroupMemberListResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupMemberListResp.ProtoReflect.Descriptor instead. func (*GetGroupMemberListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{21} -} -func (m *GetGroupMemberListResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupMemberListResp.Unmarshal(m, b) -} -func (m *GetGroupMemberListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupMemberListResp.Marshal(b, m, deterministic) -} -func (dst *GetGroupMemberListResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupMemberListResp.Merge(dst, src) -} -func (m *GetGroupMemberListResp) XXX_Size() int { - return xxx_messageInfo_GetGroupMemberListResp.Size(m) -} -func (m *GetGroupMemberListResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupMemberListResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{21} } -var xxx_messageInfo_GetGroupMemberListResp proto.InternalMessageInfo - -func (m *GetGroupMemberListResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *GetGroupMemberListResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *GetGroupMemberListResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *GetGroupMemberListResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg } return "" } -func (m *GetGroupMemberListResp) GetMemberList() []*GroupMemberFullInfo { - if m != nil { - return m.MemberList +func (x *GetGroupMemberListResp) GetMemberList() []*sdk_ws.GroupMemberFullInfo { + if x != nil { + return x.MemberList } return nil } -func (m *GetGroupMemberListResp) GetNextSeq() int32 { - if m != nil { - return m.NextSeq +func (x *GetGroupMemberListResp) GetNextSeq() int32 { + if x != nil { + return x.NextSeq } return 0 } type GetGroupMembersInfoReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - MemberList []string `protobuf:"bytes,2,rep,name=memberList" json:"memberList,omitempty"` - Token string `protobuf:"bytes,3,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + MemberList []string `protobuf:"bytes,2,rep,name=memberList,proto3" json:"memberList,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //No verification permission + OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` } -func (m *GetGroupMembersInfoReq) Reset() { *m = GetGroupMembersInfoReq{} } -func (m *GetGroupMembersInfoReq) String() string { return proto.CompactTextString(m) } -func (*GetGroupMembersInfoReq) ProtoMessage() {} +func (x *GetGroupMembersInfoReq) Reset() { + *x = GetGroupMembersInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupMembersInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupMembersInfoReq) ProtoMessage() {} + +func (x *GetGroupMembersInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupMembersInfoReq.ProtoReflect.Descriptor instead. func (*GetGroupMembersInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{22} -} -func (m *GetGroupMembersInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupMembersInfoReq.Unmarshal(m, b) -} -func (m *GetGroupMembersInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupMembersInfoReq.Marshal(b, m, deterministic) -} -func (dst *GetGroupMembersInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupMembersInfoReq.Merge(dst, src) -} -func (m *GetGroupMembersInfoReq) XXX_Size() int { - return xxx_messageInfo_GetGroupMembersInfoReq.Size(m) -} -func (m *GetGroupMembersInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupMembersInfoReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{22} } -var xxx_messageInfo_GetGroupMembersInfoReq proto.InternalMessageInfo - -func (m *GetGroupMembersInfoReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *GetGroupMembersInfoReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *GetGroupMembersInfoReq) GetMemberList() []string { - if m != nil { - return m.MemberList +func (x *GetGroupMembersInfoReq) GetMemberList() []string { + if x != nil { + return x.MemberList } return nil } -func (m *GetGroupMembersInfoReq) GetToken() string { - if m != nil { - return m.Token +func (x *GetGroupMembersInfoReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *GetGroupMembersInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *GetGroupMembersInfoReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } type GetGroupMembersInfoResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - MemberList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + MemberList []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList,proto3" json:"memberList,omitempty"` } -func (m *GetGroupMembersInfoResp) Reset() { *m = GetGroupMembersInfoResp{} } -func (m *GetGroupMembersInfoResp) String() string { return proto.CompactTextString(m) } -func (*GetGroupMembersInfoResp) ProtoMessage() {} +func (x *GetGroupMembersInfoResp) Reset() { + *x = GetGroupMembersInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupMembersInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupMembersInfoResp) ProtoMessage() {} + +func (x *GetGroupMembersInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupMembersInfoResp.ProtoReflect.Descriptor instead. func (*GetGroupMembersInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{23} -} -func (m *GetGroupMembersInfoResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupMembersInfoResp.Unmarshal(m, b) -} -func (m *GetGroupMembersInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupMembersInfoResp.Marshal(b, m, deterministic) -} -func (dst *GetGroupMembersInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupMembersInfoResp.Merge(dst, src) -} -func (m *GetGroupMembersInfoResp) XXX_Size() int { - return xxx_messageInfo_GetGroupMembersInfoResp.Size(m) -} -func (m *GetGroupMembersInfoResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupMembersInfoResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{23} } -var xxx_messageInfo_GetGroupMembersInfoResp proto.InternalMessageInfo - -func (m *GetGroupMembersInfoResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *GetGroupMembersInfoResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *GetGroupMembersInfoResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *GetGroupMembersInfoResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg } return "" } -func (m *GetGroupMembersInfoResp) GetMemberList() []*GroupMemberFullInfo { - if m != nil { - return m.MemberList +func (x *GetGroupMembersInfoResp) GetMemberList() []*sdk_ws.GroupMemberFullInfo { + if x != nil { + return x.MemberList } return nil } type KickGroupMemberReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - UidListInfo []*GroupMemberFullInfo `protobuf:"bytes,2,rep,name=uidListInfo" json:"uidListInfo,omitempty"` - Reason string `protobuf:"bytes,3,opt,name=reason" json:"reason,omitempty"` - Token string `protobuf:"bytes,4,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,5,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + KickedUserIDList []string `protobuf:"bytes,2,rep,name=KickedUserIDList,proto3" json:"KickedUserIDList,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=Reason,proto3" json:"Reason,omitempty"` + OperationID string `protobuf:"bytes,5,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,6,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //app manger or group manager } -func (m *KickGroupMemberReq) Reset() { *m = KickGroupMemberReq{} } -func (m *KickGroupMemberReq) String() string { return proto.CompactTextString(m) } -func (*KickGroupMemberReq) ProtoMessage() {} +func (x *KickGroupMemberReq) Reset() { + *x = KickGroupMemberReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KickGroupMemberReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KickGroupMemberReq) ProtoMessage() {} + +func (x *KickGroupMemberReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KickGroupMemberReq.ProtoReflect.Descriptor instead. func (*KickGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{24} -} -func (m *KickGroupMemberReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KickGroupMemberReq.Unmarshal(m, b) -} -func (m *KickGroupMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KickGroupMemberReq.Marshal(b, m, deterministic) -} -func (dst *KickGroupMemberReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_KickGroupMemberReq.Merge(dst, src) -} -func (m *KickGroupMemberReq) XXX_Size() int { - return xxx_messageInfo_KickGroupMemberReq.Size(m) -} -func (m *KickGroupMemberReq) XXX_DiscardUnknown() { - xxx_messageInfo_KickGroupMemberReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{24} } -var xxx_messageInfo_KickGroupMemberReq proto.InternalMessageInfo - -func (m *KickGroupMemberReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *KickGroupMemberReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *KickGroupMemberReq) GetUidListInfo() []*GroupMemberFullInfo { - if m != nil { - return m.UidListInfo +func (x *KickGroupMemberReq) GetKickedUserIDList() []string { + if x != nil { + return x.KickedUserIDList } return nil } -func (m *KickGroupMemberReq) GetReason() string { - if m != nil { - return m.Reason +func (x *KickGroupMemberReq) GetReason() string { + if x != nil { + return x.Reason } return "" } -func (m *KickGroupMemberReq) GetToken() string { - if m != nil { - return m.Token +func (x *KickGroupMemberReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *KickGroupMemberReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *KickGroupMemberReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } type Id2Result struct { - UId string `protobuf:"bytes,1,opt,name=uId" json:"uId,omitempty"` - Result int32 `protobuf:"varint,2,opt,name=result" json:"result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"` + Result int32 `protobuf:"varint,2,opt,name=Result,proto3" json:"Result,omitempty"` //0 ok; -1 error } -func (m *Id2Result) Reset() { *m = Id2Result{} } -func (m *Id2Result) String() string { return proto.CompactTextString(m) } -func (*Id2Result) ProtoMessage() {} +func (x *Id2Result) Reset() { + *x = Id2Result{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Id2Result) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Id2Result) ProtoMessage() {} + +func (x *Id2Result) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Id2Result.ProtoReflect.Descriptor instead. func (*Id2Result) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{25} -} -func (m *Id2Result) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Id2Result.Unmarshal(m, b) -} -func (m *Id2Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Id2Result.Marshal(b, m, deterministic) -} -func (dst *Id2Result) XXX_Merge(src proto.Message) { - xxx_messageInfo_Id2Result.Merge(dst, src) -} -func (m *Id2Result) XXX_Size() int { - return xxx_messageInfo_Id2Result.Size(m) -} -func (m *Id2Result) XXX_DiscardUnknown() { - xxx_messageInfo_Id2Result.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{25} } -var xxx_messageInfo_Id2Result proto.InternalMessageInfo - -func (m *Id2Result) GetUId() string { - if m != nil { - return m.UId +func (x *Id2Result) GetUserID() string { + if x != nil { + return x.UserID } return "" } -func (m *Id2Result) GetResult() int32 { - if m != nil { - return m.Result +func (x *Id2Result) GetResult() int32 { + if x != nil { + return x.Result } return 0 } type KickGroupMemberResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Id2Result []*Id2Result `protobuf:"bytes,3,rep,name=id2result" json:"id2result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + Id2ResultList []*Id2Result `protobuf:"bytes,3,rep,name=Id2ResultList,proto3" json:"Id2ResultList,omitempty"` } -func (m *KickGroupMemberResp) Reset() { *m = KickGroupMemberResp{} } -func (m *KickGroupMemberResp) String() string { return proto.CompactTextString(m) } -func (*KickGroupMemberResp) ProtoMessage() {} +func (x *KickGroupMemberResp) Reset() { + *x = KickGroupMemberResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KickGroupMemberResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KickGroupMemberResp) ProtoMessage() {} + +func (x *KickGroupMemberResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KickGroupMemberResp.ProtoReflect.Descriptor instead. func (*KickGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{26} -} -func (m *KickGroupMemberResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KickGroupMemberResp.Unmarshal(m, b) -} -func (m *KickGroupMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KickGroupMemberResp.Marshal(b, m, deterministic) -} -func (dst *KickGroupMemberResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_KickGroupMemberResp.Merge(dst, src) -} -func (m *KickGroupMemberResp) XXX_Size() int { - return xxx_messageInfo_KickGroupMemberResp.Size(m) -} -func (m *KickGroupMemberResp) XXX_DiscardUnknown() { - xxx_messageInfo_KickGroupMemberResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{26} } -var xxx_messageInfo_KickGroupMemberResp proto.InternalMessageInfo - -func (m *KickGroupMemberResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *KickGroupMemberResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *KickGroupMemberResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *KickGroupMemberResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg } return "" } -func (m *KickGroupMemberResp) GetId2Result() []*Id2Result { - if m != nil { - return m.Id2Result +func (x *KickGroupMemberResp) GetId2ResultList() []*Id2Result { + if x != nil { + return x.Id2ResultList } return nil } type GetJoinedGroupListReq struct { - Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FromUserID string `protobuf:"bytes,1,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //app manager or FromUserID } -func (m *GetJoinedGroupListReq) Reset() { *m = GetJoinedGroupListReq{} } -func (m *GetJoinedGroupListReq) String() string { return proto.CompactTextString(m) } -func (*GetJoinedGroupListReq) ProtoMessage() {} +func (x *GetJoinedGroupListReq) Reset() { + *x = GetJoinedGroupListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJoinedGroupListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJoinedGroupListReq) ProtoMessage() {} + +func (x *GetJoinedGroupListReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetJoinedGroupListReq.ProtoReflect.Descriptor instead. func (*GetJoinedGroupListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{27} -} -func (m *GetJoinedGroupListReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetJoinedGroupListReq.Unmarshal(m, b) -} -func (m *GetJoinedGroupListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetJoinedGroupListReq.Marshal(b, m, deterministic) -} -func (dst *GetJoinedGroupListReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetJoinedGroupListReq.Merge(dst, src) -} -func (m *GetJoinedGroupListReq) XXX_Size() int { - return xxx_messageInfo_GetJoinedGroupListReq.Size(m) -} -func (m *GetJoinedGroupListReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetJoinedGroupListReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{27} } -var xxx_messageInfo_GetJoinedGroupListReq proto.InternalMessageInfo - -func (m *GetJoinedGroupListReq) GetToken() string { - if m != nil { - return m.Token +func (x *GetJoinedGroupListReq) GetFromUserID() string { + if x != nil { + return x.FromUserID } return "" } -func (m *GetJoinedGroupListReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *GetJoinedGroupListReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -type GroupInfo struct { - GroupId string `protobuf:"bytes,1,opt,name=groupId" json:"groupId,omitempty"` - GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` - Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"` - Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"` - FaceUrl string `protobuf:"bytes,5,opt,name=faceUrl" json:"faceUrl,omitempty"` - CreateTime uint64 `protobuf:"varint,6,opt,name=createTime" json:"createTime,omitempty"` - OwnerId string `protobuf:"bytes,7,opt,name=ownerId" json:"ownerId,omitempty"` - MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GroupInfo) Reset() { *m = GroupInfo{} } -func (m *GroupInfo) String() string { return proto.CompactTextString(m) } -func (*GroupInfo) ProtoMessage() {} -func (*GroupInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{28} -} -func (m *GroupInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GroupInfo.Unmarshal(m, b) -} -func (m *GroupInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GroupInfo.Marshal(b, m, deterministic) -} -func (dst *GroupInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupInfo.Merge(dst, src) -} -func (m *GroupInfo) XXX_Size() int { - return xxx_messageInfo_GroupInfo.Size(m) -} -func (m *GroupInfo) XXX_DiscardUnknown() { - xxx_messageInfo_GroupInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupInfo proto.InternalMessageInfo - -func (m *GroupInfo) GetGroupId() string { - if m != nil { - return m.GroupId +func (x *GetJoinedGroupListReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *GroupInfo) GetGroupName() string { - if m != nil { - return m.GroupName - } - return "" -} - -func (m *GroupInfo) GetNotification() string { - if m != nil { - return m.Notification - } - return "" -} - -func (m *GroupInfo) GetIntroduction() string { - if m != nil { - return m.Introduction - } - return "" -} - -func (m *GroupInfo) GetFaceUrl() string { - if m != nil { - return m.FaceUrl - } - return "" -} - -func (m *GroupInfo) GetCreateTime() uint64 { - if m != nil { - return m.CreateTime - } - return 0 -} - -func (m *GroupInfo) GetOwnerId() string { - if m != nil { - return m.OwnerId - } - return "" -} - -func (m *GroupInfo) GetMemberCount() uint32 { - if m != nil { - return m.MemberCount - } - return 0 -} - type GetJoinedGroupListResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - GroupList []*GroupInfo `protobuf:"bytes,3,rep,name=groupList" json:"groupList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + GroupList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupList,proto3" json:"GroupList,omitempty"` } -func (m *GetJoinedGroupListResp) Reset() { *m = GetJoinedGroupListResp{} } -func (m *GetJoinedGroupListResp) String() string { return proto.CompactTextString(m) } -func (*GetJoinedGroupListResp) ProtoMessage() {} +func (x *GetJoinedGroupListResp) Reset() { + *x = GetJoinedGroupListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJoinedGroupListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJoinedGroupListResp) ProtoMessage() {} + +func (x *GetJoinedGroupListResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetJoinedGroupListResp.ProtoReflect.Descriptor instead. func (*GetJoinedGroupListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{29} -} -func (m *GetJoinedGroupListResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetJoinedGroupListResp.Unmarshal(m, b) -} -func (m *GetJoinedGroupListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetJoinedGroupListResp.Marshal(b, m, deterministic) -} -func (dst *GetJoinedGroupListResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetJoinedGroupListResp.Merge(dst, src) -} -func (m *GetJoinedGroupListResp) XXX_Size() int { - return xxx_messageInfo_GetJoinedGroupListResp.Size(m) -} -func (m *GetJoinedGroupListResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetJoinedGroupListResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{28} } -var xxx_messageInfo_GetJoinedGroupListResp proto.InternalMessageInfo - -func (m *GetJoinedGroupListResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *GetJoinedGroupListResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *GetJoinedGroupListResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *GetJoinedGroupListResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg } return "" } -func (m *GetJoinedGroupListResp) GetGroupList() []*GroupInfo { - if m != nil { - return m.GroupList +func (x *GetJoinedGroupListResp) GetGroupList() []*sdk_ws.GroupInfo { + if x != nil { + return x.GroupList } return nil } type InviteUserToGroupReq struct { - Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` - GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` - Reason string `protobuf:"bytes,4,opt,name=reason" json:"reason,omitempty"` - UidList []string `protobuf:"bytes,5,rep,name=uidList" json:"uidList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + Reason string `protobuf:"bytes,4,opt,name=Reason,proto3" json:"Reason,omitempty"` + InvitedUserIDList []string `protobuf:"bytes,5,rep,name=InvitedUserIDList,proto3" json:"InvitedUserIDList,omitempty"` + OpUserID string `protobuf:"bytes,6,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //group member or app manager } -func (m *InviteUserToGroupReq) Reset() { *m = InviteUserToGroupReq{} } -func (m *InviteUserToGroupReq) String() string { return proto.CompactTextString(m) } -func (*InviteUserToGroupReq) ProtoMessage() {} +func (x *InviteUserToGroupReq) Reset() { + *x = InviteUserToGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InviteUserToGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InviteUserToGroupReq) ProtoMessage() {} + +func (x *InviteUserToGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InviteUserToGroupReq.ProtoReflect.Descriptor instead. func (*InviteUserToGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{30} -} -func (m *InviteUserToGroupReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InviteUserToGroupReq.Unmarshal(m, b) -} -func (m *InviteUserToGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InviteUserToGroupReq.Marshal(b, m, deterministic) -} -func (dst *InviteUserToGroupReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_InviteUserToGroupReq.Merge(dst, src) -} -func (m *InviteUserToGroupReq) XXX_Size() int { - return xxx_messageInfo_InviteUserToGroupReq.Size(m) -} -func (m *InviteUserToGroupReq) XXX_DiscardUnknown() { - xxx_messageInfo_InviteUserToGroupReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{29} } -var xxx_messageInfo_InviteUserToGroupReq proto.InternalMessageInfo - -func (m *InviteUserToGroupReq) GetToken() string { - if m != nil { - return m.Token +func (x *InviteUserToGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *InviteUserToGroupReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *InviteUserToGroupReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *InviteUserToGroupReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *InviteUserToGroupReq) GetReason() string { + if x != nil { + return x.Reason } return "" } -func (m *InviteUserToGroupReq) GetReason() string { - if m != nil { - return m.Reason - } - return "" -} - -func (m *InviteUserToGroupReq) GetUidList() []string { - if m != nil { - return m.UidList +func (x *InviteUserToGroupReq) GetInvitedUserIDList() []string { + if x != nil { + return x.InvitedUserIDList } return nil } -type InviteUserToGroupResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Id2Result []*Id2Result `protobuf:"bytes,3,rep,name=id2result" json:"id2result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InviteUserToGroupResp) Reset() { *m = InviteUserToGroupResp{} } -func (m *InviteUserToGroupResp) String() string { return proto.CompactTextString(m) } -func (*InviteUserToGroupResp) ProtoMessage() {} -func (*InviteUserToGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{31} -} -func (m *InviteUserToGroupResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InviteUserToGroupResp.Unmarshal(m, b) -} -func (m *InviteUserToGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InviteUserToGroupResp.Marshal(b, m, deterministic) -} -func (dst *InviteUserToGroupResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_InviteUserToGroupResp.Merge(dst, src) -} -func (m *InviteUserToGroupResp) XXX_Size() int { - return xxx_messageInfo_InviteUserToGroupResp.Size(m) -} -func (m *InviteUserToGroupResp) XXX_DiscardUnknown() { - xxx_messageInfo_InviteUserToGroupResp.DiscardUnknown(m) -} - -var xxx_messageInfo_InviteUserToGroupResp proto.InternalMessageInfo - -func (m *InviteUserToGroupResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode - } - return 0 -} - -func (m *InviteUserToGroupResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *InviteUserToGroupReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *InviteUserToGroupResp) GetId2Result() []*Id2Result { - if m != nil { - return m.Id2Result +type InviteUserToGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + Id2ResultList []*Id2Result `protobuf:"bytes,3,rep,name=Id2ResultList,proto3" json:"Id2ResultList,omitempty"` // 0 ok, -1 error +} + +func (x *InviteUserToGroupResp) Reset() { + *x = InviteUserToGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InviteUserToGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InviteUserToGroupResp) ProtoMessage() {} + +func (x *InviteUserToGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InviteUserToGroupResp.ProtoReflect.Descriptor instead. +func (*InviteUserToGroupResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{30} +} + +func (x *InviteUserToGroupResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode + } + return 0 +} + +func (x *InviteUserToGroupResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +func (x *InviteUserToGroupResp) GetId2ResultList() []*Id2Result { + if x != nil { + return x.Id2ResultList } return nil } type GetGroupAllMemberReq struct { - GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=GroupID,proto3" json:"GroupID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` //No verification permission + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` } -func (m *GetGroupAllMemberReq) Reset() { *m = GetGroupAllMemberReq{} } -func (m *GetGroupAllMemberReq) String() string { return proto.CompactTextString(m) } -func (*GetGroupAllMemberReq) ProtoMessage() {} +func (x *GetGroupAllMemberReq) Reset() { + *x = GetGroupAllMemberReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupAllMemberReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupAllMemberReq) ProtoMessage() {} + +func (x *GetGroupAllMemberReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupAllMemberReq.ProtoReflect.Descriptor instead. func (*GetGroupAllMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{32} -} -func (m *GetGroupAllMemberReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupAllMemberReq.Unmarshal(m, b) -} -func (m *GetGroupAllMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupAllMemberReq.Marshal(b, m, deterministic) -} -func (dst *GetGroupAllMemberReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupAllMemberReq.Merge(dst, src) -} -func (m *GetGroupAllMemberReq) XXX_Size() int { - return xxx_messageInfo_GetGroupAllMemberReq.Size(m) -} -func (m *GetGroupAllMemberReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupAllMemberReq.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{31} } -var xxx_messageInfo_GetGroupAllMemberReq proto.InternalMessageInfo - -func (m *GetGroupAllMemberReq) GetGroupID() string { - if m != nil { - return m.GroupID +func (x *GetGroupAllMemberReq) GetGroupID() string { + if x != nil { + return x.GroupID } return "" } -func (m *GetGroupAllMemberReq) GetToken() string { - if m != nil { - return m.Token +func (x *GetGroupAllMemberReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *GetGroupAllMemberReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *GetGroupAllMemberReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } type GetGroupAllMemberResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - MemberList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode,proto3" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg,proto3" json:"ErrMsg,omitempty"` + MemberList []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList,proto3" json:"memberList,omitempty"` } -func (m *GetGroupAllMemberResp) Reset() { *m = GetGroupAllMemberResp{} } -func (m *GetGroupAllMemberResp) String() string { return proto.CompactTextString(m) } -func (*GetGroupAllMemberResp) ProtoMessage() {} +func (x *GetGroupAllMemberResp) Reset() { + *x = GetGroupAllMemberResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupAllMemberResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupAllMemberResp) ProtoMessage() {} + +func (x *GetGroupAllMemberResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupAllMemberResp.ProtoReflect.Descriptor instead. func (*GetGroupAllMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_ed07d0078ff66bfe, []int{33} -} -func (m *GetGroupAllMemberResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetGroupAllMemberResp.Unmarshal(m, b) -} -func (m *GetGroupAllMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetGroupAllMemberResp.Marshal(b, m, deterministic) -} -func (dst *GetGroupAllMemberResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetGroupAllMemberResp.Merge(dst, src) -} -func (m *GetGroupAllMemberResp) XXX_Size() int { - return xxx_messageInfo_GetGroupAllMemberResp.Size(m) -} -func (m *GetGroupAllMemberResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetGroupAllMemberResp.DiscardUnknown(m) + return file_group_group_proto_rawDescGZIP(), []int{32} } -var xxx_messageInfo_GetGroupAllMemberResp proto.InternalMessageInfo - -func (m *GetGroupAllMemberResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *GetGroupAllMemberResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *GetGroupAllMemberResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *GetGroupAllMemberResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg } return "" } -func (m *GetGroupAllMemberResp) GetMemberList() []*GroupMemberFullInfo { - if m != nil { - return m.MemberList +func (x *GetGroupAllMemberResp) GetMemberList() []*sdk_ws.GroupMemberFullInfo { + if x != nil { + return x.MemberList } return nil } -func init() { - proto.RegisterType((*CommonResp)(nil), "group.CommonResp") - proto.RegisterType((*CreateGroupReq)(nil), "group.CreateGroupReq") - proto.RegisterType((*GroupAddMemberInfo)(nil), "group.GroupAddMemberInfo") - proto.RegisterType((*CreateGroupResp)(nil), "group.CreateGroupResp") - proto.RegisterType((*GetGroupsInfoReq)(nil), "group.GetGroupsInfoReq") - proto.RegisterType((*GetGroupsInfoResp)(nil), "group.GetGroupsInfoResp") - proto.RegisterType((*SetGroupInfoReq)(nil), "group.SetGroupInfoReq") - proto.RegisterType((*GetGroupApplicationListReq)(nil), "group.GetGroupApplicationListReq") - proto.RegisterType((*GetGroupApplicationList_Data_User)(nil), "group.GetGroupApplicationList_Data_User") - proto.RegisterType((*GetGroupApplicationListData)(nil), "group.GetGroupApplicationListData") - proto.RegisterType((*GetGroupApplicationListResp)(nil), "group.GetGroupApplicationListResp") - proto.RegisterType((*TransferGroupOwnerReq)(nil), "group.TransferGroupOwnerReq") - proto.RegisterType((*TransferGroupOwnerResp)(nil), "group.TransferGroupOwnerResp") - proto.RegisterType((*JoinGroupReq)(nil), "group.JoinGroupReq") - proto.RegisterType((*GroupApplicationResponseReq)(nil), "group.GroupApplicationResponseReq") - proto.RegisterType((*GroupApplicationResponseResp)(nil), "group.GroupApplicationResponseResp") - proto.RegisterType((*SetOwnerGroupNickNameReq)(nil), "group.SetOwnerGroupNickNameReq") - proto.RegisterType((*QuitGroupReq)(nil), "group.QuitGroupReq") - proto.RegisterType((*GroupApplicationUserInfo)(nil), "group.GroupApplicationUserInfo") - proto.RegisterType((*GroupMemberFullInfo)(nil), "group.GroupMemberFullInfo") - proto.RegisterType((*GetGroupMemberListReq)(nil), "group.GetGroupMemberListReq") - proto.RegisterType((*GetGroupMemberListResp)(nil), "group.GetGroupMemberListResp") - proto.RegisterType((*GetGroupMembersInfoReq)(nil), "group.GetGroupMembersInfoReq") - proto.RegisterType((*GetGroupMembersInfoResp)(nil), "group.GetGroupMembersInfoResp") - proto.RegisterType((*KickGroupMemberReq)(nil), "group.KickGroupMemberReq") - proto.RegisterType((*Id2Result)(nil), "group.Id2Result") - proto.RegisterType((*KickGroupMemberResp)(nil), "group.KickGroupMemberResp") - proto.RegisterType((*GetJoinedGroupListReq)(nil), "group.getJoinedGroupListReq") - proto.RegisterType((*GroupInfo)(nil), "group.GroupInfo") - proto.RegisterType((*GetJoinedGroupListResp)(nil), "group.getJoinedGroupListResp") - proto.RegisterType((*InviteUserToGroupReq)(nil), "group.inviteUserToGroupReq") - proto.RegisterType((*InviteUserToGroupResp)(nil), "group.inviteUserToGroupResp") - proto.RegisterType((*GetGroupAllMemberReq)(nil), "group.GetGroupAllMemberReq") - proto.RegisterType((*GetGroupAllMemberResp)(nil), "group.GetGroupAllMemberResp") +type CMSGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,1,opt,name=GroupInfo,proto3" json:"GroupInfo,omitempty"` + GroupMasterName string `protobuf:"bytes,2,opt,name=GroupMasterName,proto3" json:"GroupMasterName,omitempty"` + GroupMasterId string `protobuf:"bytes,3,opt,name=GroupMasterId,proto3" json:"GroupMasterId,omitempty"` +} + +func (x *CMSGroup) Reset() { + *x = CMSGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CMSGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CMSGroup) ProtoMessage() {} + +func (x *CMSGroup) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CMSGroup.ProtoReflect.Descriptor instead. +func (*CMSGroup) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{33} +} + +func (x *CMSGroup) GetGroupInfo() *sdk_ws.GroupInfo { + if x != nil { + return x.GroupInfo + } + return nil +} + +func (x *CMSGroup) GetGroupMasterName() string { + if x != nil { + return x.GroupMasterName + } + return "" +} + +func (x *CMSGroup) GetGroupMasterId() string { + if x != nil { + return x.GroupMasterId + } + return "" +} + +type GetGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupName string `protobuf:"bytes,1,opt,name=GroupName,proto3" json:"GroupName,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetGroupReq) Reset() { + *x = GetGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupReq) ProtoMessage() {} + +func (x *GetGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupReq.ProtoReflect.Descriptor instead. +func (*GetGroupReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{34} +} + +func (x *GetGroupReq) GetGroupName() string { + if x != nil { + return x.GroupName + } + return "" +} + +func (x *GetGroupReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CMSGroups []*CMSGroup `protobuf:"bytes,1,rep,name=CMSGroups,proto3" json:"CMSGroups,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + GroupNums int32 `protobuf:"varint,3,opt,name=GroupNums,proto3" json:"GroupNums,omitempty"` +} + +func (x *GetGroupResp) Reset() { + *x = GetGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupResp) ProtoMessage() {} + +func (x *GetGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupResp.ProtoReflect.Descriptor instead. +func (*GetGroupResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{35} +} + +func (x *GetGroupResp) GetCMSGroups() []*CMSGroup { + if x != nil { + return x.CMSGroups + } + return nil +} + +func (x *GetGroupResp) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetGroupResp) GetGroupNums() int32 { + if x != nil { + return x.GroupNums + } + return 0 +} + +type GetGroupsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetGroupsReq) Reset() { + *x = GetGroupsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupsReq) ProtoMessage() {} + +func (x *GetGroupsReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupsReq.ProtoReflect.Descriptor instead. +func (*GetGroupsReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{36} +} + +func (x *GetGroupsReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetGroupsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetGroupsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CMSGroups []*CMSGroup `protobuf:"bytes,1,rep,name=CMSGroups,proto3" json:"CMSGroups,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + GroupNum int32 `protobuf:"varint,3,opt,name=GroupNum,proto3" json:"GroupNum,omitempty"` +} + +func (x *GetGroupsResp) Reset() { + *x = GetGroupsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupsResp) ProtoMessage() {} + +func (x *GetGroupsResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupsResp.ProtoReflect.Descriptor instead. +func (*GetGroupsResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{37} +} + +func (x *GetGroupsResp) GetCMSGroups() []*CMSGroup { + if x != nil { + return x.CMSGroups + } + return nil +} + +func (x *GetGroupsResp) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetGroupsResp) GetGroupNum() int32 { + if x != nil { + return x.GroupNum + } + return 0 +} + +type GetGroupMemberReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetGroupMemberReq) Reset() { + *x = GetGroupMemberReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupMemberReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupMemberReq) ProtoMessage() {} + +func (x *GetGroupMemberReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupMemberReq.ProtoReflect.Descriptor instead. +func (*GetGroupMemberReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{38} +} + +func (x *GetGroupMemberReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GetGroupMemberReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type OperateGroupStatusReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=Status,proto3" json:"Status,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *OperateGroupStatusReq) Reset() { + *x = OperateGroupStatusReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperateGroupStatusReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperateGroupStatusReq) ProtoMessage() {} + +func (x *OperateGroupStatusReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OperateGroupStatusReq.ProtoReflect.Descriptor instead. +func (*OperateGroupStatusReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{39} +} + +func (x *OperateGroupStatusReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *OperateGroupStatusReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *OperateGroupStatusReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type OperateGroupStatusResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OperateGroupStatusResp) Reset() { + *x = OperateGroupStatusResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperateGroupStatusResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperateGroupStatusResp) ProtoMessage() {} + +func (x *OperateGroupStatusResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OperateGroupStatusResp.ProtoReflect.Descriptor instead. +func (*OperateGroupStatusResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{40} +} + +type OperateUserRoleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId,omitempty"` + RoleLevel int32 `protobuf:"varint,3,opt,name=RoleLevel,proto3" json:"RoleLevel,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *OperateUserRoleReq) Reset() { + *x = OperateUserRoleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperateUserRoleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperateUserRoleReq) ProtoMessage() {} + +func (x *OperateUserRoleReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OperateUserRoleReq.ProtoReflect.Descriptor instead. +func (*OperateUserRoleReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{41} +} + +func (x *OperateUserRoleReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *OperateUserRoleReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *OperateUserRoleReq) GetRoleLevel() int32 { + if x != nil { + return x.RoleLevel + } + return 0 +} + +func (x *OperateUserRoleReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type OperateUserRoleResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *OperateUserRoleResp) Reset() { + *x = OperateUserRoleResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperateUserRoleResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperateUserRoleResp) ProtoMessage() {} + +func (x *OperateUserRoleResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OperateUserRoleResp.ProtoReflect.Descriptor instead. +func (*OperateUserRoleResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{42} +} + +type DeleteGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *DeleteGroupReq) Reset() { + *x = DeleteGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteGroupReq) ProtoMessage() {} + +func (x *DeleteGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteGroupReq.ProtoReflect.Descriptor instead. +func (*DeleteGroupReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{43} +} + +func (x *DeleteGroupReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *DeleteGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type DeleteGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteGroupResp) Reset() { + *x = DeleteGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteGroupResp) ProtoMessage() {} + +func (x *DeleteGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteGroupResp.ProtoReflect.Descriptor instead. +func (*DeleteGroupResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{44} +} + +type GetGroupByIdReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetGroupByIdReq) Reset() { + *x = GetGroupByIdReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupByIdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupByIdReq) ProtoMessage() {} + +func (x *GetGroupByIdReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[45] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupByIdReq.ProtoReflect.Descriptor instead. +func (*GetGroupByIdReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{45} +} + +func (x *GetGroupByIdReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GetGroupByIdReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetGroupByIdResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CMSGroup *CMSGroup `protobuf:"bytes,1,opt,name=CMSGroup,proto3" json:"CMSGroup,omitempty"` +} + +func (x *GetGroupByIdResp) Reset() { + *x = GetGroupByIdResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupByIdResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupByIdResp) ProtoMessage() {} + +func (x *GetGroupByIdResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[46] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupByIdResp.ProtoReflect.Descriptor instead. +func (*GetGroupByIdResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{46} +} + +func (x *GetGroupByIdResp) GetCMSGroup() *CMSGroup { + if x != nil { + return x.CMSGroup + } + return nil +} + +type GetGroupMembersCMSReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=UserName,proto3" json:"UserName,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetGroupMembersCMSReq) Reset() { + *x = GetGroupMembersCMSReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupMembersCMSReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupMembersCMSReq) ProtoMessage() {} + +func (x *GetGroupMembersCMSReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[47] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupMembersCMSReq.ProtoReflect.Descriptor instead. +func (*GetGroupMembersCMSReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{47} +} + +func (x *GetGroupMembersCMSReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GetGroupMembersCMSReq) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *GetGroupMembersCMSReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetGroupMembersCMSReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetGroupMembersCMSResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Members []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + MemberNums int32 `protobuf:"varint,3,opt,name=MemberNums,proto3" json:"MemberNums,omitempty"` +} + +func (x *GetGroupMembersCMSResp) Reset() { + *x = GetGroupMembersCMSResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupMembersCMSResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupMembersCMSResp) ProtoMessage() {} + +func (x *GetGroupMembersCMSResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[48] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupMembersCMSResp.ProtoReflect.Descriptor instead. +func (*GetGroupMembersCMSResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{48} +} + +func (x *GetGroupMembersCMSResp) GetMembers() []*sdk_ws.GroupMemberFullInfo { + if x != nil { + return x.Members + } + return nil +} + +func (x *GetGroupMembersCMSResp) GetPagination() *sdk_ws.ResponsePagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetGroupMembersCMSResp) GetMemberNums() int32 { + if x != nil { + return x.MemberNums + } + return 0 +} + +type RemoveGroupMembersCMSReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + UserIds []string `protobuf:"bytes,2,rep,name=UserIds,proto3" json:"UserIds,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,4,opt,name=OpUserId,proto3" json:"OpUserId,omitempty"` +} + +func (x *RemoveGroupMembersCMSReq) Reset() { + *x = RemoveGroupMembersCMSReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveGroupMembersCMSReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveGroupMembersCMSReq) ProtoMessage() {} + +func (x *RemoveGroupMembersCMSReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveGroupMembersCMSReq.ProtoReflect.Descriptor instead. +func (*RemoveGroupMembersCMSReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{49} +} + +func (x *RemoveGroupMembersCMSReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *RemoveGroupMembersCMSReq) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +func (x *RemoveGroupMembersCMSReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *RemoveGroupMembersCMSReq) GetOpUserId() string { + if x != nil { + return x.OpUserId + } + return "" +} + +type RemoveGroupMembersCMSResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success []string `protobuf:"bytes,1,rep,name=success,proto3" json:"success,omitempty"` + Failed []string `protobuf:"bytes,2,rep,name=failed,proto3" json:"failed,omitempty"` +} + +func (x *RemoveGroupMembersCMSResp) Reset() { + *x = RemoveGroupMembersCMSResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveGroupMembersCMSResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveGroupMembersCMSResp) ProtoMessage() {} + +func (x *RemoveGroupMembersCMSResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveGroupMembersCMSResp.ProtoReflect.Descriptor instead. +func (*RemoveGroupMembersCMSResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{50} +} + +func (x *RemoveGroupMembersCMSResp) GetSuccess() []string { + if x != nil { + return x.Success + } + return nil +} + +func (x *RemoveGroupMembersCMSResp) GetFailed() []string { + if x != nil { + return x.Failed + } + return nil +} + +type AddGroupMembersCMSReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupId string `protobuf:"bytes,1,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + UserIds []string `protobuf:"bytes,2,rep,name=UserIds,proto3" json:"UserIds,omitempty"` + OperationId string `protobuf:"bytes,3,opt,name=OperationId,proto3" json:"OperationId,omitempty"` + OpUserId string `protobuf:"bytes,4,opt,name=OpUserId,proto3" json:"OpUserId,omitempty"` +} + +func (x *AddGroupMembersCMSReq) Reset() { + *x = AddGroupMembersCMSReq{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddGroupMembersCMSReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddGroupMembersCMSReq) ProtoMessage() {} + +func (x *AddGroupMembersCMSReq) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[51] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddGroupMembersCMSReq.ProtoReflect.Descriptor instead. +func (*AddGroupMembersCMSReq) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{51} +} + +func (x *AddGroupMembersCMSReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *AddGroupMembersCMSReq) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +func (x *AddGroupMembersCMSReq) GetOperationId() string { + if x != nil { + return x.OperationId + } + return "" +} + +func (x *AddGroupMembersCMSReq) GetOpUserId() string { + if x != nil { + return x.OpUserId + } + return "" +} + +type AddGroupMembersCMSResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success []string `protobuf:"bytes,1,rep,name=success,proto3" json:"success,omitempty"` + Failed []string `protobuf:"bytes,2,rep,name=failed,proto3" json:"failed,omitempty"` +} + +func (x *AddGroupMembersCMSResp) Reset() { + *x = AddGroupMembersCMSResp{} + if protoimpl.UnsafeEnabled { + mi := &file_group_group_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddGroupMembersCMSResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddGroupMembersCMSResp) ProtoMessage() {} + +func (x *AddGroupMembersCMSResp) ProtoReflect() protoreflect.Message { + mi := &file_group_group_proto_msgTypes[52] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddGroupMembersCMSResp.ProtoReflect.Descriptor instead. +func (*AddGroupMembersCMSResp) Descriptor() ([]byte, []int) { + return file_group_group_proto_rawDescGZIP(), []int{52} +} + +func (x *AddGroupMembersCMSResp) GetSuccess() []string { + if x != nil { + return x.Success + } + return nil +} + +func (x *AddGroupMembersCMSResp) GetFailed() []string { + if x != nil { + return x.Failed + } + return nil +} + +var File_group_group_proto protoreflect.FileDescriptor + +var file_group_group_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x21, 0x4f, 0x70, 0x65, 0x6e, + 0x5f, 0x49, 0x4d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x64, + 0x6b, 0x5f, 0x77, 0x73, 0x2f, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x45, + 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x45, 0x72, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x4a, 0x0a, + 0x12, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x52, + 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x52, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xef, 0x01, 0x0a, 0x0e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x41, 0x0a, 0x0e, + 0x49, 0x6e, 0x69, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x0e, 0x49, 0x6e, 0x69, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x3a, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x77, 0x6e, + 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x7f, 0x0a, 0x0f, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, + 0x0a, 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, + 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, + 0x12, 0x3a, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x72, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x12, 0x20, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x22, 0x89, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x42, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x8b, 0x01, 0x0a, + 0x0f, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x12, 0x3a, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, + 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x45, 0x0a, 0x10, 0x53, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, + 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x7a, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1e, 0x0a, + 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x9c, 0x01, + 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, + 0x4b, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x10, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x74, 0x0a, 0x1c, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x22, 0x9f, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x52, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x22, 0xbf, 0x01, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x4f, 0x6c, 0x64, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x4f, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x12, 0x26, 0x0a, 0x0e, 0x4e, 0x65, 0x77, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x4e, 0x65, 0x77, 0x4f, 0x77, 0x6e, + 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x4b, 0x0a, 0x16, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x31, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x86, 0x01, 0x0a, 0x0c, 0x4a, 0x6f, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x1e, + 0x0a, 0x0a, 0x52, 0x65, 0x71, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x52, 0x65, 0x71, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x42, 0x0a, 0x0d, + 0x4a, 0x6f, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x22, 0xd9, 0x01, 0x0a, 0x1b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, + 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x72, 0x6f, 0x6d, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x46, 0x72, + 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x48, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x48, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x51, 0x0a, 0x1c, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0a, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, + 0x66, 0x0a, 0x0c, 0x51, 0x75, 0x69, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, + 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, + 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, + 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x42, 0x0a, 0x0d, 0x51, 0x75, 0x69, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0xa1, 0x01, 0x0a, 0x15, + 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, + 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x16, 0x0a, + 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x4e, 0x65, 0x78, 0x74, 0x53, 0x65, 0x71, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4e, 0x65, 0x78, 0x74, 0x53, 0x65, 0x71, 0x22, + 0xac, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x72, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x45, 0x72, 0x72, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x46, 0x0a, 0x0a, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x65, 0x71, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x65, 0x71, 0x22, 0x90, + 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, + 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x44, 0x22, 0x93, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, + 0x46, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xb0, 0x01, 0x0a, 0x12, 0x4b, 0x69, 0x63, 0x6b, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x10, 0x4b, 0x69, 0x63, 0x6b, + 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x10, 0x4b, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, + 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x3b, 0x0a, 0x09, 0x49, 0x64, + 0x32, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, + 0x16, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x7f, 0x0a, 0x13, 0x4b, 0x69, 0x63, 0x6b, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, + 0x0a, 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, + 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, + 0x12, 0x36, 0x0a, 0x0d, 0x49, 0x64, 0x32, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x49, 0x64, 0x32, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0d, 0x49, 0x64, 0x32, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x75, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4a, + 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, + 0x86, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x72, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x45, 0x72, 0x72, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x3a, 0x0a, 0x09, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xb4, 0x01, 0x0a, 0x14, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x16, 0x0a, + 0x06, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x52, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, + 0x81, 0x01, 0x0a, 0x15, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x72, 0x72, + 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x45, 0x72, 0x72, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x36, 0x0a, 0x0d, 0x49, + 0x64, 0x32, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x49, 0x64, 0x32, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0d, 0x49, 0x64, 0x32, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x22, 0x6e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, + 0x6c, 0x6c, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x22, 0x91, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x41, 0x6c, 0x6c, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, + 0x07, 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x45, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x45, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, + 0x46, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, + 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x96, 0x01, 0x0a, 0x08, 0x43, 0x4d, 0x53, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3a, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x28, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x12, 0x1c, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x44, + 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xa1, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x09, 0x43, 0x4d, 0x53, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x43, 0x4d, 0x53, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x09, 0x43, 0x4d, 0x53, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x76, 0x0a, 0x0c, 0x47, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x22, 0xa0, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x09, 0x43, 0x4d, 0x53, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x43, 0x4d, 0x53, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x09, 0x43, 0x4d, 0x53, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x50, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x22, 0x4f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x6b, 0x0a, 0x15, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x12, + 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x22, 0x18, 0x0a, 0x16, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x86, 0x01, + 0x0a, 0x12, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x52, 0x6f, 0x6c, 0x65, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x52, 0x6f, 0x6c, 0x65, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x15, 0x0a, 0x13, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x4c, 0x0a, + 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, + 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x11, 0x0a, 0x0f, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x22, 0x4d, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, + 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x3f, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x2b, 0x0a, 0x08, 0x43, 0x4d, 0x53, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x43, 0x4d, 0x53, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x08, 0x43, 0x4d, 0x53, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xb5, + 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x44, + 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xc1, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x40, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x19, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, + 0x4d, 0x53, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x15, 0x41, 0x64, 0x64, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, + 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x22, 0x4a, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x32, 0xad, 0x0e, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3c, 0x0a, 0x0b, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x15, 0x2e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x1a, 0x16, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x4a, 0x6f, + 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x36, 0x0a, 0x09, 0x71, 0x75, 0x69, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x13, 0x2e, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x51, 0x75, 0x69, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x51, 0x75, 0x69, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x42, 0x0a, 0x0d, 0x67, 0x65, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3f, 0x0a, 0x0c, + 0x73, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x53, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x53, 0x65, 0x74, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x60, 0x0a, + 0x17, 0x67, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x66, 0x0a, 0x19, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x41, + 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x24, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x2e, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, 0x0a, 0x18, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x51, 0x0a, 0x12, 0x67, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x54, 0x0a, 0x13, 0x67, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x0f, 0x6b, 0x69, 0x63, 0x6b, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x2e, 0x4b, 0x69, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x4b, + 0x69, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x51, 0x0a, 0x12, 0x67, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, + 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x11, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x54, 0x6f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x11, 0x67, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x41, 0x6c, 0x6c, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x6c, 0x6c, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x6c, 0x6c, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x42, 0x79, 0x49, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x79, + 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x12, 0x12, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, + 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x09, 0x47, + 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x13, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x12, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, 0x0a, 0x0f, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x2e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x3c, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, + 0x15, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x43, 0x4d, 0x53, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x5a, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x12, 0x1f, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, + 0x12, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x43, 0x4d, 0x53, 0x12, 0x1c, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x41, 0x64, 0x64, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, + 0x71, 0x1a, 0x1d, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x43, 0x4d, 0x53, 0x52, 0x65, 0x73, 0x70, + 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x3b, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_group_group_proto_rawDescOnce sync.Once + file_group_group_proto_rawDescData = file_group_group_proto_rawDesc +) + +func file_group_group_proto_rawDescGZIP() []byte { + file_group_group_proto_rawDescOnce.Do(func() { + file_group_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_group_group_proto_rawDescData) + }) + return file_group_group_proto_rawDescData +} + +var file_group_group_proto_msgTypes = make([]protoimpl.MessageInfo, 53) +var file_group_group_proto_goTypes = []interface{}{ + (*CommonResp)(nil), // 0: group.CommonResp + (*GroupAddMemberInfo)(nil), // 1: group.GroupAddMemberInfo + (*CreateGroupReq)(nil), // 2: group.CreateGroupReq + (*CreateGroupResp)(nil), // 3: group.CreateGroupResp + (*GetGroupsInfoReq)(nil), // 4: group.GetGroupsInfoReq + (*GetGroupsInfoResp)(nil), // 5: group.GetGroupsInfoResp + (*SetGroupInfoReq)(nil), // 6: group.SetGroupInfoReq + (*SetGroupInfoResp)(nil), // 7: group.SetGroupInfoResp + (*GetGroupApplicationListReq)(nil), // 8: group.GetGroupApplicationListReq + (*GetGroupApplicationListResp)(nil), // 9: group.GetGroupApplicationListResp + (*GetUserReqApplicationListReq)(nil), // 10: group.GetUserReqApplicationListReq + (*GetUserReqApplicationListResp)(nil), // 11: group.GetUserReqApplicationListResp + (*TransferGroupOwnerReq)(nil), // 12: group.TransferGroupOwnerReq + (*TransferGroupOwnerResp)(nil), // 13: group.TransferGroupOwnerResp + (*JoinGroupReq)(nil), // 14: group.JoinGroupReq + (*JoinGroupResp)(nil), // 15: group.JoinGroupResp + (*GroupApplicationResponseReq)(nil), // 16: group.GroupApplicationResponseReq + (*GroupApplicationResponseResp)(nil), // 17: group.GroupApplicationResponseResp + (*QuitGroupReq)(nil), // 18: group.QuitGroupReq + (*QuitGroupResp)(nil), // 19: group.QuitGroupResp + (*GetGroupMemberListReq)(nil), // 20: group.GetGroupMemberListReq + (*GetGroupMemberListResp)(nil), // 21: group.GetGroupMemberListResp + (*GetGroupMembersInfoReq)(nil), // 22: group.GetGroupMembersInfoReq + (*GetGroupMembersInfoResp)(nil), // 23: group.GetGroupMembersInfoResp + (*KickGroupMemberReq)(nil), // 24: group.KickGroupMemberReq + (*Id2Result)(nil), // 25: group.Id2Result + (*KickGroupMemberResp)(nil), // 26: group.KickGroupMemberResp + (*GetJoinedGroupListReq)(nil), // 27: group.GetJoinedGroupListReq + (*GetJoinedGroupListResp)(nil), // 28: group.GetJoinedGroupListResp + (*InviteUserToGroupReq)(nil), // 29: group.InviteUserToGroupReq + (*InviteUserToGroupResp)(nil), // 30: group.InviteUserToGroupResp + (*GetGroupAllMemberReq)(nil), // 31: group.GetGroupAllMemberReq + (*GetGroupAllMemberResp)(nil), // 32: group.GetGroupAllMemberResp + (*CMSGroup)(nil), // 33: group.CMSGroup + (*GetGroupReq)(nil), // 34: group.GetGroupReq + (*GetGroupResp)(nil), // 35: group.GetGroupResp + (*GetGroupsReq)(nil), // 36: group.GetGroupsReq + (*GetGroupsResp)(nil), // 37: group.GetGroupsResp + (*GetGroupMemberReq)(nil), // 38: group.GetGroupMemberReq + (*OperateGroupStatusReq)(nil), // 39: group.OperateGroupStatusReq + (*OperateGroupStatusResp)(nil), // 40: group.OperateGroupStatusResp + (*OperateUserRoleReq)(nil), // 41: group.OperateUserRoleReq + (*OperateUserRoleResp)(nil), // 42: group.OperateUserRoleResp + (*DeleteGroupReq)(nil), // 43: group.DeleteGroupReq + (*DeleteGroupResp)(nil), // 44: group.DeleteGroupResp + (*GetGroupByIdReq)(nil), // 45: group.GetGroupByIdReq + (*GetGroupByIdResp)(nil), // 46: group.GetGroupByIdResp + (*GetGroupMembersCMSReq)(nil), // 47: group.GetGroupMembersCMSReq + (*GetGroupMembersCMSResp)(nil), // 48: group.GetGroupMembersCMSResp + (*RemoveGroupMembersCMSReq)(nil), // 49: group.RemoveGroupMembersCMSReq + (*RemoveGroupMembersCMSResp)(nil), // 50: group.RemoveGroupMembersCMSResp + (*AddGroupMembersCMSReq)(nil), // 51: group.AddGroupMembersCMSReq + (*AddGroupMembersCMSResp)(nil), // 52: group.AddGroupMembersCMSResp + (*sdk_ws.GroupInfo)(nil), // 53: server_api_params.GroupInfo + (*sdk_ws.GroupRequest)(nil), // 54: server_api_params.GroupRequest + (*sdk_ws.GroupMemberFullInfo)(nil), // 55: server_api_params.GroupMemberFullInfo + (*sdk_ws.RequestPagination)(nil), // 56: server_api_params.RequestPagination + (*sdk_ws.ResponsePagination)(nil), // 57: server_api_params.ResponsePagination +} +var file_group_group_proto_depIdxs = []int32{ + 1, // 0: group.CreateGroupReq.InitMemberList:type_name -> group.GroupAddMemberInfo + 53, // 1: group.CreateGroupReq.GroupInfo:type_name -> server_api_params.GroupInfo + 53, // 2: group.CreateGroupResp.GroupInfo:type_name -> server_api_params.GroupInfo + 53, // 3: group.GetGroupsInfoResp.GroupInfoList:type_name -> server_api_params.GroupInfo + 53, // 4: group.SetGroupInfoReq.GroupInfo:type_name -> server_api_params.GroupInfo + 0, // 5: group.SetGroupInfoResp.CommonResp:type_name -> group.CommonResp + 54, // 6: group.GetGroupApplicationListResp.GroupRequestList:type_name -> server_api_params.GroupRequest + 0, // 7: group.GetUserReqApplicationListResp.CommonResp:type_name -> group.CommonResp + 54, // 8: group.GetUserReqApplicationListResp.GroupRequestList:type_name -> server_api_params.GroupRequest + 0, // 9: group.TransferGroupOwnerResp.CommonResp:type_name -> group.CommonResp + 0, // 10: group.JoinGroupResp.CommonResp:type_name -> group.CommonResp + 0, // 11: group.GroupApplicationResponseResp.CommonResp:type_name -> group.CommonResp + 0, // 12: group.QuitGroupResp.CommonResp:type_name -> group.CommonResp + 55, // 13: group.GetGroupMemberListResp.memberList:type_name -> server_api_params.GroupMemberFullInfo + 55, // 14: group.GetGroupMembersInfoResp.memberList:type_name -> server_api_params.GroupMemberFullInfo + 25, // 15: group.KickGroupMemberResp.Id2ResultList:type_name -> group.Id2Result + 53, // 16: group.GetJoinedGroupListResp.GroupList:type_name -> server_api_params.GroupInfo + 25, // 17: group.InviteUserToGroupResp.Id2ResultList:type_name -> group.Id2Result + 55, // 18: group.GetGroupAllMemberResp.memberList:type_name -> server_api_params.GroupMemberFullInfo + 53, // 19: group.CMSGroup.GroupInfo:type_name -> server_api_params.GroupInfo + 56, // 20: group.GetGroupReq.Pagination:type_name -> server_api_params.RequestPagination + 33, // 21: group.GetGroupResp.CMSGroups:type_name -> group.CMSGroup + 56, // 22: group.GetGroupResp.Pagination:type_name -> server_api_params.RequestPagination + 56, // 23: group.GetGroupsReq.Pagination:type_name -> server_api_params.RequestPagination + 33, // 24: group.GetGroupsResp.CMSGroups:type_name -> group.CMSGroup + 56, // 25: group.GetGroupsResp.Pagination:type_name -> server_api_params.RequestPagination + 33, // 26: group.GetGroupByIdResp.CMSGroup:type_name -> group.CMSGroup + 56, // 27: group.GetGroupMembersCMSReq.Pagination:type_name -> server_api_params.RequestPagination + 55, // 28: group.GetGroupMembersCMSResp.members:type_name -> server_api_params.GroupMemberFullInfo + 57, // 29: group.GetGroupMembersCMSResp.Pagination:type_name -> server_api_params.ResponsePagination + 2, // 30: group.group.createGroup:input_type -> group.CreateGroupReq + 14, // 31: group.group.joinGroup:input_type -> group.JoinGroupReq + 18, // 32: group.group.quitGroup:input_type -> group.QuitGroupReq + 4, // 33: group.group.getGroupsInfo:input_type -> group.GetGroupsInfoReq + 6, // 34: group.group.setGroupInfo:input_type -> group.SetGroupInfoReq + 8, // 35: group.group.getGroupApplicationList:input_type -> group.GetGroupApplicationListReq + 10, // 36: group.group.getUserReqApplicationList:input_type -> group.GetUserReqApplicationListReq + 12, // 37: group.group.transferGroupOwner:input_type -> group.TransferGroupOwnerReq + 16, // 38: group.group.groupApplicationResponse:input_type -> group.GroupApplicationResponseReq + 20, // 39: group.group.getGroupMemberList:input_type -> group.GetGroupMemberListReq + 22, // 40: group.group.getGroupMembersInfo:input_type -> group.GetGroupMembersInfoReq + 24, // 41: group.group.kickGroupMember:input_type -> group.KickGroupMemberReq + 27, // 42: group.group.getJoinedGroupList:input_type -> group.GetJoinedGroupListReq + 29, // 43: group.group.inviteUserToGroup:input_type -> group.InviteUserToGroupReq + 31, // 44: group.group.getGroupAllMember:input_type -> group.GetGroupAllMemberReq + 45, // 45: group.group.GetGroupById:input_type -> group.GetGroupByIdReq + 34, // 46: group.group.GetGroup:input_type -> group.GetGroupReq + 36, // 47: group.group.GetGroups:input_type -> group.GetGroupsReq + 39, // 48: group.group.OperateGroupStatus:input_type -> group.OperateGroupStatusReq + 41, // 49: group.group.OperateUserRole:input_type -> group.OperateUserRoleReq + 43, // 50: group.group.DeleteGroup:input_type -> group.DeleteGroupReq + 47, // 51: group.group.GetGroupMembersCMS:input_type -> group.GetGroupMembersCMSReq + 49, // 52: group.group.RemoveGroupMembersCMS:input_type -> group.RemoveGroupMembersCMSReq + 51, // 53: group.group.AddGroupMembersCMS:input_type -> group.AddGroupMembersCMSReq + 3, // 54: group.group.createGroup:output_type -> group.CreateGroupResp + 15, // 55: group.group.joinGroup:output_type -> group.JoinGroupResp + 19, // 56: group.group.quitGroup:output_type -> group.QuitGroupResp + 5, // 57: group.group.getGroupsInfo:output_type -> group.GetGroupsInfoResp + 7, // 58: group.group.setGroupInfo:output_type -> group.SetGroupInfoResp + 9, // 59: group.group.getGroupApplicationList:output_type -> group.GetGroupApplicationListResp + 11, // 60: group.group.getUserReqApplicationList:output_type -> group.GetUserReqApplicationListResp + 13, // 61: group.group.transferGroupOwner:output_type -> group.TransferGroupOwnerResp + 17, // 62: group.group.groupApplicationResponse:output_type -> group.GroupApplicationResponseResp + 21, // 63: group.group.getGroupMemberList:output_type -> group.GetGroupMemberListResp + 23, // 64: group.group.getGroupMembersInfo:output_type -> group.GetGroupMembersInfoResp + 26, // 65: group.group.kickGroupMember:output_type -> group.KickGroupMemberResp + 28, // 66: group.group.getJoinedGroupList:output_type -> group.GetJoinedGroupListResp + 30, // 67: group.group.inviteUserToGroup:output_type -> group.InviteUserToGroupResp + 32, // 68: group.group.getGroupAllMember:output_type -> group.GetGroupAllMemberResp + 46, // 69: group.group.GetGroupById:output_type -> group.GetGroupByIdResp + 35, // 70: group.group.GetGroup:output_type -> group.GetGroupResp + 37, // 71: group.group.GetGroups:output_type -> group.GetGroupsResp + 40, // 72: group.group.OperateGroupStatus:output_type -> group.OperateGroupStatusResp + 42, // 73: group.group.OperateUserRole:output_type -> group.OperateUserRoleResp + 44, // 74: group.group.DeleteGroup:output_type -> group.DeleteGroupResp + 48, // 75: group.group.GetGroupMembersCMS:output_type -> group.GetGroupMembersCMSResp + 50, // 76: group.group.RemoveGroupMembersCMS:output_type -> group.RemoveGroupMembersCMSResp + 52, // 77: group.group.AddGroupMembersCMS:output_type -> group.AddGroupMembersCMSResp + 54, // [54:78] is the sub-list for method output_type + 30, // [30:54] is the sub-list for method input_type + 30, // [30:30] is the sub-list for extension type_name + 30, // [30:30] is the sub-list for extension extendee + 0, // [0:30] is the sub-list for field type_name +} + +func init() { file_group_group_proto_init() } +func file_group_group_proto_init() { + if File_group_group_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_group_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommonResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupAddMemberInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupsInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupsInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetGroupInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetGroupInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupApplicationListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupApplicationListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserReqApplicationListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserReqApplicationListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferGroupOwnerReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransferGroupOwnerResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JoinGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JoinGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupApplicationResponseReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupApplicationResponseResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuitGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuitGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupMemberListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupMemberListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupMembersInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupMembersInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KickGroupMemberReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Id2Result); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KickGroupMemberResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJoinedGroupListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJoinedGroupListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InviteUserToGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InviteUserToGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupAllMemberReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupAllMemberResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CMSGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupMemberReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperateGroupStatusReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperateGroupStatusResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperateUserRoleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperateUserRoleResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupByIdReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupByIdResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupMembersCMSReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupMembersCMSResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveGroupMembersCMSReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveGroupMembersCMSResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddGroupMembersCMSReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_group_group_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddGroupMembersCMSResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_group_group_proto_rawDesc, + NumEnums: 0, + NumMessages: 53, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_group_group_proto_goTypes, + DependencyIndexes: file_group_group_proto_depIdxs, + MessageInfos: file_group_group_proto_msgTypes, + }.Build() + File_group_group_proto = out.File + file_group_group_proto_rawDesc = nil + file_group_group_proto_goTypes = nil + file_group_group_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Group service +const _ = grpc.SupportPackageIsVersion6 +// GroupClient is the client API for Group service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type GroupClient interface { CreateGroup(ctx context.Context, in *CreateGroupReq, opts ...grpc.CallOption) (*CreateGroupResp, error) - JoinGroup(ctx context.Context, in *JoinGroupReq, opts ...grpc.CallOption) (*CommonResp, error) - QuitGroup(ctx context.Context, in *QuitGroupReq, opts ...grpc.CallOption) (*CommonResp, error) + JoinGroup(ctx context.Context, in *JoinGroupReq, opts ...grpc.CallOption) (*JoinGroupResp, error) + QuitGroup(ctx context.Context, in *QuitGroupReq, opts ...grpc.CallOption) (*QuitGroupResp, error) GetGroupsInfo(ctx context.Context, in *GetGroupsInfoReq, opts ...grpc.CallOption) (*GetGroupsInfoResp, error) - SetGroupInfo(ctx context.Context, in *SetGroupInfoReq, opts ...grpc.CallOption) (*CommonResp, error) + SetGroupInfo(ctx context.Context, in *SetGroupInfoReq, opts ...grpc.CallOption) (*SetGroupInfoResp, error) GetGroupApplicationList(ctx context.Context, in *GetGroupApplicationListReq, opts ...grpc.CallOption) (*GetGroupApplicationListResp, error) + GetUserReqApplicationList(ctx context.Context, in *GetUserReqApplicationListReq, opts ...grpc.CallOption) (*GetUserReqApplicationListResp, error) TransferGroupOwner(ctx context.Context, in *TransferGroupOwnerReq, opts ...grpc.CallOption) (*TransferGroupOwnerResp, error) GroupApplicationResponse(ctx context.Context, in *GroupApplicationResponseReq, opts ...grpc.CallOption) (*GroupApplicationResponseResp, error) - // rpc setOwnerGroupNickName(SetOwnerGroupNickNameReq) returns(CommonResp); GetGroupMemberList(ctx context.Context, in *GetGroupMemberListReq, opts ...grpc.CallOption) (*GetGroupMemberListResp, error) GetGroupMembersInfo(ctx context.Context, in *GetGroupMembersInfoReq, opts ...grpc.CallOption) (*GetGroupMembersInfoResp, error) KickGroupMember(ctx context.Context, in *KickGroupMemberReq, opts ...grpc.CallOption) (*KickGroupMemberResp, error) GetJoinedGroupList(ctx context.Context, in *GetJoinedGroupListReq, opts ...grpc.CallOption) (*GetJoinedGroupListResp, error) InviteUserToGroup(ctx context.Context, in *InviteUserToGroupReq, opts ...grpc.CallOption) (*InviteUserToGroupResp, error) GetGroupAllMember(ctx context.Context, in *GetGroupAllMemberReq, opts ...grpc.CallOption) (*GetGroupAllMemberResp, error) + GetGroupById(ctx context.Context, in *GetGroupByIdReq, opts ...grpc.CallOption) (*GetGroupByIdResp, error) + GetGroup(ctx context.Context, in *GetGroupReq, opts ...grpc.CallOption) (*GetGroupResp, error) + GetGroups(ctx context.Context, in *GetGroupsReq, opts ...grpc.CallOption) (*GetGroupsResp, error) + OperateGroupStatus(ctx context.Context, in *OperateGroupStatusReq, opts ...grpc.CallOption) (*OperateGroupStatusResp, error) + OperateUserRole(ctx context.Context, in *OperateUserRoleReq, opts ...grpc.CallOption) (*OperateUserRoleResp, error) + DeleteGroup(ctx context.Context, in *DeleteGroupReq, opts ...grpc.CallOption) (*DeleteGroupResp, error) + GetGroupMembersCMS(ctx context.Context, in *GetGroupMembersCMSReq, opts ...grpc.CallOption) (*GetGroupMembersCMSResp, error) + RemoveGroupMembersCMS(ctx context.Context, in *RemoveGroupMembersCMSReq, opts ...grpc.CallOption) (*RemoveGroupMembersCMSResp, error) + AddGroupMembersCMS(ctx context.Context, in *AddGroupMembersCMSReq, opts ...grpc.CallOption) (*AddGroupMembersCMSResp, error) } type groupClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewGroupClient(cc *grpc.ClientConn) GroupClient { +func NewGroupClient(cc grpc.ClientConnInterface) GroupClient { return &groupClient{cc} } func (c *groupClient) CreateGroup(ctx context.Context, in *CreateGroupReq, opts ...grpc.CallOption) (*CreateGroupResp, error) { out := new(CreateGroupResp) - err := grpc.Invoke(ctx, "/group.group/createGroup", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/createGroup", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupClient) JoinGroup(ctx context.Context, in *JoinGroupReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) - err := grpc.Invoke(ctx, "/group.group/joinGroup", in, out, c.cc, opts...) +func (c *groupClient) JoinGroup(ctx context.Context, in *JoinGroupReq, opts ...grpc.CallOption) (*JoinGroupResp, error) { + out := new(JoinGroupResp) + err := c.cc.Invoke(ctx, "/group.group/joinGroup", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupClient) QuitGroup(ctx context.Context, in *QuitGroupReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) - err := grpc.Invoke(ctx, "/group.group/quitGroup", in, out, c.cc, opts...) +func (c *groupClient) QuitGroup(ctx context.Context, in *QuitGroupReq, opts ...grpc.CallOption) (*QuitGroupResp, error) { + out := new(QuitGroupResp) + err := c.cc.Invoke(ctx, "/group.group/quitGroup", in, out, opts...) if err != nil { return nil, err } @@ -2361,16 +4703,16 @@ func (c *groupClient) QuitGroup(ctx context.Context, in *QuitGroupReq, opts ...g func (c *groupClient) GetGroupsInfo(ctx context.Context, in *GetGroupsInfoReq, opts ...grpc.CallOption) (*GetGroupsInfoResp, error) { out := new(GetGroupsInfoResp) - err := grpc.Invoke(ctx, "/group.group/getGroupsInfo", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/getGroupsInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupClient) SetGroupInfo(ctx context.Context, in *SetGroupInfoReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) - err := grpc.Invoke(ctx, "/group.group/setGroupInfo", in, out, c.cc, opts...) +func (c *groupClient) SetGroupInfo(ctx context.Context, in *SetGroupInfoReq, opts ...grpc.CallOption) (*SetGroupInfoResp, error) { + out := new(SetGroupInfoResp) + err := c.cc.Invoke(ctx, "/group.group/setGroupInfo", in, out, opts...) if err != nil { return nil, err } @@ -2379,7 +4721,16 @@ func (c *groupClient) SetGroupInfo(ctx context.Context, in *SetGroupInfoReq, opt func (c *groupClient) GetGroupApplicationList(ctx context.Context, in *GetGroupApplicationListReq, opts ...grpc.CallOption) (*GetGroupApplicationListResp, error) { out := new(GetGroupApplicationListResp) - err := grpc.Invoke(ctx, "/group.group/getGroupApplicationList", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/getGroupApplicationList", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetUserReqApplicationList(ctx context.Context, in *GetUserReqApplicationListReq, opts ...grpc.CallOption) (*GetUserReqApplicationListResp, error) { + out := new(GetUserReqApplicationListResp) + err := c.cc.Invoke(ctx, "/group.group/getUserReqApplicationList", in, out, opts...) if err != nil { return nil, err } @@ -2388,7 +4739,7 @@ func (c *groupClient) GetGroupApplicationList(ctx context.Context, in *GetGroupA func (c *groupClient) TransferGroupOwner(ctx context.Context, in *TransferGroupOwnerReq, opts ...grpc.CallOption) (*TransferGroupOwnerResp, error) { out := new(TransferGroupOwnerResp) - err := grpc.Invoke(ctx, "/group.group/transferGroupOwner", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/transferGroupOwner", in, out, opts...) if err != nil { return nil, err } @@ -2397,7 +4748,7 @@ func (c *groupClient) TransferGroupOwner(ctx context.Context, in *TransferGroupO func (c *groupClient) GroupApplicationResponse(ctx context.Context, in *GroupApplicationResponseReq, opts ...grpc.CallOption) (*GroupApplicationResponseResp, error) { out := new(GroupApplicationResponseResp) - err := grpc.Invoke(ctx, "/group.group/groupApplicationResponse", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/groupApplicationResponse", in, out, opts...) if err != nil { return nil, err } @@ -2406,7 +4757,7 @@ func (c *groupClient) GroupApplicationResponse(ctx context.Context, in *GroupApp func (c *groupClient) GetGroupMemberList(ctx context.Context, in *GetGroupMemberListReq, opts ...grpc.CallOption) (*GetGroupMemberListResp, error) { out := new(GetGroupMemberListResp) - err := grpc.Invoke(ctx, "/group.group/getGroupMemberList", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/getGroupMemberList", in, out, opts...) if err != nil { return nil, err } @@ -2415,7 +4766,7 @@ func (c *groupClient) GetGroupMemberList(ctx context.Context, in *GetGroupMember func (c *groupClient) GetGroupMembersInfo(ctx context.Context, in *GetGroupMembersInfoReq, opts ...grpc.CallOption) (*GetGroupMembersInfoResp, error) { out := new(GetGroupMembersInfoResp) - err := grpc.Invoke(ctx, "/group.group/getGroupMembersInfo", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/getGroupMembersInfo", in, out, opts...) if err != nil { return nil, err } @@ -2424,7 +4775,7 @@ func (c *groupClient) GetGroupMembersInfo(ctx context.Context, in *GetGroupMembe func (c *groupClient) KickGroupMember(ctx context.Context, in *KickGroupMemberReq, opts ...grpc.CallOption) (*KickGroupMemberResp, error) { out := new(KickGroupMemberResp) - err := grpc.Invoke(ctx, "/group.group/kickGroupMember", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/kickGroupMember", in, out, opts...) if err != nil { return nil, err } @@ -2433,7 +4784,7 @@ func (c *groupClient) KickGroupMember(ctx context.Context, in *KickGroupMemberRe func (c *groupClient) GetJoinedGroupList(ctx context.Context, in *GetJoinedGroupListReq, opts ...grpc.CallOption) (*GetJoinedGroupListResp, error) { out := new(GetJoinedGroupListResp) - err := grpc.Invoke(ctx, "/group.group/getJoinedGroupList", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/getJoinedGroupList", in, out, opts...) if err != nil { return nil, err } @@ -2442,7 +4793,7 @@ func (c *groupClient) GetJoinedGroupList(ctx context.Context, in *GetJoinedGroup func (c *groupClient) InviteUserToGroup(ctx context.Context, in *InviteUserToGroupReq, opts ...grpc.CallOption) (*InviteUserToGroupResp, error) { out := new(InviteUserToGroupResp) - err := grpc.Invoke(ctx, "/group.group/inviteUserToGroup", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/inviteUserToGroup", in, out, opts...) if err != nil { return nil, err } @@ -2451,31 +4802,197 @@ func (c *groupClient) InviteUserToGroup(ctx context.Context, in *InviteUserToGro func (c *groupClient) GetGroupAllMember(ctx context.Context, in *GetGroupAllMemberReq, opts ...grpc.CallOption) (*GetGroupAllMemberResp, error) { out := new(GetGroupAllMemberResp) - err := grpc.Invoke(ctx, "/group.group/getGroupAllMember", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/group.group/getGroupAllMember", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for Group service +func (c *groupClient) GetGroupById(ctx context.Context, in *GetGroupByIdReq, opts ...grpc.CallOption) (*GetGroupByIdResp, error) { + out := new(GetGroupByIdResp) + err := c.cc.Invoke(ctx, "/group.group/GetGroupById", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} +func (c *groupClient) GetGroup(ctx context.Context, in *GetGroupReq, opts ...grpc.CallOption) (*GetGroupResp, error) { + out := new(GetGroupResp) + err := c.cc.Invoke(ctx, "/group.group/GetGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroups(ctx context.Context, in *GetGroupsReq, opts ...grpc.CallOption) (*GetGroupsResp, error) { + out := new(GetGroupsResp) + err := c.cc.Invoke(ctx, "/group.group/GetGroups", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) OperateGroupStatus(ctx context.Context, in *OperateGroupStatusReq, opts ...grpc.CallOption) (*OperateGroupStatusResp, error) { + out := new(OperateGroupStatusResp) + err := c.cc.Invoke(ctx, "/group.group/OperateGroupStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) OperateUserRole(ctx context.Context, in *OperateUserRoleReq, opts ...grpc.CallOption) (*OperateUserRoleResp, error) { + out := new(OperateUserRoleResp) + err := c.cc.Invoke(ctx, "/group.group/OperateUserRole", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) DeleteGroup(ctx context.Context, in *DeleteGroupReq, opts ...grpc.CallOption) (*DeleteGroupResp, error) { + out := new(DeleteGroupResp) + err := c.cc.Invoke(ctx, "/group.group/DeleteGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupMembersCMS(ctx context.Context, in *GetGroupMembersCMSReq, opts ...grpc.CallOption) (*GetGroupMembersCMSResp, error) { + out := new(GetGroupMembersCMSResp) + err := c.cc.Invoke(ctx, "/group.group/GetGroupMembersCMS", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) RemoveGroupMembersCMS(ctx context.Context, in *RemoveGroupMembersCMSReq, opts ...grpc.CallOption) (*RemoveGroupMembersCMSResp, error) { + out := new(RemoveGroupMembersCMSResp) + err := c.cc.Invoke(ctx, "/group.group/RemoveGroupMembersCMS", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) AddGroupMembersCMS(ctx context.Context, in *AddGroupMembersCMSReq, opts ...grpc.CallOption) (*AddGroupMembersCMSResp, error) { + out := new(AddGroupMembersCMSResp) + err := c.cc.Invoke(ctx, "/group.group/AddGroupMembersCMS", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GroupServer is the server API for Group service. type GroupServer interface { CreateGroup(context.Context, *CreateGroupReq) (*CreateGroupResp, error) - JoinGroup(context.Context, *JoinGroupReq) (*CommonResp, error) - QuitGroup(context.Context, *QuitGroupReq) (*CommonResp, error) + JoinGroup(context.Context, *JoinGroupReq) (*JoinGroupResp, error) + QuitGroup(context.Context, *QuitGroupReq) (*QuitGroupResp, error) GetGroupsInfo(context.Context, *GetGroupsInfoReq) (*GetGroupsInfoResp, error) - SetGroupInfo(context.Context, *SetGroupInfoReq) (*CommonResp, error) + SetGroupInfo(context.Context, *SetGroupInfoReq) (*SetGroupInfoResp, error) GetGroupApplicationList(context.Context, *GetGroupApplicationListReq) (*GetGroupApplicationListResp, error) + GetUserReqApplicationList(context.Context, *GetUserReqApplicationListReq) (*GetUserReqApplicationListResp, error) TransferGroupOwner(context.Context, *TransferGroupOwnerReq) (*TransferGroupOwnerResp, error) GroupApplicationResponse(context.Context, *GroupApplicationResponseReq) (*GroupApplicationResponseResp, error) - // rpc setOwnerGroupNickName(SetOwnerGroupNickNameReq) returns(CommonResp); GetGroupMemberList(context.Context, *GetGroupMemberListReq) (*GetGroupMemberListResp, error) GetGroupMembersInfo(context.Context, *GetGroupMembersInfoReq) (*GetGroupMembersInfoResp, error) KickGroupMember(context.Context, *KickGroupMemberReq) (*KickGroupMemberResp, error) GetJoinedGroupList(context.Context, *GetJoinedGroupListReq) (*GetJoinedGroupListResp, error) InviteUserToGroup(context.Context, *InviteUserToGroupReq) (*InviteUserToGroupResp, error) GetGroupAllMember(context.Context, *GetGroupAllMemberReq) (*GetGroupAllMemberResp, error) + GetGroupById(context.Context, *GetGroupByIdReq) (*GetGroupByIdResp, error) + GetGroup(context.Context, *GetGroupReq) (*GetGroupResp, error) + GetGroups(context.Context, *GetGroupsReq) (*GetGroupsResp, error) + OperateGroupStatus(context.Context, *OperateGroupStatusReq) (*OperateGroupStatusResp, error) + OperateUserRole(context.Context, *OperateUserRoleReq) (*OperateUserRoleResp, error) + DeleteGroup(context.Context, *DeleteGroupReq) (*DeleteGroupResp, error) + GetGroupMembersCMS(context.Context, *GetGroupMembersCMSReq) (*GetGroupMembersCMSResp, error) + RemoveGroupMembersCMS(context.Context, *RemoveGroupMembersCMSReq) (*RemoveGroupMembersCMSResp, error) + AddGroupMembersCMS(context.Context, *AddGroupMembersCMSReq) (*AddGroupMembersCMSResp, error) +} + +// UnimplementedGroupServer can be embedded to have forward compatible implementations. +type UnimplementedGroupServer struct { +} + +func (*UnimplementedGroupServer) CreateGroup(context.Context, *CreateGroupReq) (*CreateGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") +} +func (*UnimplementedGroupServer) JoinGroup(context.Context, *JoinGroupReq) (*JoinGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method JoinGroup not implemented") +} +func (*UnimplementedGroupServer) QuitGroup(context.Context, *QuitGroupReq) (*QuitGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuitGroup not implemented") +} +func (*UnimplementedGroupServer) GetGroupsInfo(context.Context, *GetGroupsInfoReq) (*GetGroupsInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupsInfo not implemented") +} +func (*UnimplementedGroupServer) SetGroupInfo(context.Context, *SetGroupInfoReq) (*SetGroupInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetGroupInfo not implemented") +} +func (*UnimplementedGroupServer) GetGroupApplicationList(context.Context, *GetGroupApplicationListReq) (*GetGroupApplicationListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupApplicationList not implemented") +} +func (*UnimplementedGroupServer) GetUserReqApplicationList(context.Context, *GetUserReqApplicationListReq) (*GetUserReqApplicationListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserReqApplicationList not implemented") +} +func (*UnimplementedGroupServer) TransferGroupOwner(context.Context, *TransferGroupOwnerReq) (*TransferGroupOwnerResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferGroupOwner not implemented") +} +func (*UnimplementedGroupServer) GroupApplicationResponse(context.Context, *GroupApplicationResponseReq) (*GroupApplicationResponseResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GroupApplicationResponse not implemented") +} +func (*UnimplementedGroupServer) GetGroupMemberList(context.Context, *GetGroupMemberListReq) (*GetGroupMemberListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupMemberList not implemented") +} +func (*UnimplementedGroupServer) GetGroupMembersInfo(context.Context, *GetGroupMembersInfoReq) (*GetGroupMembersInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupMembersInfo not implemented") +} +func (*UnimplementedGroupServer) KickGroupMember(context.Context, *KickGroupMemberReq) (*KickGroupMemberResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method KickGroupMember not implemented") +} +func (*UnimplementedGroupServer) GetJoinedGroupList(context.Context, *GetJoinedGroupListReq) (*GetJoinedGroupListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetJoinedGroupList not implemented") +} +func (*UnimplementedGroupServer) InviteUserToGroup(context.Context, *InviteUserToGroupReq) (*InviteUserToGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method InviteUserToGroup not implemented") +} +func (*UnimplementedGroupServer) GetGroupAllMember(context.Context, *GetGroupAllMemberReq) (*GetGroupAllMemberResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupAllMember not implemented") +} +func (*UnimplementedGroupServer) GetGroupById(context.Context, *GetGroupByIdReq) (*GetGroupByIdResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupById not implemented") +} +func (*UnimplementedGroupServer) GetGroup(context.Context, *GetGroupReq) (*GetGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented") +} +func (*UnimplementedGroupServer) GetGroups(context.Context, *GetGroupsReq) (*GetGroupsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroups not implemented") +} +func (*UnimplementedGroupServer) OperateGroupStatus(context.Context, *OperateGroupStatusReq) (*OperateGroupStatusResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method OperateGroupStatus not implemented") +} +func (*UnimplementedGroupServer) OperateUserRole(context.Context, *OperateUserRoleReq) (*OperateUserRoleResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method OperateUserRole not implemented") +} +func (*UnimplementedGroupServer) DeleteGroup(context.Context, *DeleteGroupReq) (*DeleteGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") +} +func (*UnimplementedGroupServer) GetGroupMembersCMS(context.Context, *GetGroupMembersCMSReq) (*GetGroupMembersCMSResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupMembersCMS not implemented") +} +func (*UnimplementedGroupServer) RemoveGroupMembersCMS(context.Context, *RemoveGroupMembersCMSReq) (*RemoveGroupMembersCMSResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveGroupMembersCMS not implemented") +} +func (*UnimplementedGroupServer) AddGroupMembersCMS(context.Context, *AddGroupMembersCMSReq) (*AddGroupMembersCMSResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddGroupMembersCMS not implemented") } func RegisterGroupServer(s *grpc.Server, srv GroupServer) { @@ -2590,6 +5107,24 @@ func _Group_GetGroupApplicationList_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Group_GetUserReqApplicationList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserReqApplicationListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetUserReqApplicationList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetUserReqApplicationList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetUserReqApplicationList(ctx, req.(*GetUserReqApplicationListReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Group_TransferGroupOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TransferGroupOwnerReq) if err := dec(in); err != nil { @@ -2734,6 +5269,168 @@ func _Group_GetGroupAllMember_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Group_GetGroupById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupByIdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupById(ctx, req.(*GetGroupByIdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroup(ctx, req.(*GetGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroups", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroups(ctx, req.(*GetGroupsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_OperateGroupStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OperateGroupStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).OperateGroupStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/OperateGroupStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).OperateGroupStatus(ctx, req.(*OperateGroupStatusReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_OperateUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OperateUserRoleReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).OperateUserRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/OperateUserRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).OperateUserRole(ctx, req.(*OperateUserRoleReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).DeleteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/DeleteGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).DeleteGroup(ctx, req.(*DeleteGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupMembersCMS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupMembersCMSReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupMembersCMS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupMembersCMS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupMembersCMS(ctx, req.(*GetGroupMembersCMSReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_RemoveGroupMembersCMS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveGroupMembersCMSReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).RemoveGroupMembersCMS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/RemoveGroupMembersCMS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).RemoveGroupMembersCMS(ctx, req.(*RemoveGroupMembersCMSReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_AddGroupMembersCMS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddGroupMembersCMSReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).AddGroupMembersCMS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/AddGroupMembersCMS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).AddGroupMembersCMS(ctx, req.(*AddGroupMembersCMSReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Group_serviceDesc = grpc.ServiceDesc{ ServiceName: "group.group", HandlerType: (*GroupServer)(nil), @@ -2762,6 +5459,10 @@ var _Group_serviceDesc = grpc.ServiceDesc{ MethodName: "getGroupApplicationList", Handler: _Group_GetGroupApplicationList_Handler, }, + { + MethodName: "getUserReqApplicationList", + Handler: _Group_GetUserReqApplicationList_Handler, + }, { MethodName: "transferGroupOwner", Handler: _Group_TransferGroupOwner_Handler, @@ -2794,121 +5495,43 @@ var _Group_serviceDesc = grpc.ServiceDesc{ MethodName: "getGroupAllMember", Handler: _Group_GetGroupAllMember_Handler, }, + { + MethodName: "GetGroupById", + Handler: _Group_GetGroupById_Handler, + }, + { + MethodName: "GetGroup", + Handler: _Group_GetGroup_Handler, + }, + { + MethodName: "GetGroups", + Handler: _Group_GetGroups_Handler, + }, + { + MethodName: "OperateGroupStatus", + Handler: _Group_OperateGroupStatus_Handler, + }, + { + MethodName: "OperateUserRole", + Handler: _Group_OperateUserRole_Handler, + }, + { + MethodName: "DeleteGroup", + Handler: _Group_DeleteGroup_Handler, + }, + { + MethodName: "GetGroupMembersCMS", + Handler: _Group_GetGroupMembersCMS_Handler, + }, + { + MethodName: "RemoveGroupMembersCMS", + Handler: _Group_RemoveGroupMembersCMS_Handler, + }, + { + MethodName: "AddGroupMembersCMS", + Handler: _Group_AddGroupMembersCMS_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "group/group.proto", } - -func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_ed07d0078ff66bfe) } - -var fileDescriptor_group_ed07d0078ff66bfe = []byte{ - // 1718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6e, 0xdc, 0xb6, - 0x13, 0x87, 0x76, 0xb5, 0xb6, 0x77, 0xfc, 0x4d, 0xc7, 0x8e, 0xfe, 0x8a, 0xff, 0x86, 0xc3, 0x06, - 0x85, 0xd1, 0x83, 0x0b, 0x38, 0x68, 0x81, 0xb4, 0x39, 0x34, 0xb1, 0x63, 0xc7, 0x69, 0x63, 0x27, - 0xb2, 0x73, 0xe9, 0x25, 0x51, 0x56, 0xf4, 0x46, 0xf1, 0xae, 0xb4, 0x96, 0xb4, 0x4d, 0xda, 0x4b, - 0x91, 0xa2, 0x40, 0xbf, 0x50, 0xf4, 0x90, 0x53, 0xdb, 0x17, 0xe8, 0xa9, 0x4f, 0xd0, 0xb7, 0xe9, - 0x8b, 0x14, 0x1c, 0x92, 0x12, 0xf5, 0xb5, 0x1b, 0xd8, 0x45, 0x73, 0x59, 0x68, 0x86, 0x43, 0x72, - 0x66, 0x38, 0xf3, 0xe3, 0x0c, 0x17, 0x16, 0xbb, 0x51, 0x38, 0x1c, 0xbc, 0x8f, 0xbf, 0x9b, 0x83, - 0x28, 0x4c, 0x42, 0xd2, 0x42, 0x82, 0xee, 0x02, 0x6c, 0x87, 0xfd, 0x7e, 0x18, 0x38, 0x2c, 0x1e, - 0x90, 0x55, 0x68, 0xdf, 0x89, 0xa2, 0x30, 0xda, 0x0e, 0x3d, 0x66, 0x19, 0xeb, 0xc6, 0x46, 0xcb, - 0xc9, 0x18, 0xc4, 0x86, 0x29, 0x24, 0xee, 0xc7, 0x5d, 0xab, 0xb1, 0x6e, 0x6c, 0xb4, 0x9d, 0x94, - 0xa6, 0xaf, 0x1b, 0x30, 0xb7, 0x1d, 0x31, 0x37, 0x61, 0x7b, 0x7c, 0x5d, 0x87, 0x9d, 0x91, 0x1b, - 0x00, 0x7d, 0xd6, 0x7f, 0xca, 0xa2, 0xcf, 0xfc, 0x38, 0xb1, 0x8c, 0xf5, 0xe6, 0xc6, 0xf4, 0xd6, - 0xff, 0x36, 0x85, 0x0e, 0x28, 0x74, 0xcb, 0xf3, 0xee, 0xa3, 0xc0, 0x7e, 0x70, 0x12, 0x3a, 0x9a, - 0x30, 0xd7, 0x03, 0xe5, 0x0e, 0xdc, 0x3e, 0x93, 0x5b, 0x65, 0x0c, 0x42, 0x61, 0xc6, 0x0f, 0x92, - 0x28, 0xf4, 0x86, 0x9d, 0xc4, 0x0f, 0x03, 0xab, 0x89, 0x02, 0x39, 0x1e, 0x97, 0x09, 0xc2, 0xc4, - 0x3f, 0xf1, 0x3b, 0x2e, 0xca, 0x98, 0x42, 0x46, 0xe7, 0x11, 0x0b, 0x26, 0x4f, 0xdc, 0x0e, 0x7b, - 0x14, 0xf5, 0xac, 0x16, 0x0e, 0x2b, 0x92, 0x5c, 0x82, 0x56, 0x12, 0x9e, 0xb2, 0xc0, 0x9a, 0x40, - 0xbe, 0x20, 0xc8, 0x3a, 0x4c, 0x87, 0x03, 0x16, 0xe1, 0xe4, 0xfd, 0x1d, 0x6b, 0x12, 0xc7, 0x74, - 0x16, 0x99, 0x83, 0x06, 0x7b, 0x69, 0x4d, 0xe1, 0x40, 0x83, 0xbd, 0xa4, 0x9f, 0x00, 0x29, 0x5b, - 0x4a, 0x16, 0xa0, 0x39, 0xf4, 0x3d, 0xf4, 0x6f, 0xdb, 0xe1, 0x9f, 0x5c, 0x93, 0x98, 0x25, 0x4e, - 0xd8, 0x13, 0xd6, 0xb6, 0x1c, 0x45, 0x52, 0x06, 0xf3, 0x39, 0xb7, 0x5e, 0xe4, 0x90, 0xf8, 0x36, - 0xe8, 0xc5, 0xfd, 0x1d, 0xe9, 0x33, 0x45, 0xd2, 0x1e, 0x2c, 0xec, 0xb1, 0x04, 0xf7, 0x88, 0xf1, - 0x34, 0xd8, 0x19, 0x37, 0x57, 0x0e, 0xa7, 0x07, 0xd8, 0x76, 0x74, 0x56, 0xe6, 0xa6, 0xc6, 0x08, - 0x37, 0x35, 0x4b, 0x6e, 0xa2, 0x31, 0x2c, 0x16, 0x76, 0xbb, 0x90, 0x59, 0xd7, 0xc0, 0xf4, 0xdc, - 0xc4, 0xb5, 0x9a, 0x18, 0x62, 0x0b, 0x7a, 0x88, 0xe1, 0xea, 0x38, 0x4a, 0xff, 0x36, 0x60, 0xfe, - 0x48, 0xee, 0xaa, 0x4c, 0xd4, 0x1c, 0x62, 0xe4, 0x1c, 0x32, 0x3e, 0x02, 0x73, 0xd1, 0xd5, 0xac, - 0x88, 0xae, 0x62, 0x94, 0x9a, 0x15, 0x51, 0xfa, 0xaf, 0x47, 0x20, 0x7d, 0x00, 0xb6, 0x72, 0xed, - 0xad, 0xc1, 0xa0, 0x27, 0x95, 0xe1, 0xa7, 0xc5, 0xed, 0x5d, 0x80, 0xe6, 0xa3, 0xd4, 0x56, 0xfe, - 0xc9, 0x57, 0x3c, 0xd4, 0x56, 0x14, 0x96, 0xea, 0x2c, 0xfa, 0xab, 0x09, 0x57, 0x6b, 0x96, 0x7c, - 0xbc, 0xe3, 0x26, 0xee, 0xe3, 0x47, 0x31, 0x8b, 0x78, 0xe4, 0xa7, 0x0b, 0x37, 0xf6, 0x77, 0xb8, - 0x65, 0x7b, 0xd2, 0xb3, 0x62, 0x4d, 0x45, 0x92, 0x35, 0x80, 0xdd, 0x28, 0xec, 0xf3, 0x59, 0x69, - 0x74, 0x68, 0x1c, 0x7e, 0xd2, 0xc7, 0xa1, 0x1c, 0x15, 0x3e, 0x4b, 0x69, 0x42, 0xc0, 0xdc, 0xed, - 0xb9, 0x5d, 0x74, 0x56, 0xcb, 0xc1, 0x6f, 0xbe, 0x9e, 0xc3, 0xce, 0x86, 0x2c, 0x4e, 0x78, 0x6c, - 0x08, 0x77, 0x69, 0x1c, 0x3e, 0x7e, 0xd7, 0x0d, 0xbc, 0x1e, 0xf3, 0xf8, 0xb8, 0x70, 0x99, 0xc6, - 0xe1, 0x9a, 0xde, 0xf2, 0xbc, 0x63, 0xbf, 0xcf, 0x30, 0x71, 0x9b, 0x8e, 0x22, 0xc9, 0x7b, 0xb0, - 0xa0, 0xf4, 0x3a, 0xf0, 0x3b, 0xa7, 0x01, 0x0f, 0x85, 0x36, 0xce, 0x2f, 0xf1, 0xc9, 0xbb, 0x30, - 0x27, 0xb4, 0x4c, 0x25, 0x01, 0x25, 0x0b, 0x5c, 0xb2, 0x01, 0xf3, 0x6a, 0xee, 0xae, 0x3c, 0xf9, - 0x69, 0x14, 0x2c, 0xb2, 0xc9, 0x35, 0x98, 0x15, 0x73, 0x95, 0xdc, 0x0c, 0xca, 0xe5, 0x99, 0xfc, - 0xfc, 0xa4, 0x2d, 0x9c, 0x6b, 0xcd, 0x8a, 0xf3, 0xd3, 0x58, 0xdc, 0x67, 0xc7, 0x5f, 0x0e, 0x98, - 0x35, 0x27, 0x7c, 0xc6, 0xbf, 0x79, 0x6c, 0x0a, 0x91, 0xa3, 0xc4, 0x4d, 0x86, 0xb1, 0x35, 0x8f, - 0x63, 0x39, 0x5e, 0x26, 0xe3, 0xb0, 0x78, 0xd8, 0x4b, 0xac, 0x05, 0x5d, 0x46, 0xf0, 0xe8, 0x19, - 0x5c, 0xa9, 0x09, 0x0d, 0x1e, 0x19, 0x3c, 0x88, 0xb7, 0xc3, 0x61, 0x90, 0xc8, 0x74, 0x16, 0x04, - 0xb9, 0x09, 0x26, 0xea, 0xda, 0xc0, 0x74, 0xdd, 0x50, 0xe9, 0x3a, 0x2e, 0xc4, 0x1c, 0x9c, 0x45, - 0xbf, 0x33, 0x6a, 0xf7, 0x44, 0x18, 0xb1, 0x60, 0xf2, 0x4e, 0xa4, 0x83, 0x88, 0x22, 0xc9, 0x0a, - 0x4c, 0xdc, 0x89, 0x34, 0x00, 0x91, 0x14, 0xf9, 0x10, 0xcc, 0x1d, 0x01, 0x1f, 0xc6, 0xc6, 0xf4, - 0x16, 0x1d, 0xad, 0x0f, 0x97, 0x74, 0x50, 0x9e, 0xfe, 0x64, 0xc0, 0xf2, 0x71, 0xe4, 0x06, 0xf1, - 0x09, 0x8b, 0x50, 0xf4, 0xf0, 0x45, 0xc0, 0x22, 0x09, 0x2b, 0x7b, 0x79, 0x58, 0x51, 0xc1, 0x6f, - 0xc3, 0xd4, 0x61, 0xcf, 0x43, 0x41, 0x05, 0x63, 0x8a, 0xe6, 0x63, 0x07, 0xec, 0x85, 0x18, 0x13, - 0x69, 0x91, 0xd2, 0xc5, 0x34, 0x35, 0xcb, 0x69, 0x7a, 0x0f, 0x56, 0xaa, 0x94, 0x39, 0x8f, 0x47, - 0xe8, 0x57, 0x30, 0x73, 0x2f, 0xf4, 0x83, 0xf4, 0x26, 0xaf, 0x87, 0x49, 0x0b, 0x26, 0xfb, 0x2c, - 0x8e, 0xdd, 0xae, 0x02, 0x49, 0x45, 0x66, 0x00, 0xd6, 0x2c, 0x00, 0xd8, 0x18, 0x3b, 0x7e, 0x30, - 0xe1, 0x4a, 0xd1, 0xf1, 0xdc, 0x8c, 0x30, 0x88, 0x99, 0xbc, 0x95, 0xf4, 0x15, 0x8c, 0xd2, 0x0a, - 0x5c, 0x27, 0x34, 0x3e, 0x83, 0x1e, 0x49, 0xea, 0xe7, 0xd2, 0x1c, 0x05, 0x4a, 0x66, 0x09, 0x94, - 0x0a, 0x50, 0x80, 0xb7, 0x42, 0xab, 0x0c, 0x05, 0x07, 0x35, 0x29, 0x3e, 0x51, 0x9d, 0xe2, 0x3a, - 0xd4, 0x4d, 0x16, 0xa0, 0x2e, 0x07, 0x28, 0xb8, 0xdf, 0x54, 0x11, 0x50, 0x70, 0xb7, 0x12, 0x4c, - 0xb4, 0xab, 0x60, 0x42, 0x03, 0x39, 0xc8, 0x83, 0x5c, 0x1e, 0x3e, 0xa7, 0xc7, 0xc0, 0xe7, 0x4c, - 0x09, 0x3e, 0x15, 0xbc, 0xcc, 0x8e, 0x80, 0x97, 0xb9, 0x37, 0x80, 0x97, 0xf9, 0x0a, 0x78, 0x79, - 0x00, 0xab, 0xf5, 0xa1, 0x70, 0xae, 0xc8, 0xfe, 0xde, 0x00, 0xeb, 0x88, 0x25, 0x18, 0x10, 0xb8, - 0xb4, 0xf2, 0xe3, 0xe8, 0x30, 0xb7, 0x61, 0x2a, 0x50, 0xc7, 0x20, 0xd3, 0x56, 0xd1, 0xc5, 0x80, - 0x6c, 0x96, 0x03, 0x32, 0x4d, 0x05, 0x53, 0x4b, 0x05, 0xfa, 0x04, 0x66, 0x1e, 0x0e, 0xfd, 0xe4, - 0x0d, 0x92, 0xac, 0x70, 0xeb, 0x37, 0xca, 0x75, 0x67, 0x65, 0xb2, 0xd1, 0x6f, 0x1b, 0x60, 0x15, - 0xfd, 0x87, 0xd1, 0xc5, 0x8b, 0xd0, 0xfa, 0xed, 0x64, 0x79, 0xda, 0xc8, 0xca, 0x53, 0x02, 0x26, - 0x5e, 0x69, 0x62, 0x75, 0xfc, 0xe6, 0x3c, 0xbf, 0x93, 0x96, 0x35, 0xf8, 0xcd, 0xbd, 0x1e, 0xb1, - 0x33, 0xee, 0x75, 0x91, 0x1b, 0x92, 0xe2, 0x19, 0xe1, 0x66, 0x2a, 0x60, 0x14, 0x4e, 0x60, 0x14, - 0x16, 0xd9, 0x7c, 0xd5, 0x13, 0x7e, 0xc1, 0x4f, 0x8a, 0x68, 0x3a, 0x91, 0x17, 0xbc, 0xb0, 0x35, - 0xe4, 0x79, 0x22, 0xb2, 0x40, 0xe3, 0xf0, 0xf1, 0x67, 0x59, 0x84, 0x8a, 0xf0, 0xd7, 0x38, 0xf4, - 0xb5, 0x01, 0x4b, 0xe8, 0x06, 0x51, 0x82, 0xef, 0x0e, 0x7b, 0x3d, 0xf4, 0xc0, 0x0a, 0x4c, 0x0c, - 0xb9, 0x37, 0x54, 0x25, 0x2e, 0x29, 0xae, 0x43, 0x94, 0x55, 0xe2, 0xf8, 0xcd, 0x03, 0xe0, 0x79, - 0xe8, 0x0b, 0xd5, 0xb9, 0x17, 0x4c, 0x27, 0xa5, 0x73, 0xc1, 0x61, 0x16, 0x82, 0xa3, 0xb6, 0xc0, - 0xa3, 0xbf, 0x1b, 0xb0, 0xac, 0xee, 0x98, 0xfb, 0x69, 0xe7, 0x33, 0x3a, 0x10, 0xce, 0x59, 0x6f, - 0x73, 0x4b, 0x4f, 0xfc, 0x5e, 0xc2, 0x22, 0xd4, 0xaf, 0xe5, 0x48, 0x8a, 0xef, 0x14, 0xb0, 0x97, - 0xc9, 0x11, 0x3b, 0x93, 0x15, 0x95, 0x22, 0xe9, 0x1f, 0x06, 0xac, 0x54, 0x69, 0x27, 0xea, 0x74, - 0x56, 0xac, 0xd3, 0x99, 0x5e, 0xa7, 0xb3, 0x42, 0x9d, 0xae, 0x68, 0xf2, 0x51, 0xae, 0x21, 0x14, - 0xd5, 0xba, 0xad, 0x57, 0xeb, 0xf9, 0x03, 0xca, 0x75, 0x84, 0x9a, 0xaa, 0x66, 0x5e, 0xd5, 0x1f, - 0x4b, 0xaa, 0xc6, 0xe3, 0xcb, 0xfb, 0xb5, 0x9c, 0x2a, 0x0d, 0x6c, 0x6d, 0xf4, 0xed, 0x6a, 0x6f, - 0xaf, 0xb0, 0x7c, 0x7b, 0xe9, 0xe5, 0xf7, 0x2f, 0x06, 0x5c, 0xae, 0x54, 0xe6, 0x6d, 0x39, 0x8e, - 0xfe, 0x65, 0x00, 0xf9, 0xd4, 0xef, 0x9c, 0x6a, 0x72, 0xa3, 0x5d, 0x73, 0x13, 0xa6, 0x87, 0xbe, - 0xc7, 0xe7, 0xf2, 0xb5, 0x64, 0x95, 0x36, 0x6a, 0x37, 0x5d, 0x5c, 0x40, 0x80, 0x1b, 0xa7, 0x3d, - 0x91, 0xa4, 0xaa, 0x31, 0xb0, 0xe8, 0xd0, 0x56, 0xd9, 0xa1, 0x1f, 0x40, 0x7b, 0xdf, 0xdb, 0x12, - 0xf7, 0x01, 0x22, 0xd3, 0x7e, 0xd6, 0x38, 0xef, 0x7b, 0x62, 0x3b, 0xbc, 0x3f, 0x44, 0xb6, 0x4a, - 0x8a, 0x7e, 0x0d, 0x4b, 0x25, 0xa3, 0x2f, 0x74, 0x04, 0x9b, 0xd0, 0xf6, 0xbd, 0x2d, 0xb9, 0x57, - 0xbe, 0xd1, 0x4c, 0xf5, 0x73, 0x32, 0x11, 0x7a, 0x08, 0xcb, 0x5d, 0x96, 0xf0, 0x2a, 0x8a, 0x79, - 0xa8, 0x85, 0xca, 0xee, 0xd4, 0x11, 0xc6, 0x08, 0x47, 0x94, 0x21, 0x9e, 0xbe, 0x6a, 0x40, 0x3b, - 0xed, 0x5d, 0xb3, 0xe3, 0xf3, 0xf2, 0xc7, 0xe7, 0xbd, 0xf5, 0xc6, 0x75, 0x0d, 0xa0, 0x83, 0x0f, - 0x16, 0x29, 0xcc, 0x9b, 0x8e, 0xc6, 0xe1, 0x33, 0x43, 0x2c, 0xc7, 0x3c, 0x59, 0xf2, 0x28, 0x92, - 0xfb, 0x40, 0xc4, 0xad, 0xe8, 0x19, 0x38, 0xd0, 0xcf, 0x3a, 0x3a, 0x8b, 0x7e, 0x63, 0xc0, 0x4a, - 0x95, 0x57, 0x2f, 0x7a, 0xb2, 0x5d, 0xb5, 0x54, 0xed, 0x13, 0x42, 0x26, 0x42, 0x7f, 0x33, 0xe0, - 0x92, 0x1f, 0x7c, 0xe1, 0x27, 0x8c, 0xdf, 0xa5, 0xc7, 0x61, 0x7a, 0x81, 0x9f, 0xf3, 0x64, 0xeb, - 0x5f, 0x65, 0xb4, 0x64, 0x32, 0x73, 0xc9, 0x64, 0xc1, 0xa4, 0xcc, 0x39, 0xab, 0x85, 0xd0, 0xa5, - 0x48, 0xfa, 0xca, 0x80, 0xe5, 0x0a, 0xe5, 0xfe, 0xd3, 0xd0, 0x7f, 0x06, 0x97, 0xd2, 0xe6, 0xa9, - 0xd7, 0x7b, 0x13, 0xc8, 0x39, 0xef, 0x3b, 0xd2, 0xcf, 0xda, 0x1d, 0xaa, 0x6d, 0xf5, 0xb6, 0xb0, - 0x76, 0xeb, 0xcf, 0x29, 0x10, 0xcf, 0xaa, 0x1c, 0x44, 0x3b, 0xd9, 0xb3, 0x1d, 0x59, 0x96, 0x0b, - 0xe4, 0x5f, 0x48, 0xed, 0x95, 0x2a, 0x76, 0x3c, 0x20, 0xd7, 0xa1, 0xfd, 0x5c, 0xf5, 0x5f, 0x64, - 0x49, 0x0a, 0xe9, 0x1d, 0x99, 0xbd, 0xa8, 0x66, 0x66, 0x6f, 0xb7, 0xd7, 0xa1, 0x7d, 0xa6, 0xea, - 0xc9, 0x74, 0x92, 0x5e, 0x61, 0x56, 0x4d, 0xba, 0x0d, 0xb3, 0x5d, 0xfd, 0x25, 0x8e, 0x5c, 0x2e, - 0xb4, 0xbf, 0xea, 0x2e, 0xb5, 0xad, 0xea, 0x81, 0x78, 0x40, 0x6e, 0xc0, 0x4c, 0xac, 0xbd, 0xab, - 0x11, 0x65, 0x55, 0xe1, 0xb1, 0xad, 0x6a, 0xfb, 0x27, 0x70, 0xb9, 0x5b, 0xdd, 0x67, 0x93, 0xab, - 0xa3, 0xfb, 0x70, 0xbe, 0x20, 0x1d, 0x27, 0x12, 0x0f, 0xc8, 0x43, 0x20, 0x49, 0xa9, 0x2d, 0x26, - 0xab, 0x72, 0x66, 0x65, 0xfb, 0x6e, 0xff, 0x7f, 0xc4, 0x68, 0x3c, 0x20, 0x1d, 0xb0, 0xba, 0x35, - 0x5d, 0x09, 0xa1, 0xb9, 0xf7, 0xed, 0xca, 0x0e, 0xd6, 0x7e, 0x67, 0xac, 0x8c, 0xd0, 0xbb, 0x5b, - 0xaa, 0xbf, 0x52, 0xbd, 0x2b, 0x0b, 0xc7, 0x54, 0xef, 0x9a, 0xc2, 0xed, 0x18, 0x96, 0xba, 0xe5, - 0xd2, 0x84, 0x54, 0xcf, 0x4a, 0xcf, 0x7d, 0x6d, 0xd4, 0x70, 0x3c, 0x20, 0x77, 0x61, 0xfe, 0x34, - 0x7f, 0xd3, 0x12, 0xf5, 0xc8, 0x5f, 0x2e, 0x3b, 0x6c, 0xbb, 0x6e, 0x28, 0x35, 0xb9, 0x00, 0xee, - 0xa9, 0xc9, 0x95, 0xb7, 0x69, 0x6a, 0x72, 0xcd, 0xad, 0x70, 0x00, 0x8b, 0x25, 0x34, 0x24, 0x57, - 0xe4, 0x9c, 0x2a, 0x10, 0xb7, 0x57, 0xeb, 0x07, 0xc5, 0x7a, 0xdd, 0x22, 0xde, 0xa4, 0xeb, 0x55, - 0x81, 0x9e, 0xbd, 0x5a, 0x3f, 0x18, 0x0f, 0x6e, 0xcf, 0x7f, 0x3e, 0xbb, 0x29, 0xfe, 0x95, 0xf9, - 0x18, 0x7f, 0x9f, 0x4e, 0xe0, 0x9f, 0x33, 0xd7, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xd8, - 0xe8, 0x44, 0xb1, 0x19, 0x00, 0x00, -} diff --git a/pkg/proto/group/group.proto b/pkg/proto/group/group.proto index ff1821ec2..082c19209 100644 --- a/pkg/proto/group/group.proto +++ b/pkg/proto/group/group.proto @@ -1,286 +1,350 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; option go_package = "./group;group"; package group; message CommonResp{ - int32 ErrorCode = 1; - string ErrorMsg = 2; + int32 ErrCode = 1; + string ErrMsg = 2; } +message GroupAddMemberInfo{ + string UserID = 1; + int32 RoleLevel = 2; +} + + message CreateGroupReq{ - repeated GroupAddMemberInfo memberList = 1; - string groupName = 2; - string introduction = 3; - string notification = 4; - string faceUrl = 5; - string token = 6; - string operationID = 7; - string ex = 8; -} -message GroupAddMemberInfo{ - string uid = 1; - int32 setRole = 2; + repeated GroupAddMemberInfo InitMemberList = 1; + server_api_params.GroupInfo GroupInfo = 2; + string OperationID = 3; + string OpUserID = 4; //app manager or group owner + string OwnerUserID = 5; //owner + + } message CreateGroupResp{ - int32 ErrorCode = 1; - string ErrorMsg = 2; - string groupID = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + server_api_params.GroupInfo GroupInfo = 3; } + message GetGroupsInfoReq{ - repeated string groupIDList = 1; - string token = 2; - string operationID = 3; + repeated string GroupIDList = 1; + string OperationID = 2; + string OpUserID = 3; //No verification permission } message GetGroupsInfoResp{ - int32 ErrorCode = 1; - string ErrorMsg = 2; - repeated GroupInfo data = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupInfo GroupInfoList = 3; } + message SetGroupInfoReq{ - string groupID = 1; - string groupName = 2; - string notification = 3; - string introduction = 4; - string faceUrl = 5; - string token = 6; - string operationID = 7; + server_api_params.GroupInfo GroupInfo = 1; + string OpUserID = 2; //app manager or group owner + string OperationID = 3; +} +message SetGroupInfoResp{ + CommonResp CommonResp = 1; } message GetGroupApplicationListReq { - string UID = 1; + string OpUserID = 1; //app manager or group owner(manager) string OperationID = 2; + string FromUserID = 3; //owner or manager } - -message GetGroupApplicationList_Data_User { - string ID = 1; - string GroupID = 2; - string FromUserID = 3; - string ToUserID = 4; - int32 Flag = 5; - string RequestMsg = 6; - string HandledMsg = 7; - int64 AddTime = 8; - string FromUserNickname = 9; - string ToUserNickname = 10; - string FromUserFaceUrl = 11; - string ToUserFaceUrl = 12; - string HandledUser = 13; - int32 Type = 14; - int32 HandleStatus = 15; - int32 HandleResult = 16; -} - -message GetGroupApplicationListData { - int32 Count = 1; - repeated GetGroupApplicationList_Data_User User = 2; -} - message GetGroupApplicationListResp { int32 ErrCode = 1; string ErrMsg = 2; - GetGroupApplicationListData Data = 3; + repeated server_api_params.GroupRequest GroupRequestList = 3; } +message GetUserReqApplicationListReq{ + string UserID = 1; + string OpUserID = 2; + string OperationID = 3; +} + +message GetUserReqApplicationListResp{ + CommonResp CommonResp = 1; + repeated server_api_params.GroupRequest GroupRequestList = 2; +} + + message TransferGroupOwnerReq { string GroupID = 1; - string OldOwner = 2; - string NewOwner = 3; + string OldOwnerUserID = 2; + string NewOwnerUserID = 3; string OperationID = 4; + string OpUserID = 5; //app manager or group owner } - message TransferGroupOwnerResp{ - int32 ErrCode = 1; - string ErrMsg = 2; + CommonResp CommonResp = 1; } message JoinGroupReq{ - string groupID = 1; - string message = 2; - string token = 3; + string GroupID = 1; + string ReqMessage = 2; + string OpUserID = 3; string OperationID = 4; } +message JoinGroupResp{ + CommonResp CommonResp = 1; +} + message GroupApplicationResponseReq{ string OperationID = 1; - string OwnerID = 2; + string OpUserID = 2; string GroupID = 3; - string FromUserID = 4; - string FromUserNickName = 5; - string FromUserFaceUrl = 6; - string ToUserID = 7; - string ToUserNickName = 8; - string ToUserFaceUrl = 9; - int64 AddTime = 10; - string RequestMsg = 11; - string HandledMsg = 12; - int32 Type = 13; - int32 HandleStatus = 14; - int32 HandleResult = 15; + string FromUserID = 4; // + string HandledMsg = 5; + int32 HandleResult = 6; } - message GroupApplicationResponseResp{ - int32 ErrCode = 1; - string ErrMsg = 2; + CommonResp CommonResp = 1; } -message SetOwnerGroupNickNameReq{ - string groupID = 1; - string nickName = 2; - string OperationID = 3; - string token = 4; -} - message QuitGroupReq{ - string groupID = 1; - string operationID = 2; - string token = 3; + string GroupID = 1; + string OperationID = 2; + string OpUserID = 3; +} +message QuitGroupResp{ + CommonResp CommonResp = 1; } -message GroupApplicationUserInfo{ - string groupID = 1; - string uid = 2; - string name = 3; - string icon = 4; - string reqMsg = 5; - int64 applicationTime = 6; - int32 flag = 7; - string operatorID = 8; - string handledMsg = 9; -} - -message GroupMemberFullInfo { - string userId = 1; - int32 role = 2; - uint64 joinTime = 3; - string nickName = 4; - string faceUrl = 5; -} message GetGroupMemberListReq { - string groupID = 1; - string token = 2; - string operationID = 3; - int32 filter = 4; - int32 nextSeq = 5; + string GroupID = 1; + string OpUserID = 2; //No verification permission + string OperationID = 3; + int32 Filter = 4; + int32 NextSeq = 5; } message GetGroupMemberListResp { - int32 errorCode = 1; - string errorMsg = 2; - repeated GroupMemberFullInfo memberList = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupMemberFullInfo memberList = 3; int32 nextSeq = 4; } - message GetGroupMembersInfoReq { - string groupID = 1; + string GroupID = 1; repeated string memberList = 2; - string token = 3; - string operationID = 4; + string OpUserID = 3; //No verification permission + string OperationID = 4; } message GetGroupMembersInfoResp { - int32 errorCode = 1; - string errorMsg = 2; - repeated GroupMemberFullInfo memberList = 3; - + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupMemberFullInfo memberList = 3; } message KickGroupMemberReq { - string groupID = 1; - repeated GroupMemberFullInfo uidListInfo = 2; - string reason = 3; - string token = 4; - string operationID = 5; + string GroupID = 1; + repeated string KickedUserIDList = 2; + string Reason = 3; + string OperationID = 5; + string OpUserID = 6; //app manger or group manager } message Id2Result { - string uId = 1; - int32 result = 2; //0 ok; -1 error + string UserID = 1; + int32 Result = 2; //0 ok; -1 error } message KickGroupMemberResp { - int32 errorCode = 1; - string errorMsg = 2; - repeated Id2Result id2result = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + repeated Id2Result Id2ResultList = 3; } -message getJoinedGroupListReq { - string token = 1; +message GetJoinedGroupListReq { + string FromUserID = 1; string operationID = 2; + string OpUserID = 3; //app manager or FromUserID } - -message GroupInfo { - string groupId = 1; - string groupName = 2; - string notification = 3; - string introduction = 4; - string faceUrl = 5; - uint64 createTime = 6; - string ownerId = 7; - uint32 memberCount = 8; -} - -message getJoinedGroupListResp{ - int32 errorCode = 1; - string errorMsg = 2; - repeated GroupInfo groupList = 3; +message GetJoinedGroupListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupInfo GroupList = 3; } -message inviteUserToGroupReq { - string token = 1; - string operationID = 2; - string groupID = 3; - string reason = 4; - repeated string uidList = 5; +message InviteUserToGroupReq { + string OperationID = 2; + string GroupID = 3; + string Reason = 4; + repeated string InvitedUserIDList = 5; + string OpUserID = 6; //group member or app manager +} +message InviteUserToGroupResp { + int32 ErrCode = 1; + string ErrMsg = 2; + repeated Id2Result Id2ResultList = 3; // 0 ok, -1 error } -message inviteUserToGroupResp { - int32 errorCode = 1; - string errorMsg = 2; - repeated Id2Result id2result = 3; // 0 ok, -1 error -} message GetGroupAllMemberReq { - string groupID = 1; - string token = 2; - string operationID = 3; + string GroupID = 1; + string OpUserID = 2; //No verification permission + string OperationID = 3; } - message GetGroupAllMemberResp { - int32 errorCode = 1; - string errorMsg = 2; - repeated GroupMemberFullInfo memberList = 3; + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupMemberFullInfo memberList = 3; } +message CMSGroup { + server_api_params.GroupInfo GroupInfo = 1; + string GroupMasterName = 2; + string GroupMasterId = 3; +} + +message GetGroupReq { + string GroupName = 1; + server_api_params.RequestPagination Pagination = 2; + string OperationID = 3; +} + +message GetGroupResp { + repeated CMSGroup CMSGroups = 1; + server_api_params.RequestPagination Pagination = 2; + int32 GroupNums = 3; +} + +message GetGroupsReq { + server_api_params.RequestPagination Pagination = 1; + string OperationID = 2; +} + +message GetGroupsResp { + repeated CMSGroup CMSGroups = 1; + server_api_params.RequestPagination Pagination = 2; + int32 GroupNum = 3; +} + +message GetGroupMemberReq { + string GroupId = 1; + string OperationID = 2; +} + +message OperateGroupStatusReq { + string GroupId = 1; + int32 Status = 2; + string OperationID = 3; +} + +message OperateGroupStatusResp { + +} + +message OperateUserRoleReq { + string GroupId = 1; + string UserId = 2; + int32 RoleLevel = 3; + string OperationID = 4; +} + +message OperateUserRoleResp { + +} + +message DeleteGroupReq { + string GroupId = 1; + string OperationID = 2; +} + +message DeleteGroupResp { + +} + +message GetGroupByIdReq { + string GroupId = 1; + string OperationID = 2; +} + +message GetGroupByIdResp { + CMSGroup CMSGroup = 1; +} + +message GetGroupMembersCMSReq { + string GroupId = 1; + string UserName = 2; + server_api_params.RequestPagination Pagination = 3; + string OperationID = 4; +} + +message GetGroupMembersCMSResp { + repeated server_api_params.GroupMemberFullInfo members = 1; + server_api_params.ResponsePagination Pagination = 2; + int32 MemberNums = 3; +} + +message RemoveGroupMembersCMSReq { + string GroupId = 1; + repeated string UserIds = 2; + string OperationID = 3; + string OpUserId = 4; +} + +message RemoveGroupMembersCMSResp { + repeated string success = 1; + repeated string failed = 2; +} + +message AddGroupMembersCMSReq { + string GroupId = 1; + repeated string UserIds = 2; + string OperationId = 3; + string OpUserId = 4; +} + +message AddGroupMembersCMSResp { + repeated string success = 1; + repeated string failed = 2; +} service group{ rpc createGroup(CreateGroupReq) returns(CreateGroupResp); - rpc joinGroup(JoinGroupReq) returns(CommonResp); - rpc quitGroup(QuitGroupReq) returns(CommonResp); + rpc joinGroup(JoinGroupReq) returns(JoinGroupResp); + rpc quitGroup(QuitGroupReq) returns(QuitGroupResp); rpc getGroupsInfo(GetGroupsInfoReq) returns(GetGroupsInfoResp); - rpc setGroupInfo(SetGroupInfoReq) returns(CommonResp); + rpc setGroupInfo(SetGroupInfoReq) returns(SetGroupInfoResp); rpc getGroupApplicationList(GetGroupApplicationListReq) returns(GetGroupApplicationListResp); + rpc getUserReqApplicationList(GetUserReqApplicationListReq) returns(GetUserReqApplicationListResp); rpc transferGroupOwner(TransferGroupOwnerReq) returns(TransferGroupOwnerResp); rpc groupApplicationResponse(GroupApplicationResponseReq) returns(GroupApplicationResponseResp); - // rpc setOwnerGroupNickName(SetOwnerGroupNickNameReq) returns(CommonResp); rpc getGroupMemberList(GetGroupMemberListReq) returns(GetGroupMemberListResp); rpc getGroupMembersInfo(GetGroupMembersInfoReq) returns(GetGroupMembersInfoResp); rpc kickGroupMember(KickGroupMemberReq) returns (KickGroupMemberResp); - rpc getJoinedGroupList(getJoinedGroupListReq) returns (getJoinedGroupListResp); - rpc inviteUserToGroup(inviteUserToGroupReq) returns (inviteUserToGroupResp); - + rpc getJoinedGroupList(GetJoinedGroupListReq) returns (GetJoinedGroupListResp); + rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp); rpc getGroupAllMember(GetGroupAllMemberReq) returns(GetGroupAllMemberResp); + + rpc GetGroupById(GetGroupByIdReq) returns(GetGroupByIdResp); + rpc GetGroup(GetGroupReq) returns(GetGroupResp); + rpc GetGroups(GetGroupsReq) returns(GetGroupsResp); + rpc OperateGroupStatus(OperateGroupStatusReq) returns(OperateGroupStatusResp); + rpc OperateUserRole(OperateUserRoleReq) returns(OperateUserRoleResp); + rpc DeleteGroup(DeleteGroupReq) returns(DeleteGroupResp); + rpc GetGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp); + rpc RemoveGroupMembersCMS(RemoveGroupMembersCMSReq) returns(RemoveGroupMembersCMSResp); + rpc AddGroupMembersCMS(AddGroupMembersCMSReq) returns(AddGroupMembersCMSResp); } diff --git a/pkg/proto/message_cms/message_cms.pb.go b/pkg/proto/message_cms/message_cms.pb.go new file mode 100644 index 000000000..317439903 --- /dev/null +++ b/pkg/proto/message_cms/message_cms.pb.go @@ -0,0 +1,1083 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.15.5 +// source: message_cms/message_cms.proto + +package message_cms + +import ( + sdk_ws "Open_IM/pkg/proto/sdk_ws" + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BoradcastMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *BoradcastMessageReq) Reset() { + *x = BoradcastMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BoradcastMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoradcastMessageReq) ProtoMessage() {} + +func (x *BoradcastMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoradcastMessageReq.ProtoReflect.Descriptor instead. +func (*BoradcastMessageReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{0} +} + +func (x *BoradcastMessageReq) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *BoradcastMessageReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type BoradcastMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BoradcastMessageResp) Reset() { + *x = BoradcastMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BoradcastMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoradcastMessageResp) ProtoMessage() {} + +func (x *BoradcastMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoradcastMessageResp.ProtoReflect.Descriptor instead. +func (*BoradcastMessageResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{1} +} + +type MassSendMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"` + UserIds []string `protobuf:"bytes,2,rep,name=UserIds,proto3" json:"UserIds,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *MassSendMessageReq) Reset() { + *x = MassSendMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MassSendMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MassSendMessageReq) ProtoMessage() {} + +func (x *MassSendMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MassSendMessageReq.ProtoReflect.Descriptor instead. +func (*MassSendMessageReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{2} +} + +func (x *MassSendMessageReq) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *MassSendMessageReq) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +func (x *MassSendMessageReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type MassSendMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MassSendMessageResp) Reset() { + *x = MassSendMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MassSendMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MassSendMessageResp) ProtoMessage() {} + +func (x *MassSendMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MassSendMessageResp.ProtoReflect.Descriptor instead. +func (*MassSendMessageResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{3} +} + +type GetChatLogsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Content string `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId,omitempty"` + GroupId string `protobuf:"bytes,3,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + Date string `protobuf:"bytes,4,opt,name=Date,proto3" json:"Date,omitempty"` + SessionType int32 `protobuf:"varint,5,opt,name=SessionType,proto3" json:"SessionType,omitempty"` + ContentType int32 `protobuf:"varint,6,opt,name=ContentType,proto3" json:"ContentType,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,7,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,8,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetChatLogsReq) Reset() { + *x = GetChatLogsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetChatLogsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChatLogsReq) ProtoMessage() {} + +func (x *GetChatLogsReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChatLogsReq.ProtoReflect.Descriptor instead. +func (*GetChatLogsReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{4} +} + +func (x *GetChatLogsReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *GetChatLogsReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetChatLogsReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GetChatLogsReq) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *GetChatLogsReq) GetSessionType() int32 { + if x != nil { + return x.SessionType + } + return 0 +} + +func (x *GetChatLogsReq) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + +func (x *GetChatLogsReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetChatLogsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type ChatLogs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SessionType int32 `protobuf:"varint,1,opt,name=SessionType,proto3" json:"SessionType,omitempty"` + ContentType int32 `protobuf:"varint,2,opt,name=ContentType,proto3" json:"ContentType,omitempty"` + SenderNickName string `protobuf:"bytes,3,opt,name=SenderNickName,proto3" json:"SenderNickName,omitempty"` + SenderId string `protobuf:"bytes,4,opt,name=SenderId,proto3" json:"SenderId,omitempty"` + ReciverNickName string `protobuf:"bytes,5,opt,name=ReciverNickName,proto3" json:"ReciverNickName,omitempty"` + ReciverId string `protobuf:"bytes,6,opt,name=ReciverId,proto3" json:"ReciverId,omitempty"` + SearchContent string `protobuf:"bytes,7,opt,name=SearchContent,proto3" json:"SearchContent,omitempty"` + WholeContent string `protobuf:"bytes,8,opt,name=WholeContent,proto3" json:"WholeContent,omitempty"` + GroupId string `protobuf:"bytes,9,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + GroupName string `protobuf:"bytes,10,opt,name=GroupName,proto3" json:"GroupName,omitempty"` + Date string `protobuf:"bytes,11,opt,name=Date,proto3" json:"Date,omitempty"` +} + +func (x *ChatLogs) Reset() { + *x = ChatLogs{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatLogs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatLogs) ProtoMessage() {} + +func (x *ChatLogs) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChatLogs.ProtoReflect.Descriptor instead. +func (*ChatLogs) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{5} +} + +func (x *ChatLogs) GetSessionType() int32 { + if x != nil { + return x.SessionType + } + return 0 +} + +func (x *ChatLogs) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + +func (x *ChatLogs) GetSenderNickName() string { + if x != nil { + return x.SenderNickName + } + return "" +} + +func (x *ChatLogs) GetSenderId() string { + if x != nil { + return x.SenderId + } + return "" +} + +func (x *ChatLogs) GetReciverNickName() string { + if x != nil { + return x.ReciverNickName + } + return "" +} + +func (x *ChatLogs) GetReciverId() string { + if x != nil { + return x.ReciverId + } + return "" +} + +func (x *ChatLogs) GetSearchContent() string { + if x != nil { + return x.SearchContent + } + return "" +} + +func (x *ChatLogs) GetWholeContent() string { + if x != nil { + return x.WholeContent + } + return "" +} + +func (x *ChatLogs) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *ChatLogs) GetGroupName() string { + if x != nil { + return x.GroupName + } + return "" +} + +func (x *ChatLogs) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +type GetChatLogsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChatLogs []*ChatLogs `protobuf:"bytes,1,rep,name=ChatLogs,proto3" json:"ChatLogs,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + ChatLogsNum int32 `protobuf:"varint,3,opt,name=ChatLogsNum,proto3" json:"ChatLogsNum,omitempty"` +} + +func (x *GetChatLogsResp) Reset() { + *x = GetChatLogsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetChatLogsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChatLogsResp) ProtoMessage() {} + +func (x *GetChatLogsResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChatLogsResp.ProtoReflect.Descriptor instead. +func (*GetChatLogsResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{6} +} + +func (x *GetChatLogsResp) GetChatLogs() []*ChatLogs { + if x != nil { + return x.ChatLogs + } + return nil +} + +func (x *GetChatLogsResp) GetPagination() *sdk_ws.ResponsePagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetChatLogsResp) GetChatLogsNum() int32 { + if x != nil { + return x.ChatLogsNum + } + return 0 +} + +type WithdrawMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerMsgId string `protobuf:"bytes,1,opt,name=ServerMsgId,proto3" json:"ServerMsgId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *WithdrawMessageReq) Reset() { + *x = WithdrawMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithdrawMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithdrawMessageReq) ProtoMessage() {} + +func (x *WithdrawMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WithdrawMessageReq.ProtoReflect.Descriptor instead. +func (*WithdrawMessageReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{7} +} + +func (x *WithdrawMessageReq) GetServerMsgId() string { + if x != nil { + return x.ServerMsgId + } + return "" +} + +func (x *WithdrawMessageReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type WithdrawMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WithdrawMessageResp) Reset() { + *x = WithdrawMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithdrawMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithdrawMessageResp) ProtoMessage() {} + +func (x *WithdrawMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WithdrawMessageResp.ProtoReflect.Descriptor instead. +func (*WithdrawMessageResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{8} +} + +var File_message_cms_message_cms_proto protoreflect.FileDescriptor + +var file_message_cms_message_cms_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x1a, 0x21, 0x4f, 0x70, + 0x65, 0x6e, 0x5f, 0x49, 0x4d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x64, 0x6b, 0x5f, 0x77, 0x73, 0x2f, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x51, 0x0a, 0x13, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x22, 0x16, 0x0a, 0x14, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x61, + 0x73, 0x73, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x61, 0x73, 0x73, 0x53, 0x65, + 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x9c, 0x02, + 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x44, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xf0, 0x02, 0x0a, + 0x08, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, + 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, + 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x69, 0x76, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x52, 0x65, 0x63, 0x69, + 0x76, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x52, + 0x65, 0x63, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x52, 0x65, 0x63, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x22, 0x0a, 0x0c, 0x57, 0x68, 0x6f, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x57, 0x68, 0x6f, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x44, + 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, 0x22, + 0xad, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6d, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x08, 0x43, 0x68, + 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, + 0x0b, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x4e, 0x75, 0x6d, 0x22, + 0x58, 0x0a, 0x12, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, + 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x15, 0x0a, 0x13, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x4d, 0x53, 0x12, + 0x57, 0x0a, 0x10, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, + 0x73, 0x2e, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6d, 0x73, 0x2e, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x4d, 0x61, 0x73, 0x73, + 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x4d, 0x61, 0x73, 0x73, 0x53, 0x65, + 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x4d, 0x61, 0x73, 0x73, 0x53, + 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, + 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x1b, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, + 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x1b, + 0x5a, 0x19, 0x2e, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x3b, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_message_cms_message_cms_proto_rawDescOnce sync.Once + file_message_cms_message_cms_proto_rawDescData = file_message_cms_message_cms_proto_rawDesc +) + +func file_message_cms_message_cms_proto_rawDescGZIP() []byte { + file_message_cms_message_cms_proto_rawDescOnce.Do(func() { + file_message_cms_message_cms_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_cms_message_cms_proto_rawDescData) + }) + return file_message_cms_message_cms_proto_rawDescData +} + +var file_message_cms_message_cms_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_message_cms_message_cms_proto_goTypes = []interface{}{ + (*BoradcastMessageReq)(nil), // 0: message_cms.BoradcastMessageReq + (*BoradcastMessageResp)(nil), // 1: message_cms.BoradcastMessageResp + (*MassSendMessageReq)(nil), // 2: message_cms.MassSendMessageReq + (*MassSendMessageResp)(nil), // 3: message_cms.MassSendMessageResp + (*GetChatLogsReq)(nil), // 4: message_cms.GetChatLogsReq + (*ChatLogs)(nil), // 5: message_cms.ChatLogs + (*GetChatLogsResp)(nil), // 6: message_cms.GetChatLogsResp + (*WithdrawMessageReq)(nil), // 7: message_cms.WithdrawMessageReq + (*WithdrawMessageResp)(nil), // 8: message_cms.WithdrawMessageResp + (*sdk_ws.RequestPagination)(nil), // 9: server_api_params.RequestPagination + (*sdk_ws.ResponsePagination)(nil), // 10: server_api_params.ResponsePagination +} +var file_message_cms_message_cms_proto_depIdxs = []int32{ + 9, // 0: message_cms.GetChatLogsReq.Pagination:type_name -> server_api_params.RequestPagination + 5, // 1: message_cms.GetChatLogsResp.ChatLogs:type_name -> message_cms.ChatLogs + 10, // 2: message_cms.GetChatLogsResp.Pagination:type_name -> server_api_params.ResponsePagination + 0, // 3: message_cms.messageCMS.BoradcastMessage:input_type -> message_cms.BoradcastMessageReq + 2, // 4: message_cms.messageCMS.MassSendMessage:input_type -> message_cms.MassSendMessageReq + 4, // 5: message_cms.messageCMS.GetChatLogs:input_type -> message_cms.GetChatLogsReq + 7, // 6: message_cms.messageCMS.WithdrawMessage:input_type -> message_cms.WithdrawMessageReq + 1, // 7: message_cms.messageCMS.BoradcastMessage:output_type -> message_cms.BoradcastMessageResp + 3, // 8: message_cms.messageCMS.MassSendMessage:output_type -> message_cms.MassSendMessageResp + 6, // 9: message_cms.messageCMS.GetChatLogs:output_type -> message_cms.GetChatLogsResp + 8, // 10: message_cms.messageCMS.WithdrawMessage:output_type -> message_cms.WithdrawMessageResp + 7, // [7:11] is the sub-list for method output_type + 3, // [3:7] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_message_cms_message_cms_proto_init() } +func file_message_cms_message_cms_proto_init() { + if File_message_cms_message_cms_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_cms_message_cms_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BoradcastMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BoradcastMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MassSendMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MassSendMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetChatLogsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatLogs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetChatLogsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_cms_message_cms_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_message_cms_message_cms_proto_goTypes, + DependencyIndexes: file_message_cms_message_cms_proto_depIdxs, + MessageInfos: file_message_cms_message_cms_proto_msgTypes, + }.Build() + File_message_cms_message_cms_proto = out.File + file_message_cms_message_cms_proto_rawDesc = nil + file_message_cms_message_cms_proto_goTypes = nil + file_message_cms_message_cms_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// MessageCMSClient is the client API for MessageCMS service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MessageCMSClient interface { + BoradcastMessage(ctx context.Context, in *BoradcastMessageReq, opts ...grpc.CallOption) (*BoradcastMessageResp, error) + MassSendMessage(ctx context.Context, in *MassSendMessageReq, opts ...grpc.CallOption) (*MassSendMessageResp, error) + GetChatLogs(ctx context.Context, in *GetChatLogsReq, opts ...grpc.CallOption) (*GetChatLogsResp, error) + WithdrawMessage(ctx context.Context, in *WithdrawMessageReq, opts ...grpc.CallOption) (*WithdrawMessageResp, error) +} + +type messageCMSClient struct { + cc grpc.ClientConnInterface +} + +func NewMessageCMSClient(cc grpc.ClientConnInterface) MessageCMSClient { + return &messageCMSClient{cc} +} + +func (c *messageCMSClient) BoradcastMessage(ctx context.Context, in *BoradcastMessageReq, opts ...grpc.CallOption) (*BoradcastMessageResp, error) { + out := new(BoradcastMessageResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/BoradcastMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageCMSClient) MassSendMessage(ctx context.Context, in *MassSendMessageReq, opts ...grpc.CallOption) (*MassSendMessageResp, error) { + out := new(MassSendMessageResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/MassSendMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageCMSClient) GetChatLogs(ctx context.Context, in *GetChatLogsReq, opts ...grpc.CallOption) (*GetChatLogsResp, error) { + out := new(GetChatLogsResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/GetChatLogs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageCMSClient) WithdrawMessage(ctx context.Context, in *WithdrawMessageReq, opts ...grpc.CallOption) (*WithdrawMessageResp, error) { + out := new(WithdrawMessageResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/WithdrawMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MessageCMSServer is the server API for MessageCMS service. +type MessageCMSServer interface { + BoradcastMessage(context.Context, *BoradcastMessageReq) (*BoradcastMessageResp, error) + MassSendMessage(context.Context, *MassSendMessageReq) (*MassSendMessageResp, error) + GetChatLogs(context.Context, *GetChatLogsReq) (*GetChatLogsResp, error) + WithdrawMessage(context.Context, *WithdrawMessageReq) (*WithdrawMessageResp, error) +} + +// UnimplementedMessageCMSServer can be embedded to have forward compatible implementations. +type UnimplementedMessageCMSServer struct { +} + +func (*UnimplementedMessageCMSServer) BoradcastMessage(context.Context, *BoradcastMessageReq) (*BoradcastMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method BoradcastMessage not implemented") +} +func (*UnimplementedMessageCMSServer) MassSendMessage(context.Context, *MassSendMessageReq) (*MassSendMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method MassSendMessage not implemented") +} +func (*UnimplementedMessageCMSServer) GetChatLogs(context.Context, *GetChatLogsReq) (*GetChatLogsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChatLogs not implemented") +} +func (*UnimplementedMessageCMSServer) WithdrawMessage(context.Context, *WithdrawMessageReq) (*WithdrawMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawMessage not implemented") +} + +func RegisterMessageCMSServer(s *grpc.Server, srv MessageCMSServer) { + s.RegisterService(&_MessageCMS_serviceDesc, srv) +} + +func _MessageCMS_BoradcastMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BoradcastMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).BoradcastMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/BoradcastMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).BoradcastMessage(ctx, req.(*BoradcastMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageCMS_MassSendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MassSendMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).MassSendMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/MassSendMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).MassSendMessage(ctx, req.(*MassSendMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageCMS_GetChatLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetChatLogsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).GetChatLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/GetChatLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).GetChatLogs(ctx, req.(*GetChatLogsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageCMS_WithdrawMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WithdrawMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).WithdrawMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/WithdrawMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).WithdrawMessage(ctx, req.(*WithdrawMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _MessageCMS_serviceDesc = grpc.ServiceDesc{ + ServiceName: "message_cms.messageCMS", + HandlerType: (*MessageCMSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BoradcastMessage", + Handler: _MessageCMS_BoradcastMessage_Handler, + }, + { + MethodName: "MassSendMessage", + Handler: _MessageCMS_MassSendMessage_Handler, + }, + { + MethodName: "GetChatLogs", + Handler: _MessageCMS_GetChatLogs_Handler, + }, + { + MethodName: "WithdrawMessage", + Handler: _MessageCMS_WithdrawMessage_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "message_cms/message_cms.proto", +} diff --git a/pkg/proto/message_cms/message_cms.proto b/pkg/proto/message_cms/message_cms.proto new file mode 100644 index 000000000..2a9647bb7 --- /dev/null +++ b/pkg/proto/message_cms/message_cms.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./message_cms;message_cms"; +package message_cms; + +message BoradcastMessageReq { + string Message = 1; + string OperationID = 2; +} + +message BoradcastMessageResp { + +} + +message MassSendMessageReq { + string Message = 1; + repeated string UserIds = 2; + string OperationID = 3; +} + +message MassSendMessageResp { + +} + +message GetChatLogsReq { + string Content = 1; + string UserId = 2; + string GroupId = 3; + string Date = 4; + int32 SessionType = 5; + int32 ContentType = 6; + server_api_params.RequestPagination Pagination = 7; + string OperationID = 8; + +} + +message ChatLogs { + int32 SessionType = 1; + int32 ContentType = 2; + string SenderNickName = 3; + string SenderId = 4; + string ReciverNickName = 5; + string ReciverId = 6; + string SearchContent = 7; + string WholeContent = 8; + string GroupId = 9; + string GroupName = 10; + string Date = 11; +} + +message GetChatLogsResp { + repeated ChatLogs ChatLogs = 1; + server_api_params.ResponsePagination Pagination = 2; + int32 ChatLogsNum = 3; +} + +message WithdrawMessageReq { + string ServerMsgId = 1; + string OperationID = 2; +} + +message WithdrawMessageResp { + +} + +service messageCMS { + rpc BoradcastMessage(BoradcastMessageReq) returns(BoradcastMessageResp); + rpc MassSendMessage(MassSendMessageReq) returns(MassSendMessageResp); + rpc GetChatLogs(GetChatLogsReq) returns(GetChatLogsResp); + rpc WithdrawMessage(WithdrawMessageReq) returns(WithdrawMessageResp); +} \ No newline at end of file diff --git a/pkg/proto/proto_dir.cfg b/pkg/proto/proto_dir.cfg index 1ad259e8a..4a9853fbd 100644 --- a/pkg/proto/proto_dir.cfg +++ b/pkg/proto/proto_dir.cfg @@ -1,5 +1,8 @@ all_proto=( + message_cms/message_cms.proto + admin_cms/admin_cms.proto + statistics/statistics.proto auth/auth.proto friend/friend.proto group/group.proto @@ -8,4 +11,5 @@ all_proto=( push/push.proto relay/relay.proto sdk_ws/ws.proto + ) diff --git a/pkg/proto/push/push.pb.go b/pkg/proto/push/push.pb.go index 2fdbd2f53..e9354ae69 100644 --- a/pkg/proto/push/push.pb.go +++ b/pkg/proto/push/push.pb.go @@ -6,6 +6,7 @@ package pbPush // import "./push" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" import ( context "golang.org/x/net/context" @@ -24,32 +25,19 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type PushMsgReq struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,10,opt,name=MsgID" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,11,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,12,opt,name=Options" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` - SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PushMsgReq) Reset() { *m = PushMsgReq{} } func (m *PushMsgReq) String() string { return proto.CompactTextString(m) } func (*PushMsgReq) ProtoMessage() {} func (*PushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_push_4f08d2ff54ba8af2, []int{0} + return fileDescriptor_push_76409d0b017416ef, []int{0} } func (m *PushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgReq.Unmarshal(m, b) @@ -69,62 +57,6 @@ func (m *PushMsgReq) XXX_DiscardUnknown() { var xxx_messageInfo_PushMsgReq proto.InternalMessageInfo -func (m *PushMsgReq) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *PushMsgReq) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *PushMsgReq) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *PushMsgReq) GetRecvSeq() int64 { - if m != nil { - return m.RecvSeq - } - return 0 -} - -func (m *PushMsgReq) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -func (m *PushMsgReq) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *PushMsgReq) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *PushMsgReq) GetSessionType() int32 { - if m != nil { - return m.SessionType - } - return 0 -} - func (m *PushMsgReq) GetOperationID() string { if m != nil { return m.OperationID @@ -132,51 +64,16 @@ func (m *PushMsgReq) GetOperationID() string { return "" } -func (m *PushMsgReq) GetMsgID() string { +func (m *PushMsgReq) GetMsgData() *sdk_ws.MsgData { if m != nil { - return m.MsgID + return m.MsgData } - return "" + return nil } -func (m *PushMsgReq) GetOfflineInfo() string { +func (m *PushMsgReq) GetPushToUserID() string { if m != nil { - return m.OfflineInfo - } - return "" -} - -func (m *PushMsgReq) GetOptions() string { - if m != nil { - return m.Options - } - return "" -} - -func (m *PushMsgReq) GetPlatformID() int32 { - if m != nil { - return m.PlatformID - } - return 0 -} - -func (m *PushMsgReq) GetSenderNickName() string { - if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *PushMsgReq) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *PushMsgReq) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID + return m.PushToUserID } return "" } @@ -192,7 +89,7 @@ func (m *PushMsgResp) Reset() { *m = PushMsgResp{} } func (m *PushMsgResp) String() string { return proto.CompactTextString(m) } func (*PushMsgResp) ProtoMessage() {} func (*PushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_push_4f08d2ff54ba8af2, []int{1} + return fileDescriptor_push_76409d0b017416ef, []int{1} } func (m *PushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgResp.Unmarshal(m, b) @@ -296,32 +193,24 @@ var _PushMsgService_serviceDesc = grpc.ServiceDesc{ Metadata: "push/push.proto", } -func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_4f08d2ff54ba8af2) } +func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_76409d0b017416ef) } -var fileDescriptor_push_4f08d2ff54ba8af2 = []byte{ - // 378 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5d, 0xeb, 0xda, 0x30, - 0x14, 0xc6, 0xe9, 0xb4, 0xbe, 0x1c, 0xe7, 0xcb, 0xc2, 0x18, 0xc1, 0x8b, 0x51, 0x64, 0x0c, 0x6f, - 0xd6, 0xc1, 0x76, 0xb9, 0x9b, 0x31, 0x8b, 0x50, 0x98, 0x2f, 0xa4, 0xee, 0x66, 0x77, 0xb5, 0x9e, - 0x6a, 0x59, 0x9b, 0xc4, 0xa6, 0x0a, 0xfb, 0xd2, 0xfb, 0x0c, 0x23, 0x49, 0xd5, 0xfe, 0xbd, 0x29, - 0x7d, 0x7e, 0xe7, 0x39, 0x87, 0x27, 0xc9, 0x81, 0xb1, 0xbc, 0xa8, 0xd3, 0x67, 0xfd, 0xf1, 0x65, - 0x29, 0x2a, 0x41, 0xda, 0xfa, 0x7f, 0xf6, 0xaf, 0x05, 0xb0, 0xbd, 0xa8, 0xd3, 0x4a, 0x1d, 0x19, - 0x9e, 0xc9, 0x3b, 0xe8, 0x44, 0xc8, 0x0f, 0x61, 0x40, 0x1d, 0xcf, 0x99, 0xf7, 0x59, 0xad, 0x34, - 0x67, 0x98, 0x5c, 0xc3, 0x80, 0xbe, 0xb2, 0xdc, 0x2a, 0x42, 0xa1, 0xbb, 0x10, 0xbc, 0x42, 0x5e, - 0xd1, 0x96, 0x29, 0xdc, 0xa4, 0xae, 0x68, 0x4f, 0x84, 0x67, 0xda, 0xf6, 0x9c, 0x79, 0x8b, 0xdd, - 0x24, 0x99, 0x42, 0x4f, 0x4f, 0xdd, 0x65, 0x05, 0x52, 0xd7, 0x94, 0xee, 0x5a, 0x77, 0xad, 0xd4, - 0x71, 0x59, 0x8a, 0x82, 0x76, 0x3c, 0x67, 0xee, 0xb2, 0x9b, 0x24, 0x1e, 0x0c, 0xea, 0xd1, 0xbb, - 0xbf, 0x12, 0x69, 0xd7, 0x54, 0x9b, 0x48, 0x3b, 0x22, 0x54, 0x2a, 0x13, 0xdc, 0x38, 0x7a, 0xd6, - 0xd1, 0x40, 0xda, 0xb1, 0x91, 0x58, 0xc6, 0x55, 0x26, 0x78, 0x18, 0xd0, 0xbe, 0x49, 0xdc, 0x44, - 0xe4, 0x2d, 0xb8, 0x2b, 0x75, 0x0c, 0x03, 0x0a, 0xa6, 0x66, 0x85, 0xe9, 0x4b, 0xd3, 0x3c, 0xe3, - 0x18, 0xf2, 0x54, 0xd0, 0x41, 0xdd, 0xf7, 0x40, 0x3a, 0xf7, 0x46, 0xea, 0x19, 0x8a, 0xbe, 0xb6, - 0xf7, 0x50, 0x4b, 0xf2, 0x1e, 0x60, 0x9b, 0xc7, 0x55, 0x2a, 0xca, 0x22, 0x0c, 0xe8, 0xd0, 0x84, - 0x6a, 0x10, 0xf2, 0x11, 0x46, 0xfa, 0xf4, 0x58, 0xae, 0xb3, 0xe4, 0xcf, 0x3a, 0x2e, 0x90, 0x8e, - 0xcc, 0x80, 0x27, 0x4a, 0x3e, 0xc0, 0xd0, 0x92, 0x65, 0x9c, 0xe0, 0x2f, 0xf6, 0x93, 0x8e, 0x8d, - 0xed, 0x25, 0x34, 0xb7, 0x94, 0x67, 0xc8, 0x2b, 0x7b, 0x8a, 0x89, 0x4d, 0xda, 0x40, 0xb3, 0x4f, - 0x30, 0xb8, 0xbf, 0xb7, 0x92, 0x3a, 0x1e, 0x43, 0x75, 0xc9, 0xab, 0x85, 0x38, 0xa0, 0x79, 0x74, - 0x97, 0x35, 0xc8, 0x97, 0xef, 0x30, 0xaa, 0xed, 0x11, 0x96, 0xd7, 0x2c, 0x41, 0xe2, 0x43, 0xb7, - 0x26, 0x64, 0xe2, 0x9b, 0x7d, 0x7a, 0xec, 0xcf, 0xf4, 0xcd, 0x13, 0x51, 0xf2, 0xc7, 0xf8, 0xf7, - 0xd0, 0x37, 0x7b, 0xf7, 0x4d, 0xee, 0x35, 0xdf, 0x77, 0xcc, 0xfe, 0x7d, 0xfd, 0x1f, 0x00, 0x00, - 0xff, 0xff, 0x6b, 0x53, 0xf4, 0xd4, 0x92, 0x02, 0x00, 0x00, +var fileDescriptor_push_76409d0b017416ef = []byte{ + // 249 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x3d, 0x4f, 0xc3, 0x30, + 0x10, 0x86, 0x15, 0xbe, 0x2a, 0x2e, 0x40, 0xc1, 0x53, 0x94, 0x01, 0x85, 0x4c, 0x5d, 0xb0, 0xa5, + 0xc2, 0xc6, 0x82, 0x20, 0x4b, 0x86, 0x08, 0x64, 0x60, 0x61, 0x89, 0x5c, 0x7a, 0x4a, 0xa3, 0xd2, + 0xfa, 0xf0, 0x25, 0xed, 0x5f, 0xe0, 0x67, 0xa3, 0xb8, 0x05, 0x02, 0x8b, 0x65, 0x3d, 0xf7, 0xe8, + 0xf4, 0xde, 0x0b, 0x43, 0x6a, 0x79, 0xa6, 0xba, 0x47, 0x92, 0xb3, 0x8d, 0x15, 0x7b, 0xdd, 0x3f, + 0xbe, 0x78, 0x20, 0x5c, 0x96, 0x79, 0xa1, 0x68, 0x5e, 0x29, 0x3f, 0x50, 0x3c, 0x9d, 0x97, 0x6b, + 0x56, 0x6b, 0xde, 0x88, 0xe9, 0x67, 0x00, 0xf0, 0xd8, 0xf2, 0xac, 0xe0, 0x4a, 0xe3, 0x87, 0x48, + 0x20, 0xb4, 0x84, 0xce, 0x34, 0xb5, 0x5d, 0xe6, 0x59, 0x14, 0x24, 0xc1, 0xe8, 0x50, 0xf7, 0x91, + 0xb8, 0x86, 0xc1, 0x82, 0xab, 0xcc, 0x34, 0x26, 0xda, 0x49, 0x82, 0x51, 0x38, 0x8e, 0x25, 0xa3, + 0x5b, 0xa1, 0x2b, 0x0d, 0xd5, 0x25, 0x19, 0x67, 0x16, 0x2c, 0x8b, 0x8d, 0xa1, 0xbf, 0x55, 0x91, + 0xc2, 0x51, 0x97, 0xe8, 0xd9, 0xbe, 0x30, 0xba, 0x3c, 0x8b, 0x76, 0xfd, 0xe2, 0x3f, 0x2c, 0xbd, + 0x84, 0xf0, 0x27, 0x09, 0x93, 0x38, 0x07, 0xd0, 0xc8, 0xed, 0x7b, 0x73, 0x6f, 0xa7, 0xe8, 0x93, + 0xec, 0xeb, 0x1e, 0x19, 0xdf, 0xc2, 0xc9, 0x56, 0x7f, 0x42, 0xb7, 0xaa, 0xdf, 0x50, 0x48, 0x18, + 0x6c, 0x89, 0x38, 0x95, 0xbe, 0x8c, 0xdf, 0xcb, 0xe2, 0xb3, 0x7f, 0x84, 0xe9, 0x6e, 0xf8, 0x7a, + 0x2c, 0x7d, 0x69, 0x37, 0x34, 0xe9, 0xf8, 0xe4, 0xc0, 0x77, 0x72, 0xf5, 0x15, 0x00, 0x00, 0xff, + 0xff, 0xbe, 0xb7, 0x7c, 0x1c, 0x4f, 0x01, 0x00, 0x00, } diff --git a/pkg/proto/push/push.proto b/pkg/proto/push/push.proto index 60fddfe3b..5d91083b3 100644 --- a/pkg/proto/push/push.proto +++ b/pkg/proto/push/push.proto @@ -1,24 +1,12 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; option go_package = "./push;pbPush"; package push; message PushMsgReq { - string SendID = 1; - string RecvID = 2; - string Content = 3; - int64 RecvSeq = 4; - int64 SendTime = 5; - int32 MsgFrom = 6; - int32 ContentType = 7; - int32 SessionType = 8; - string OperationID = 9; - string MsgID = 10; - string OfflineInfo = 11; - string Options =12; - int32 PlatformID =13; - string SenderNickName = 14; - string SenderFaceURL = 15; - string ClientMsgID = 16; + string operationID = 1; + server_api_params.MsgData msgData = 2; + string pushToUserID = 3; } message PushMsgResp{ int32 ResultCode = 1; diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go index 32fcc227c..37334a8b2 100644 --- a/pkg/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -6,6 +6,7 @@ package pbRelay // import "./relay" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" import ( context "golang.org/x/net/context" @@ -23,197 +24,98 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package -type MsgToUserReq struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,5,opt,name=Content" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,6,opt,name=RecvSeq" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,7,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,8,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` - ServerMsgID string `protobuf:"bytes,12,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` - PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` - SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type OnlinePushMsgReq struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *MsgToUserReq) Reset() { *m = MsgToUserReq{} } -func (m *MsgToUserReq) String() string { return proto.CompactTextString(m) } -func (*MsgToUserReq) ProtoMessage() {} -func (*MsgToUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_ff2396ffa84abfa7, []int{0} +func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} } +func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) } +func (*OnlinePushMsgReq) ProtoMessage() {} +func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{0} } -func (m *MsgToUserReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgToUserReq.Unmarshal(m, b) +func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) } -func (m *MsgToUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgToUserReq.Marshal(b, m, deterministic) +func (m *OnlinePushMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlinePushMsgReq.Marshal(b, m, deterministic) } -func (dst *MsgToUserReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgToUserReq.Merge(dst, src) +func (dst *OnlinePushMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlinePushMsgReq.Merge(dst, src) } -func (m *MsgToUserReq) XXX_Size() int { - return xxx_messageInfo_MsgToUserReq.Size(m) +func (m *OnlinePushMsgReq) XXX_Size() int { + return xxx_messageInfo_OnlinePushMsgReq.Size(m) } -func (m *MsgToUserReq) XXX_DiscardUnknown() { - xxx_messageInfo_MsgToUserReq.DiscardUnknown(m) +func (m *OnlinePushMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_OnlinePushMsgReq.DiscardUnknown(m) } -var xxx_messageInfo_MsgToUserReq proto.InternalMessageInfo +var xxx_messageInfo_OnlinePushMsgReq proto.InternalMessageInfo -func (m *MsgToUserReq) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *MsgToUserReq) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *MsgToUserReq) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *MsgToUserReq) GetRecvSeq() int64 { - if m != nil { - return m.RecvSeq - } - return 0 -} - -func (m *MsgToUserReq) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -func (m *MsgToUserReq) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *MsgToUserReq) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *MsgToUserReq) GetSessionType() int32 { - if m != nil { - return m.SessionType - } - return 0 -} - -func (m *MsgToUserReq) GetOperationID() string { +func (m *OnlinePushMsgReq) GetOperationID() string { if m != nil { return m.OperationID } return "" } -func (m *MsgToUserReq) GetServerMsgID() string { +func (m *OnlinePushMsgReq) GetMsgData() *sdk_ws.MsgData { if m != nil { - return m.ServerMsgID + return m.MsgData + } + return nil +} + +func (m *OnlinePushMsgReq) GetPushToUserID() string { + if m != nil { + return m.PushToUserID } return "" } -func (m *MsgToUserReq) GetPlatformID() int32 { - if m != nil { - return m.PlatformID - } - return 0 -} - -func (m *MsgToUserReq) GetSenderNickName() string { - if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *MsgToUserReq) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *MsgToUserReq) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - -type MsgToUserResp struct { +type OnlinePushMsgResp struct { Resp []*SingleMsgToUser `protobuf:"bytes,1,rep,name=resp" json:"resp,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *MsgToUserResp) Reset() { *m = MsgToUserResp{} } -func (m *MsgToUserResp) String() string { return proto.CompactTextString(m) } -func (*MsgToUserResp) ProtoMessage() {} -func (*MsgToUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_ff2396ffa84abfa7, []int{1} +func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} } +func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) } +func (*OnlinePushMsgResp) ProtoMessage() {} +func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{1} } -func (m *MsgToUserResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgToUserResp.Unmarshal(m, b) +func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) } -func (m *MsgToUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgToUserResp.Marshal(b, m, deterministic) +func (m *OnlinePushMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlinePushMsgResp.Marshal(b, m, deterministic) } -func (dst *MsgToUserResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgToUserResp.Merge(dst, src) +func (dst *OnlinePushMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlinePushMsgResp.Merge(dst, src) } -func (m *MsgToUserResp) XXX_Size() int { - return xxx_messageInfo_MsgToUserResp.Size(m) +func (m *OnlinePushMsgResp) XXX_Size() int { + return xxx_messageInfo_OnlinePushMsgResp.Size(m) } -func (m *MsgToUserResp) XXX_DiscardUnknown() { - xxx_messageInfo_MsgToUserResp.DiscardUnknown(m) +func (m *OnlinePushMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_OnlinePushMsgResp.DiscardUnknown(m) } -var xxx_messageInfo_MsgToUserResp proto.InternalMessageInfo +var xxx_messageInfo_OnlinePushMsgResp proto.InternalMessageInfo -func (m *MsgToUserResp) GetResp() []*SingleMsgToUser { +func (m *OnlinePushMsgResp) GetResp() []*SingleMsgToUser { if m != nil { return m.Resp } return nil } -// message SendMsgByWSReq{ -// string SendID = 1; -// string RecvID = 2; -// string Content = 3; -// int64 SendTime = 4; -// int64 MsgFrom = 5; -// int64 ContentType = 6; -// int64 SessionType = 7; -// string OperationID = 8; -// int64 PlatformID = 9; -// } type SingleMsgToUser struct { ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode" json:"ResultCode,omitempty"` RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` @@ -227,7 +129,7 @@ func (m *SingleMsgToUser) Reset() { *m = SingleMsgToUser{} } func (m *SingleMsgToUser) String() string { return proto.CompactTextString(m) } func (*SingleMsgToUser) ProtoMessage() {} func (*SingleMsgToUser) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_ff2396ffa84abfa7, []int{2} + return fileDescriptor_relay_34094e5333f6005a, []int{2} } func (m *SingleMsgToUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingleMsgToUser.Unmarshal(m, b) @@ -268,10 +170,289 @@ func (m *SingleMsgToUser) GetRecvPlatFormID() int32 { return 0 } +type GetUsersOnlineStatusReq struct { + UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq{} } +func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusReq) ProtoMessage() {} +func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{3} +} +func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusReq.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusReq.Merge(dst, src) +} +func (m *GetUsersOnlineStatusReq) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusReq.Size(m) +} +func (m *GetUsersOnlineStatusReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusReq proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *GetUsersOnlineStatusReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetUsersOnlineStatusReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetUsersOnlineStatusResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + SuccessResult []*GetUsersOnlineStatusResp_SuccessResult `protobuf:"bytes,3,rep,name=successResult" json:"successResult,omitempty"` + FailedResult []*GetUsersOnlineStatusResp_FailedDetail `protobuf:"bytes,4,rep,name=failedResult" json:"failedResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusResp{} } +func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp) ProtoMessage() {} +func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4} +} +func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp.Size(m) +} +func (m *GetUsersOnlineStatusResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetUsersOnlineStatusResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetUsersOnlineStatusResp) GetSuccessResult() []*GetUsersOnlineStatusResp_SuccessResult { + if m != nil { + return m.SuccessResult + } + return nil +} + +func (m *GetUsersOnlineStatusResp) GetFailedResult() []*GetUsersOnlineStatusResp_FailedDetail { + if m != nil { + return m.FailedResult + } + return nil +} + +type GetUsersOnlineStatusResp_SuccessDetail struct { + Platform string `protobuf:"bytes,1,opt,name=platform" json:"platform,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() { + *m = GetUsersOnlineStatusResp_SuccessDetail{} +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {} +func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4, 0} +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp_SuccessDetail) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Size(m) +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp_SuccessDetail) GetPlatform() string { + if m != nil { + return m.Platform + } + return "" +} + +func (m *GetUsersOnlineStatusResp_SuccessDetail) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +type GetUsersOnlineStatusResp_FailedDetail struct { + UserID string `protobuf:"bytes,3,opt,name=userID" json:"userID,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersOnlineStatusResp_FailedDetail{} } +func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {} +func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4, 1} +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp_FailedDetail) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Size(m) +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp_FailedDetail) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUsersOnlineStatusResp_FailedDetail) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetUsersOnlineStatusResp_FailedDetail) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetUsersOnlineStatusResp_SuccessResult struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` + DetailPlatformStatus []*GetUsersOnlineStatusResp_SuccessDetail `protobuf:"bytes,3,rep,name=detailPlatformStatus" json:"detailPlatformStatus,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() { + *m = GetUsersOnlineStatusResp_SuccessResult{} +} +func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {} +func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4, 2} +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp_SuccessResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Size(m) +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp_SuccessResult) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUsersOnlineStatusResp_SuccessResult) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *GetUsersOnlineStatusResp_SuccessResult) GetDetailPlatformStatus() []*GetUsersOnlineStatusResp_SuccessDetail { + if m != nil { + return m.DetailPlatformStatus + } + return nil +} + func init() { - proto.RegisterType((*MsgToUserReq)(nil), "relay.MsgToUserReq") - proto.RegisterType((*MsgToUserResp)(nil), "relay.MsgToUserResp") + proto.RegisterType((*OnlinePushMsgReq)(nil), "relay.OnlinePushMsgReq") + proto.RegisterType((*OnlinePushMsgResp)(nil), "relay.OnlinePushMsgResp") proto.RegisterType((*SingleMsgToUser)(nil), "relay.SingleMsgToUser") + proto.RegisterType((*GetUsersOnlineStatusReq)(nil), "relay.GetUsersOnlineStatusReq") + proto.RegisterType((*GetUsersOnlineStatusResp)(nil), "relay.GetUsersOnlineStatusResp") + proto.RegisterType((*GetUsersOnlineStatusResp_SuccessDetail)(nil), "relay.GetUsersOnlineStatusResp.SuccessDetail") + proto.RegisterType((*GetUsersOnlineStatusResp_FailedDetail)(nil), "relay.GetUsersOnlineStatusResp.FailedDetail") + proto.RegisterType((*GetUsersOnlineStatusResp_SuccessResult)(nil), "relay.GetUsersOnlineStatusResp.SuccessResult") } // Reference imports to suppress errors if they are not otherwise used. @@ -285,7 +466,8 @@ const _ = grpc.SupportPackageIsVersion4 // Client API for OnlineMessageRelayService service type OnlineMessageRelayServiceClient interface { - MsgToUser(ctx context.Context, in *MsgToUserReq, opts ...grpc.CallOption) (*MsgToUserResp, error) + OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) + GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) } type onlineMessageRelayServiceClient struct { @@ -296,9 +478,18 @@ func NewOnlineMessageRelayServiceClient(cc *grpc.ClientConn) OnlineMessageRelayS return &onlineMessageRelayServiceClient{cc} } -func (c *onlineMessageRelayServiceClient) MsgToUser(ctx context.Context, in *MsgToUserReq, opts ...grpc.CallOption) (*MsgToUserResp, error) { - out := new(MsgToUserResp) - err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/MsgToUser", in, out, c.cc, opts...) +func (c *onlineMessageRelayServiceClient) OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) { + out := new(OnlinePushMsgResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/OnlinePushMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *onlineMessageRelayServiceClient) GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) { + out := new(GetUsersOnlineStatusResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/GetUsersOnlineStatus", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -308,27 +499,46 @@ func (c *onlineMessageRelayServiceClient) MsgToUser(ctx context.Context, in *Msg // Server API for OnlineMessageRelayService service type OnlineMessageRelayServiceServer interface { - MsgToUser(context.Context, *MsgToUserReq) (*MsgToUserResp, error) + OnlinePushMsg(context.Context, *OnlinePushMsgReq) (*OnlinePushMsgResp, error) + GetUsersOnlineStatus(context.Context, *GetUsersOnlineStatusReq) (*GetUsersOnlineStatusResp, error) } func RegisterOnlineMessageRelayServiceServer(s *grpc.Server, srv OnlineMessageRelayServiceServer) { s.RegisterService(&_OnlineMessageRelayService_serviceDesc, srv) } -func _OnlineMessageRelayService_MsgToUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgToUserReq) +func _OnlineMessageRelayService_OnlinePushMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnlinePushMsgReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(OnlineMessageRelayServiceServer).MsgToUser(ctx, in) + return srv.(OnlineMessageRelayServiceServer).OnlinePushMsg(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/relay.OnlineMessageRelayService/MsgToUser", + FullMethod: "/relay.OnlineMessageRelayService/OnlinePushMsg", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OnlineMessageRelayServiceServer).MsgToUser(ctx, req.(*MsgToUserReq)) + return srv.(OnlineMessageRelayServiceServer).OnlinePushMsg(ctx, req.(*OnlinePushMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OnlineMessageRelayService_GetUsersOnlineStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUsersOnlineStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).GetUsersOnlineStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/GetUsersOnlineStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).GetUsersOnlineStatus(ctx, req.(*GetUsersOnlineStatusReq)) } return interceptor(ctx, in, info, handler) } @@ -338,42 +548,55 @@ var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ HandlerType: (*OnlineMessageRelayServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "MsgToUser", - Handler: _OnlineMessageRelayService_MsgToUser_Handler, + MethodName: "OnlinePushMsg", + Handler: _OnlineMessageRelayService_OnlinePushMsg_Handler, + }, + { + MethodName: "GetUsersOnlineStatus", + Handler: _OnlineMessageRelayService_GetUsersOnlineStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "relay/relay.proto", } -func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_ff2396ffa84abfa7) } +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_34094e5333f6005a) } -var fileDescriptor_relay_ff2396ffa84abfa7 = []byte{ - // 414 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6b, 0xdb, 0x30, - 0x14, 0xc6, 0xf1, 0xbc, 0xa4, 0xcd, 0x4b, 0x93, 0xac, 0xda, 0x28, 0x5a, 0x0f, 0xc3, 0x84, 0x51, - 0xc2, 0x0e, 0x19, 0x74, 0xb0, 0x4b, 0x6f, 0xab, 0x09, 0x18, 0xe6, 0x76, 0xc8, 0xe9, 0x65, 0x37, - 0xd7, 0x7d, 0x33, 0x62, 0xb6, 0xe4, 0x48, 0x5e, 0xa1, 0xff, 0xdd, 0xfe, 0xb4, 0xa1, 0xa7, 0x64, - 0xd1, 0x32, 0x7a, 0x31, 0xfe, 0x7e, 0xef, 0xf3, 0xf3, 0xa7, 0xa7, 0x07, 0xa7, 0x06, 0x9b, 0xf2, - 0xe9, 0x23, 0x3d, 0x97, 0x9d, 0xd1, 0xbd, 0x66, 0x03, 0x12, 0xf3, 0xdf, 0x31, 0x9c, 0xe4, 0xb6, - 0x5e, 0xeb, 0x3b, 0x8b, 0x46, 0xe0, 0x86, 0x9d, 0xc1, 0xb0, 0x40, 0xf5, 0x90, 0xa5, 0x3c, 0x4a, - 0xa2, 0xc5, 0x48, 0x6c, 0x95, 0xe3, 0x02, 0xab, 0xc7, 0x2c, 0xe5, 0x2f, 0x3c, 0xf7, 0x8a, 0x71, - 0x38, 0xba, 0xd6, 0xaa, 0x47, 0xd5, 0xf3, 0x01, 0x15, 0x76, 0xd2, 0x55, 0x9c, 0xa7, 0xc0, 0x0d, - 0x1f, 0x26, 0xd1, 0x22, 0x16, 0x3b, 0xc9, 0xce, 0xe1, 0xd8, 0x75, 0x5d, 0xcb, 0x16, 0xf9, 0x11, - 0x95, 0xfe, 0x6a, 0xf7, 0x55, 0x6e, 0xeb, 0x95, 0xd1, 0x2d, 0x3f, 0x4e, 0xa2, 0xc5, 0x40, 0xec, - 0x24, 0x4b, 0x60, 0xbc, 0x6d, 0xbd, 0x7e, 0xea, 0x90, 0x8f, 0xa8, 0x1a, 0x22, 0xe7, 0x28, 0xd0, - 0x5a, 0xa9, 0x15, 0x39, 0xc0, 0x3b, 0x02, 0xe4, 0x1c, 0xb7, 0x1d, 0x9a, 0xb2, 0x97, 0x5a, 0x65, - 0x29, 0x1f, 0x53, 0xe2, 0x10, 0xf9, 0x1e, 0xe6, 0x11, 0x4d, 0x6e, 0xeb, 0x2c, 0xe5, 0x27, 0xde, - 0x11, 0x20, 0xf6, 0x0e, 0xe0, 0x5b, 0x53, 0xf6, 0x3f, 0xb4, 0x69, 0xb3, 0x94, 0x4f, 0xe8, 0x27, - 0x01, 0x61, 0x17, 0x30, 0x75, 0xa7, 0x41, 0x73, 0x23, 0xab, 0x9f, 0x37, 0x65, 0x8b, 0x7c, 0x4a, - 0x4d, 0x0e, 0x28, 0x7b, 0x0f, 0x13, 0x4f, 0x56, 0x65, 0x85, 0x77, 0xe2, 0x2b, 0x9f, 0x91, 0xed, - 0x5f, 0x48, 0xa7, 0x6e, 0x24, 0xaa, 0xde, 0xe7, 0x79, 0xe5, 0xf3, 0x04, 0x68, 0x7e, 0x05, 0x93, - 0xe0, 0x06, 0x6d, 0xc7, 0x3e, 0xc0, 0x4b, 0x83, 0xb6, 0xe3, 0x51, 0x12, 0x2f, 0xc6, 0x97, 0x67, - 0x4b, 0x7f, 0xed, 0x85, 0x54, 0x75, 0x83, 0x7b, 0x27, 0x79, 0xe6, 0x1b, 0x98, 0x1d, 0x14, 0xdc, - 0xf9, 0x04, 0xda, 0x5f, 0x4d, 0x7f, 0xad, 0x1f, 0x90, 0xb6, 0x20, 0x16, 0x01, 0x79, 0x76, 0x13, - 0x2e, 0x60, 0xea, 0xde, 0xdc, 0x24, 0x56, 0x7e, 0x36, 0x31, 0xcd, 0xe6, 0x80, 0x5e, 0x16, 0xf0, - 0xf6, 0x56, 0x35, 0x52, 0x61, 0x8e, 0xd6, 0x96, 0x35, 0x0a, 0x17, 0xcf, 0x0d, 0x58, 0x56, 0xc8, - 0x3e, 0xc3, 0x68, 0x9f, 0xe4, 0xf5, 0x36, 0x7a, 0xb8, 0xa0, 0xe7, 0x6f, 0xfe, 0x87, 0xb6, 0xfb, - 0x72, 0xfa, 0x7d, 0xb6, 0xf4, 0xfb, 0x7d, 0xd5, 0xdd, 0x53, 0xc7, 0xfb, 0x21, 0x2d, 0xfa, 0xa7, - 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x9b, 0x83, 0x12, 0xfd, 0x02, 0x00, 0x00, +var fileDescriptor_relay_34094e5333f6005a = []byte{ + // 554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5d, 0x8f, 0xd2, 0x40, + 0x14, 0x4d, 0x65, 0x3f, 0xdc, 0x0b, 0xb8, 0x32, 0xd9, 0xec, 0xd6, 0x3e, 0x20, 0xf6, 0xc1, 0x10, + 0xa3, 0x25, 0x41, 0xdf, 0x7c, 0x30, 0xd9, 0x25, 0x6b, 0x48, 0x6c, 0x20, 0x83, 0x46, 0xe3, 0x0b, + 0x99, 0x85, 0xbb, 0xdd, 0x66, 0x0b, 0x1d, 0xe6, 0xb6, 0x10, 0xff, 0x84, 0x3f, 0xc2, 0x3f, 0xa1, + 0x3f, 0xcf, 0x74, 0xa6, 0x60, 0x4b, 0x58, 0x37, 0xfb, 0x42, 0x38, 0x77, 0xee, 0x3d, 0xf7, 0x9c, + 0xd3, 0x76, 0xa0, 0xa1, 0x30, 0x12, 0x3f, 0x3a, 0xfa, 0xd7, 0x93, 0x2a, 0x4e, 0x62, 0xb6, 0xaf, + 0x81, 0xf3, 0x62, 0x20, 0x71, 0x3e, 0xee, 0xfb, 0x1d, 0x79, 0x1b, 0x74, 0xf4, 0x49, 0x87, 0xa6, + 0xb7, 0xe3, 0x15, 0x75, 0x56, 0x64, 0x3a, 0xdd, 0x9f, 0x16, 0x3c, 0x1d, 0xcc, 0xa3, 0x70, 0x8e, + 0xc3, 0x94, 0x6e, 0x7c, 0x0a, 0x38, 0x2e, 0x58, 0x0b, 0xaa, 0x03, 0x89, 0x4a, 0x24, 0x61, 0x3c, + 0xef, 0xf7, 0x6c, 0xab, 0x65, 0xb5, 0x8f, 0x78, 0xb1, 0xc4, 0xde, 0xc1, 0xe1, 0x8c, 0x82, 0x9e, + 0x48, 0x84, 0xfd, 0xa8, 0x65, 0xb5, 0xab, 0x5d, 0xc7, 0x23, 0x54, 0x4b, 0x54, 0x63, 0x21, 0xc3, + 0xb1, 0x14, 0x4a, 0xcc, 0xc8, 0xf3, 0x4d, 0x07, 0x5f, 0xb7, 0x32, 0x17, 0x6a, 0x32, 0xa5, 0x9b, + 0xcf, 0xf1, 0x17, 0x42, 0xd5, 0xef, 0xd9, 0x15, 0x4d, 0x5c, 0xaa, 0xb9, 0x1f, 0xa0, 0xb1, 0xa5, + 0x87, 0x24, 0x7b, 0x05, 0x7b, 0x0a, 0x49, 0xda, 0x56, 0xab, 0xd2, 0xae, 0x76, 0x4f, 0x3d, 0xe3, + 0x75, 0x14, 0xce, 0x83, 0x08, 0x7d, 0x0a, 0xcc, 0x30, 0xd7, 0x3d, 0xee, 0x02, 0x8e, 0xb7, 0x0e, + 0x58, 0x13, 0x80, 0x23, 0xa5, 0x51, 0x72, 0x11, 0x4f, 0x51, 0xdb, 0xa9, 0xf0, 0x42, 0x85, 0x9d, + 0xc2, 0x01, 0xc7, 0xc9, 0xb2, 0xdf, 0xd3, 0x66, 0x8e, 0x78, 0x8e, 0xd8, 0x4b, 0x78, 0x92, 0xfd, + 0x1b, 0x46, 0x22, 0xb9, 0x8c, 0xd5, 0x2c, 0x57, 0xbc, 0xcf, 0xb7, 0xaa, 0xee, 0x0a, 0xce, 0x3e, + 0x62, 0x92, 0xad, 0x22, 0xa3, 0x7d, 0x94, 0x88, 0x24, 0xa5, 0x2c, 0xca, 0x26, 0x40, 0xaa, 0x8d, + 0x7d, 0x0a, 0x29, 0xd1, 0xfa, 0x8f, 0x78, 0xa1, 0x92, 0x45, 0x1d, 0x17, 0xa2, 0x36, 0xfb, 0x8b, + 0x25, 0xe6, 0xc0, 0xe3, 0x58, 0x96, 0x02, 0xdb, 0x60, 0xf7, 0xf7, 0x1e, 0xd8, 0xbb, 0x37, 0x93, + 0x64, 0x36, 0x1c, 0xa2, 0x52, 0x1b, 0xcb, 0xfb, 0x7c, 0x0d, 0x33, 0xbf, 0xa8, 0x94, 0x4f, 0xc1, + 0xda, 0xaf, 0x41, 0x6c, 0x04, 0x75, 0x4a, 0x27, 0x13, 0x24, 0x32, 0xe1, 0xd8, 0x15, 0x9d, 0xf7, + 0x9b, 0x3c, 0xef, 0xbb, 0x36, 0x79, 0xa3, 0xe2, 0x10, 0x2f, 0x73, 0xb0, 0x21, 0xd4, 0xae, 0x45, + 0x18, 0xe1, 0x34, 0xe7, 0xdc, 0xd3, 0x9c, 0xaf, 0xef, 0xe3, 0xbc, 0xd4, 0x33, 0x3d, 0x4c, 0x44, + 0x18, 0xf1, 0x12, 0x83, 0x73, 0x01, 0xf5, 0x7c, 0xa3, 0x39, 0xce, 0x22, 0x92, 0x91, 0x48, 0xae, + 0x63, 0x35, 0xcb, 0x5f, 0xd6, 0x0d, 0xce, 0xbc, 0x92, 0x66, 0x5d, 0x7b, 0x35, 0xc8, 0xf9, 0x06, + 0xb5, 0xe2, 0x8a, 0xac, 0x2f, 0x2d, 0x86, 0x9c, 0xa3, 0x87, 0xa7, 0xe8, 0xfc, 0xb2, 0x36, 0xfa, + 0xf2, 0x08, 0xfe, 0x71, 0x5b, 0x25, 0xee, 0x3b, 0xb4, 0x31, 0x01, 0x27, 0x53, 0xad, 0x6a, 0x98, + 0xbb, 0x30, 0xb9, 0x3c, 0xf0, 0x71, 0xe4, 0xd9, 0xed, 0xa4, 0xea, 0xfe, 0xb1, 0xe0, 0x99, 0x19, + 0xf4, 0x91, 0x48, 0x04, 0xc8, 0x33, 0xce, 0x11, 0xaa, 0x65, 0x38, 0x41, 0x76, 0x0e, 0xf5, 0xd2, + 0x47, 0xc8, 0xce, 0xf2, 0x9d, 0xdb, 0x57, 0x85, 0x63, 0xef, 0x3e, 0x20, 0xc9, 0xbe, 0xc2, 0xc9, + 0x2e, 0x85, 0xac, 0xf9, 0x5f, 0xf9, 0x0b, 0xe7, 0xf9, 0x3d, 0xf6, 0xce, 0x1b, 0xdf, 0x8f, 0x3d, + 0x73, 0xdb, 0xbd, 0x97, 0x57, 0x5a, 0xf6, 0xd5, 0x81, 0xbe, 0xcc, 0xde, 0xfe, 0x0d, 0x00, 0x00, + 0xff, 0xff, 0x8e, 0xdc, 0xcc, 0x70, 0x0b, 0x05, 0x00, 0x00, } diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index 56b876c67..d8c5f1b7e 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -1,27 +1,16 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; option go_package = "./relay;pbRelay"; package relay; -message MsgToUserReq { - string SendID = 1; - string RecvID = 2; - string Content = 5; - int64 RecvSeq = 6; - int64 SendTime = 7; - int32 MsgFrom = 8; - int32 ContentType = 9; - int32 SessionType = 10; - string OperationID = 11; - string ServerMsgID = 12; - int32 PlatformID = 13; - string SenderNickName = 14; - string SenderFaceURL = 15; - string ClientMsgID = 16; +message OnlinePushMsgReq { + string OperationID = 1; + server_api_params.MsgData msgData = 2; + string pushToUserID = 3; } -message MsgToUserResp{ +message OnlinePushMsgResp{ repeated SingleMsgToUser resp = 1; -} -//message SendMsgByWSReq{ +}//message SendMsgByWSReq{ // string SendID = 1; // string RecvID = 2; // string Content = 3; @@ -32,13 +21,41 @@ repeated SingleMsgToUser resp = 1; // string OperationID = 8; // int64 PlatformID = 9; //} + message SingleMsgToUser{ int64 ResultCode = 1; string RecvID = 2; int32 RecvPlatFormID = 3; } +message GetUsersOnlineStatusReq{ + repeated string userIDList = 1; + string operationID = 2; + string opUserID = 3; +} +message GetUsersOnlineStatusResp{ + int32 errCode = 1; + string errMsg = 2; + repeated SuccessResult successResult = 3; + repeated FailedDetail failedResult = 4; + message SuccessDetail{ + string platform = 1; + string status = 2; + } + message FailedDetail{ + string userID = 3; + int32 errCode = 1; + string errMsg = 2; + } + message SuccessResult{ + string userID = 1; + string status = 2; + repeated SuccessDetail detailPlatformStatus = 3; + + } +} service OnlineMessageRelayService { - rpc MsgToUser(MsgToUserReq) returns(MsgToUserResp); + rpc OnlinePushMsg(OnlinePushMsgReq) returns(OnlinePushMsgResp); + rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq)returns(GetUsersOnlineStatusResp); // rpc SendMsgByWS(SendMsgByWSReq) returns(MsgToUserResp); } diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go index effde5aa0..accf94ecf 100644 --- a/pkg/proto/sdk_ws/ws.pb.go +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: sdk_ws/ws.proto -package open_im_sdk // import "./sdk_ws" +package server_api_params import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -18,21 +18,852 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package -type PullMessageBySeqListResp struct { - MaxSeq int64 `protobuf:"varint,1,opt,name=MaxSeq" json:"MaxSeq,omitempty"` - MinSeq int64 `protobuf:"varint,2,opt,name=MinSeq" json:"MinSeq,omitempty"` - SingleUserMsg []*GatherFormat `protobuf:"bytes,3,rep,name=SingleUserMsg" json:"SingleUserMsg,omitempty"` - GroupUserMsg []*GatherFormat `protobuf:"bytes,4,rep,name=GroupUserMsg" json:"GroupUserMsg,omitempty"` +type GroupInfo struct { + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` + Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"` + Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"` + FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"` + OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"` + MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"` + Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"` + Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"` + CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID" json:"creatorUserID,omitempty"` + GroupType int32 `protobuf:"varint,12,opt,name=groupType" json:"groupType,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupInfo) Reset() { *m = GroupInfo{} } +func (m *GroupInfo) String() string { return proto.CompactTextString(m) } +func (*GroupInfo) ProtoMessage() {} +func (*GroupInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{0} +} +func (m *GroupInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupInfo.Unmarshal(m, b) +} +func (m *GroupInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupInfo.Marshal(b, m, deterministic) +} +func (dst *GroupInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupInfo.Merge(dst, src) +} +func (m *GroupInfo) XXX_Size() int { + return xxx_messageInfo_GroupInfo.Size(m) +} +func (m *GroupInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GroupInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupInfo proto.InternalMessageInfo + +func (m *GroupInfo) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GroupInfo) GetGroupName() string { + if m != nil { + return m.GroupName + } + return "" +} + +func (m *GroupInfo) GetNotification() string { + if m != nil { + return m.Notification + } + return "" +} + +func (m *GroupInfo) GetIntroduction() string { + if m != nil { + return m.Introduction + } + return "" +} + +func (m *GroupInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *GroupInfo) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *GroupInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *GroupInfo) GetMemberCount() uint32 { + if m != nil { + return m.MemberCount + } + return 0 +} + +func (m *GroupInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *GroupInfo) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *GroupInfo) GetCreatorUserID() string { + if m != nil { + return m.CreatorUserID + } + return "" +} + +func (m *GroupInfo) GetGroupType() int32 { + if m != nil { + return m.GroupType + } + return 0 +} + +type GroupMemberFullInfo struct { + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + RoleLevel int32 `protobuf:"varint,3,opt,name=roleLevel" json:"roleLevel,omitempty"` + JoinTime int32 `protobuf:"varint,4,opt,name=joinTime" json:"joinTime,omitempty"` + Nickname string `protobuf:"bytes,5,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,6,opt,name=faceURL" json:"faceURL,omitempty"` + AppMangerLevel int32 `protobuf:"varint,7,opt,name=appMangerLevel" json:"appMangerLevel,omitempty"` + JoinSource int32 `protobuf:"varint,8,opt,name=joinSource" json:"joinSource,omitempty"` + OperatorUserID string `protobuf:"bytes,9,opt,name=operatorUserID" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,10,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupMemberFullInfo) Reset() { *m = GroupMemberFullInfo{} } +func (m *GroupMemberFullInfo) String() string { return proto.CompactTextString(m) } +func (*GroupMemberFullInfo) ProtoMessage() {} +func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{1} +} +func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) +} +func (m *GroupMemberFullInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupMemberFullInfo.Marshal(b, m, deterministic) +} +func (dst *GroupMemberFullInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupMemberFullInfo.Merge(dst, src) +} +func (m *GroupMemberFullInfo) XXX_Size() int { + return xxx_messageInfo_GroupMemberFullInfo.Size(m) +} +func (m *GroupMemberFullInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GroupMemberFullInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupMemberFullInfo proto.InternalMessageInfo + +func (m *GroupMemberFullInfo) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GroupMemberFullInfo) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GroupMemberFullInfo) GetRoleLevel() int32 { + if m != nil { + return m.RoleLevel + } + return 0 +} + +func (m *GroupMemberFullInfo) GetJoinTime() int32 { + if m != nil { + return m.JoinTime + } + return 0 +} + +func (m *GroupMemberFullInfo) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *GroupMemberFullInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *GroupMemberFullInfo) GetAppMangerLevel() int32 { + if m != nil { + return m.AppMangerLevel + } + return 0 +} + +func (m *GroupMemberFullInfo) GetJoinSource() int32 { + if m != nil { + return m.JoinSource + } + return 0 +} + +func (m *GroupMemberFullInfo) GetOperatorUserID() string { + if m != nil { + return m.OperatorUserID + } + return "" +} + +func (m *GroupMemberFullInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type PublicUserInfo struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,3,opt,name=faceURL" json:"faceURL,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + Ex string `protobuf:"bytes,5,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PublicUserInfo) Reset() { *m = PublicUserInfo{} } +func (m *PublicUserInfo) String() string { return proto.CompactTextString(m) } +func (*PublicUserInfo) ProtoMessage() {} +func (*PublicUserInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{2} +} +func (m *PublicUserInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PublicUserInfo.Unmarshal(m, b) +} +func (m *PublicUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PublicUserInfo.Marshal(b, m, deterministic) +} +func (dst *PublicUserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublicUserInfo.Merge(dst, src) +} +func (m *PublicUserInfo) XXX_Size() int { + return xxx_messageInfo_PublicUserInfo.Size(m) +} +func (m *PublicUserInfo) XXX_DiscardUnknown() { + xxx_messageInfo_PublicUserInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_PublicUserInfo proto.InternalMessageInfo + +func (m *PublicUserInfo) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *PublicUserInfo) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *PublicUserInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *PublicUserInfo) GetGender() int32 { + if m != nil { + return m.Gender + } + return 0 +} + +func (m *PublicUserInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type UserInfo struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,3,opt,name=faceURL" json:"faceURL,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + PhoneNumber string `protobuf:"bytes,5,opt,name=phoneNumber" json:"phoneNumber,omitempty"` + Birth uint32 `protobuf:"varint,6,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` + CreateTime uint32 `protobuf:"varint,9,opt,name=createTime" json:"createTime,omitempty"` + AppMangerLevel int32 `protobuf:"varint,10,opt,name=appMangerLevel" json:"appMangerLevel,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserInfo) Reset() { *m = UserInfo{} } +func (m *UserInfo) String() string { return proto.CompactTextString(m) } +func (*UserInfo) ProtoMessage() {} +func (*UserInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{3} +} +func (m *UserInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserInfo.Unmarshal(m, b) +} +func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserInfo.Marshal(b, m, deterministic) +} +func (dst *UserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInfo.Merge(dst, src) +} +func (m *UserInfo) XXX_Size() int { + return xxx_messageInfo_UserInfo.Size(m) +} +func (m *UserInfo) XXX_DiscardUnknown() { + xxx_messageInfo_UserInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_UserInfo proto.InternalMessageInfo + +func (m *UserInfo) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *UserInfo) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *UserInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *UserInfo) GetGender() int32 { + if m != nil { + return m.Gender + } + return 0 +} + +func (m *UserInfo) GetPhoneNumber() string { + if m != nil { + return m.PhoneNumber + } + return "" +} + +func (m *UserInfo) GetBirth() uint32 { + if m != nil { + return m.Birth + } + return 0 +} + +func (m *UserInfo) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *UserInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *UserInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *UserInfo) GetAppMangerLevel() int32 { + if m != nil { + return m.AppMangerLevel + } + return 0 +} + +type FriendInfo struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + Remark string `protobuf:"bytes,2,opt,name=remark" json:"remark,omitempty"` + CreateTime uint32 `protobuf:"varint,3,opt,name=createTime" json:"createTime,omitempty"` + FriendUser *UserInfo `protobuf:"bytes,4,opt,name=friendUser" json:"friendUser,omitempty"` + AddSource int32 `protobuf:"varint,5,opt,name=addSource" json:"addSource,omitempty"` + OperatorUserID string `protobuf:"bytes,6,opt,name=operatorUserID" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendInfo) Reset() { *m = FriendInfo{} } +func (m *FriendInfo) String() string { return proto.CompactTextString(m) } +func (*FriendInfo) ProtoMessage() {} +func (*FriendInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{4} +} +func (m *FriendInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendInfo.Unmarshal(m, b) +} +func (m *FriendInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendInfo.Marshal(b, m, deterministic) +} +func (dst *FriendInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendInfo.Merge(dst, src) +} +func (m *FriendInfo) XXX_Size() int { + return xxx_messageInfo_FriendInfo.Size(m) +} +func (m *FriendInfo) XXX_DiscardUnknown() { + xxx_messageInfo_FriendInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendInfo proto.InternalMessageInfo + +func (m *FriendInfo) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *FriendInfo) GetRemark() string { + if m != nil { + return m.Remark + } + return "" +} + +func (m *FriendInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *FriendInfo) GetFriendUser() *UserInfo { + if m != nil { + return m.FriendUser + } + return nil +} + +func (m *FriendInfo) GetAddSource() int32 { + if m != nil { + return m.AddSource + } + return 0 +} + +func (m *FriendInfo) GetOperatorUserID() string { + if m != nil { + return m.OperatorUserID + } + return "" +} + +func (m *FriendInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type BlackInfo struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + CreateTime uint32 `protobuf:"varint,2,opt,name=createTime" json:"createTime,omitempty"` + BlackUserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=blackUserInfo" json:"blackUserInfo,omitempty"` + AddSource int32 `protobuf:"varint,4,opt,name=addSource" json:"addSource,omitempty"` + OperatorUserID string `protobuf:"bytes,5,opt,name=operatorUserID" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,6,opt,name=ex" json:"ex,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } +func (m *BlackInfo) Reset() { *m = BlackInfo{} } +func (m *BlackInfo) String() string { return proto.CompactTextString(m) } +func (*BlackInfo) ProtoMessage() {} +func (*BlackInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{5} +} +func (m *BlackInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlackInfo.Unmarshal(m, b) +} +func (m *BlackInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlackInfo.Marshal(b, m, deterministic) +} +func (dst *BlackInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlackInfo.Merge(dst, src) +} +func (m *BlackInfo) XXX_Size() int { + return xxx_messageInfo_BlackInfo.Size(m) +} +func (m *BlackInfo) XXX_DiscardUnknown() { + xxx_messageInfo_BlackInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_BlackInfo proto.InternalMessageInfo + +func (m *BlackInfo) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *BlackInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *BlackInfo) GetBlackUserInfo() *PublicUserInfo { + if m != nil { + return m.BlackUserInfo + } + return nil +} + +func (m *BlackInfo) GetAddSource() int32 { + if m != nil { + return m.AddSource + } + return 0 +} + +func (m *BlackInfo) GetOperatorUserID() string { + if m != nil { + return m.OperatorUserID + } + return "" +} + +func (m *BlackInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type GroupRequest struct { + UserInfo *PublicUserInfo `protobuf:"bytes,1,opt,name=userInfo" json:"userInfo,omitempty"` + GroupInfo *GroupInfo `protobuf:"bytes,2,opt,name=groupInfo" json:"groupInfo,omitempty"` + HandleResult int32 `protobuf:"varint,3,opt,name=handleResult" json:"handleResult,omitempty"` + ReqMsg string `protobuf:"bytes,4,opt,name=reqMsg" json:"reqMsg,omitempty"` + HandleMsg string `protobuf:"bytes,5,opt,name=handleMsg" json:"handleMsg,omitempty"` + ReqTime uint32 `protobuf:"varint,6,opt,name=reqTime" json:"reqTime,omitempty"` + HandleUserID string `protobuf:"bytes,7,opt,name=handleUserID" json:"handleUserID,omitempty"` + HandleTime uint32 `protobuf:"varint,8,opt,name=handleTime" json:"handleTime,omitempty"` + Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupRequest) Reset() { *m = GroupRequest{} } +func (m *GroupRequest) String() string { return proto.CompactTextString(m) } +func (*GroupRequest) ProtoMessage() {} +func (*GroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{6} +} +func (m *GroupRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupRequest.Unmarshal(m, b) +} +func (m *GroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupRequest.Marshal(b, m, deterministic) +} +func (dst *GroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupRequest.Merge(dst, src) +} +func (m *GroupRequest) XXX_Size() int { + return xxx_messageInfo_GroupRequest.Size(m) +} +func (m *GroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GroupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupRequest proto.InternalMessageInfo + +func (m *GroupRequest) GetUserInfo() *PublicUserInfo { + if m != nil { + return m.UserInfo + } + return nil +} + +func (m *GroupRequest) GetGroupInfo() *GroupInfo { + if m != nil { + return m.GroupInfo + } + return nil +} + +func (m *GroupRequest) GetHandleResult() int32 { + if m != nil { + return m.HandleResult + } + return 0 +} + +func (m *GroupRequest) GetReqMsg() string { + if m != nil { + return m.ReqMsg + } + return "" +} + +func (m *GroupRequest) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +func (m *GroupRequest) GetReqTime() uint32 { + if m != nil { + return m.ReqTime + } + return 0 +} + +func (m *GroupRequest) GetHandleUserID() string { + if m != nil { + return m.HandleUserID + } + return "" +} + +func (m *GroupRequest) GetHandleTime() uint32 { + if m != nil { + return m.HandleTime + } + return 0 +} + +func (m *GroupRequest) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type FriendRequest struct { + FromUserID string `protobuf:"bytes,1,opt,name=fromUserID" json:"fromUserID,omitempty"` + FromNickname string `protobuf:"bytes,2,opt,name=fromNickname" json:"fromNickname,omitempty"` + FromFaceURL string `protobuf:"bytes,3,opt,name=fromFaceURL" json:"fromFaceURL,omitempty"` + FromGender int32 `protobuf:"varint,4,opt,name=fromGender" json:"fromGender,omitempty"` + ToUserID string `protobuf:"bytes,5,opt,name=toUserID" json:"toUserID,omitempty"` + ToNickname string `protobuf:"bytes,6,opt,name=toNickname" json:"toNickname,omitempty"` + ToFaceURL string `protobuf:"bytes,7,opt,name=toFaceURL" json:"toFaceURL,omitempty"` + ToGender int32 `protobuf:"varint,8,opt,name=toGender" json:"toGender,omitempty"` + HandleResult int32 `protobuf:"varint,9,opt,name=handleResult" json:"handleResult,omitempty"` + ReqMsg string `protobuf:"bytes,10,opt,name=reqMsg" json:"reqMsg,omitempty"` + CreateTime uint32 `protobuf:"varint,11,opt,name=createTime" json:"createTime,omitempty"` + HandlerUserID string `protobuf:"bytes,12,opt,name=handlerUserID" json:"handlerUserID,omitempty"` + HandleMsg string `protobuf:"bytes,13,opt,name=handleMsg" json:"handleMsg,omitempty"` + HandleTime uint32 `protobuf:"varint,14,opt,name=handleTime" json:"handleTime,omitempty"` + Ex string `protobuf:"bytes,15,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendRequest) Reset() { *m = FriendRequest{} } +func (m *FriendRequest) String() string { return proto.CompactTextString(m) } +func (*FriendRequest) ProtoMessage() {} +func (*FriendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{7} +} +func (m *FriendRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendRequest.Unmarshal(m, b) +} +func (m *FriendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendRequest.Marshal(b, m, deterministic) +} +func (dst *FriendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendRequest.Merge(dst, src) +} +func (m *FriendRequest) XXX_Size() int { + return xxx_messageInfo_FriendRequest.Size(m) +} +func (m *FriendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FriendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendRequest proto.InternalMessageInfo + +func (m *FriendRequest) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *FriendRequest) GetFromNickname() string { + if m != nil { + return m.FromNickname + } + return "" +} + +func (m *FriendRequest) GetFromFaceURL() string { + if m != nil { + return m.FromFaceURL + } + return "" +} + +func (m *FriendRequest) GetFromGender() int32 { + if m != nil { + return m.FromGender + } + return 0 +} + +func (m *FriendRequest) GetToUserID() string { + if m != nil { + return m.ToUserID + } + return "" +} + +func (m *FriendRequest) GetToNickname() string { + if m != nil { + return m.ToNickname + } + return "" +} + +func (m *FriendRequest) GetToFaceURL() string { + if m != nil { + return m.ToFaceURL + } + return "" +} + +func (m *FriendRequest) GetToGender() int32 { + if m != nil { + return m.ToGender + } + return 0 +} + +func (m *FriendRequest) GetHandleResult() int32 { + if m != nil { + return m.HandleResult + } + return 0 +} + +func (m *FriendRequest) GetReqMsg() string { + if m != nil { + return m.ReqMsg + } + return "" +} + +func (m *FriendRequest) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *FriendRequest) GetHandlerUserID() string { + if m != nil { + return m.HandlerUserID + } + return "" +} + +func (m *FriendRequest) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +func (m *FriendRequest) GetHandleTime() uint32 { + if m != nil { + return m.HandleTime + } + return 0 +} + +func (m *FriendRequest) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type PullMessageBySeqListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + List []*MsgData `protobuf:"bytes,3,rep,name=list" json:"list,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + func (m *PullMessageBySeqListResp) Reset() { *m = PullMessageBySeqListResp{} } func (m *PullMessageBySeqListResp) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListResp) ProtoMessage() {} func (*PullMessageBySeqListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{0} + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{8} } func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) @@ -52,36 +883,31 @@ func (m *PullMessageBySeqListResp) XXX_DiscardUnknown() { var xxx_messageInfo_PullMessageBySeqListResp proto.InternalMessageInfo -func (m *PullMessageBySeqListResp) GetMaxSeq() int64 { +func (m *PullMessageBySeqListResp) GetErrCode() int32 { if m != nil { - return m.MaxSeq + return m.ErrCode } return 0 } -func (m *PullMessageBySeqListResp) GetMinSeq() int64 { +func (m *PullMessageBySeqListResp) GetErrMsg() string { if m != nil { - return m.MinSeq + return m.ErrMsg } - return 0 + return "" } -func (m *PullMessageBySeqListResp) GetSingleUserMsg() []*GatherFormat { +func (m *PullMessageBySeqListResp) GetList() []*MsgData { if m != nil { - return m.SingleUserMsg - } - return nil -} - -func (m *PullMessageBySeqListResp) GetGroupUserMsg() []*GatherFormat { - if m != nil { - return m.GroupUserMsg + return m.List } return nil } type PullMessageBySeqListReq struct { - SeqList []int64 `protobuf:"varint,1,rep,packed,name=seqList" json:"seqList,omitempty"` + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + SeqList []uint32 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -91,7 +917,7 @@ func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListReq) ProtoMessage() {} func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{1} + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{9} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -111,7 +937,21 @@ func (m *PullMessageBySeqListReq) XXX_DiscardUnknown() { var xxx_messageInfo_PullMessageBySeqListReq proto.InternalMessageInfo -func (m *PullMessageBySeqListReq) GetSeqList() []int64 { +func (m *PullMessageBySeqListReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *PullMessageBySeqListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *PullMessageBySeqListReq) GetSeqList() []uint32 { if m != nil { return m.SeqList } @@ -128,7 +968,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{2} + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{10} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -149,8 +989,8 @@ func (m *GetMaxAndMinSeqReq) XXX_DiscardUnknown() { var xxx_messageInfo_GetMaxAndMinSeqReq proto.InternalMessageInfo type GetMaxAndMinSeqResp struct { - MaxSeq int64 `protobuf:"varint,1,opt,name=maxSeq" json:"maxSeq,omitempty"` - MinSeq int64 `protobuf:"varint,2,opt,name=minSeq" json:"minSeq,omitempty"` + MaxSeq uint32 `protobuf:"varint,1,opt,name=maxSeq" json:"maxSeq,omitempty"` + MinSeq uint32 `protobuf:"varint,2,opt,name=minSeq" json:"minSeq,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -160,7 +1000,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{3} + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{11} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -180,327 +1020,23 @@ func (m *GetMaxAndMinSeqResp) XXX_DiscardUnknown() { var xxx_messageInfo_GetMaxAndMinSeqResp proto.InternalMessageInfo -func (m *GetMaxAndMinSeqResp) GetMaxSeq() int64 { +func (m *GetMaxAndMinSeqResp) GetMaxSeq() uint32 { if m != nil { return m.MaxSeq } return 0 } -func (m *GetMaxAndMinSeqResp) GetMinSeq() int64 { +func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { if m != nil { return m.MinSeq } return 0 } -type GatherFormat struct { - // @inject_tag: json:"id" - ID string `protobuf:"bytes,1,opt,name=ID" json:"id"` - // @inject_tag: json:"list" - List []*MsgFormat `protobuf:"bytes,2,rep,name=List" json:"list"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GatherFormat) Reset() { *m = GatherFormat{} } -func (m *GatherFormat) String() string { return proto.CompactTextString(m) } -func (*GatherFormat) ProtoMessage() {} -func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{4} -} -func (m *GatherFormat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GatherFormat.Unmarshal(m, b) -} -func (m *GatherFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GatherFormat.Marshal(b, m, deterministic) -} -func (dst *GatherFormat) XXX_Merge(src proto.Message) { - xxx_messageInfo_GatherFormat.Merge(dst, src) -} -func (m *GatherFormat) XXX_Size() int { - return xxx_messageInfo_GatherFormat.Size(m) -} -func (m *GatherFormat) XXX_DiscardUnknown() { - xxx_messageInfo_GatherFormat.DiscardUnknown(m) -} - -var xxx_messageInfo_GatherFormat proto.InternalMessageInfo - -func (m *GatherFormat) GetID() string { - if m != nil { - return m.ID - } - return "" -} - -func (m *GatherFormat) GetList() []*MsgFormat { - if m != nil { - return m.List - } - return nil -} - -type MsgFormat struct { - // @inject_tag: json:"sendID" - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"sendID"` - // @inject_tag: json:"recvID" - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"recvID"` - // @inject_tag: json:"msgFrom" - MsgFrom int32 `protobuf:"varint,3,opt,name=MsgFrom" json:"msgFrom"` - // @inject_tag: json:"contentType" - ContentType int32 `protobuf:"varint,4,opt,name=ContentType" json:"contentType"` - // @inject_tag: json:"serverMsgID" - ServerMsgID string `protobuf:"bytes,5,opt,name=ServerMsgID" json:"serverMsgID"` - // @inject_tag: json:"content" - Content string `protobuf:"bytes,6,opt,name=Content" json:"content"` - // @inject_tag: json:"seq" - Seq int64 `protobuf:"varint,7,opt,name=Seq" json:"seq"` - // @inject_tag: json:"sendTime" - SendTime int64 `protobuf:"varint,8,opt,name=SendTime" json:"sendTime"` - // @inject_tag: json:"senderPlatformID" - SenderPlatformID int32 `protobuf:"varint,9,opt,name=SenderPlatformID" json:"senderPlatformID"` - // @inject_tag: json:"senderNickName" - SenderNickName string `protobuf:"bytes,10,opt,name=SenderNickName" json:"senderNickName"` - // @inject_tag: json:"senderFaceUrl" - SenderFaceURL string `protobuf:"bytes,11,opt,name=SenderFaceURL" json:"senderFaceUrl"` - // @inject_tag: json:"clientMsgID" - ClientMsgID string `protobuf:"bytes,12,opt,name=ClientMsgID" json:"clientMsgID"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MsgFormat) Reset() { *m = MsgFormat{} } -func (m *MsgFormat) String() string { return proto.CompactTextString(m) } -func (*MsgFormat) ProtoMessage() {} -func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{5} -} -func (m *MsgFormat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgFormat.Unmarshal(m, b) -} -func (m *MsgFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgFormat.Marshal(b, m, deterministic) -} -func (dst *MsgFormat) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgFormat.Merge(dst, src) -} -func (m *MsgFormat) XXX_Size() int { - return xxx_messageInfo_MsgFormat.Size(m) -} -func (m *MsgFormat) XXX_DiscardUnknown() { - xxx_messageInfo_MsgFormat.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgFormat proto.InternalMessageInfo - -func (m *MsgFormat) GetSendID() string { - if m != nil { - return m.SendID - } - return "" -} - -func (m *MsgFormat) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *MsgFormat) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *MsgFormat) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *MsgFormat) GetServerMsgID() string { - if m != nil { - return m.ServerMsgID - } - return "" -} - -func (m *MsgFormat) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *MsgFormat) GetSeq() int64 { - if m != nil { - return m.Seq - } - return 0 -} - -func (m *MsgFormat) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - -func (m *MsgFormat) GetSenderPlatformID() int32 { - if m != nil { - return m.SenderPlatformID - } - return 0 -} - -func (m *MsgFormat) GetSenderNickName() string { - if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *MsgFormat) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *MsgFormat) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - -type UserSendMsgReq struct { - Options map[string]int32 `protobuf:"bytes,1,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - SenderNickName string `protobuf:"bytes,2,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,3,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - PlatformID int32 `protobuf:"varint,4,opt,name=PlatformID" json:"PlatformID,omitempty"` - SessionType int32 `protobuf:"varint,5,opt,name=SessionType" json:"SessionType,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` - RecvID string `protobuf:"bytes,8,opt,name=RecvID" json:"RecvID,omitempty"` - ForceList []string `protobuf:"bytes,9,rep,name=ForceList" json:"ForceList,omitempty"` - Content string `protobuf:"bytes,10,opt,name=Content" json:"Content,omitempty"` - ClientMsgID string `protobuf:"bytes,11,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } -func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } -func (*UserSendMsgReq) ProtoMessage() {} -func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{6} -} -func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) -} -func (m *UserSendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserSendMsgReq.Marshal(b, m, deterministic) -} -func (dst *UserSendMsgReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserSendMsgReq.Merge(dst, src) -} -func (m *UserSendMsgReq) XXX_Size() int { - return xxx_messageInfo_UserSendMsgReq.Size(m) -} -func (m *UserSendMsgReq) XXX_DiscardUnknown() { - xxx_messageInfo_UserSendMsgReq.DiscardUnknown(m) -} - -var xxx_messageInfo_UserSendMsgReq proto.InternalMessageInfo - -func (m *UserSendMsgReq) GetOptions() map[string]int32 { - if m != nil { - return m.Options - } - return nil -} - -func (m *UserSendMsgReq) GetSenderNickName() string { - if m != nil { - return m.SenderNickName - } - return "" -} - -func (m *UserSendMsgReq) GetSenderFaceURL() string { - if m != nil { - return m.SenderFaceURL - } - return "" -} - -func (m *UserSendMsgReq) GetPlatformID() int32 { - if m != nil { - return m.PlatformID - } - return 0 -} - -func (m *UserSendMsgReq) GetSessionType() int32 { - if m != nil { - return m.SessionType - } - return 0 -} - -func (m *UserSendMsgReq) GetMsgFrom() int32 { - if m != nil { - return m.MsgFrom - } - return 0 -} - -func (m *UserSendMsgReq) GetContentType() int32 { - if m != nil { - return m.ContentType - } - return 0 -} - -func (m *UserSendMsgReq) GetRecvID() string { - if m != nil { - return m.RecvID - } - return "" -} - -func (m *UserSendMsgReq) GetForceList() []string { - if m != nil { - return m.ForceList - } - return nil -} - -func (m *UserSendMsgReq) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -func (m *UserSendMsgReq) GetClientMsgID() string { - if m != nil { - return m.ClientMsgID - } - return "" -} - type UserSendMsgResp struct { - ServerMsgID string `protobuf:"bytes,1,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` - ClientMsgID string `protobuf:"bytes,2,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID" json:"serverMsgID,omitempty"` + ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID" json:"clientMsgID,omitempty"` SendTime int64 `protobuf:"varint,3,opt,name=sendTime" json:"sendTime,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -511,7 +1047,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{7} + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{12} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -553,29 +1089,34 @@ func (m *UserSendMsgResp) GetSendTime() int64 { } type MsgData struct { - SendID string `protobuf:"bytes,1,opt,name=sendID" json:"sendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=recvID" json:"recvID,omitempty"` - SessionType int32 `protobuf:"varint,3,opt,name=sessionType" json:"sessionType,omitempty"` - MsgFrom int32 `protobuf:"varint,4,opt,name=msgFrom" json:"msgFrom,omitempty"` - ContentType int32 `protobuf:"varint,5,opt,name=contentType" json:"contentType,omitempty"` - ServerMsgID string `protobuf:"bytes,6,opt,name=serverMsgID" json:"serverMsgID,omitempty"` - Content string `protobuf:"bytes,7,opt,name=content" json:"content,omitempty"` - SendTime int64 `protobuf:"varint,8,opt,name=sendTime" json:"sendTime,omitempty"` - Seq int64 `protobuf:"varint,9,opt,name=seq" json:"seq,omitempty"` - SenderPlatformID int32 `protobuf:"varint,10,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` - SenderNickName string `protobuf:"bytes,11,opt,name=senderNickName" json:"senderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,12,opt,name=senderFaceURL" json:"senderFaceURL,omitempty"` - ClientMsgID string `protobuf:"bytes,13,opt,name=clientMsgID" json:"clientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SendID string `protobuf:"bytes,1,opt,name=sendID" json:"sendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=recvID" json:"recvID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + ServerMsgID string `protobuf:"bytes,5,opt,name=serverMsgID" json:"serverMsgID,omitempty"` + SenderPlatformID int32 `protobuf:"varint,6,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` + SenderNickname string `protobuf:"bytes,7,opt,name=senderNickname" json:"senderNickname,omitempty"` + SenderFaceURL string `protobuf:"bytes,8,opt,name=senderFaceURL" json:"senderFaceURL,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=sessionType" json:"sessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,10,opt,name=msgFrom" json:"msgFrom,omitempty"` + ContentType int32 `protobuf:"varint,11,opt,name=contentType" json:"contentType,omitempty"` + Content []byte `protobuf:"bytes,12,opt,name=content,proto3" json:"content,omitempty"` + Seq uint32 `protobuf:"varint,14,opt,name=seq" json:"seq,omitempty"` + SendTime int64 `protobuf:"varint,15,opt,name=sendTime" json:"sendTime,omitempty"` + CreateTime int64 `protobuf:"varint,16,opt,name=createTime" json:"createTime,omitempty"` + Status int32 `protobuf:"varint,17,opt,name=status" json:"status,omitempty"` + Options map[string]bool `protobuf:"bytes,18,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,19,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *MsgData) Reset() { *m = MsgData{} } func (m *MsgData) String() string { return proto.CompactTextString(m) } func (*MsgData) ProtoMessage() {} func (*MsgData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{8} + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{13} } func (m *MsgData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgData.Unmarshal(m, b) @@ -609,6 +1150,48 @@ func (m *MsgData) GetRecvID() string { return "" } +func (m *MsgData) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *MsgData) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *MsgData) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID + } + return "" +} + +func (m *MsgData) GetSenderPlatformID() int32 { + if m != nil { + return m.SenderPlatformID + } + return 0 +} + +func (m *MsgData) GetSenderNickname() string { + if m != nil { + return m.SenderNickname + } + return "" +} + +func (m *MsgData) GetSenderFaceURL() string { + if m != nil { + return m.SenderFaceURL + } + return "" +} + func (m *MsgData) GetSessionType() int32 { if m != nil { return m.SessionType @@ -630,18 +1213,18 @@ func (m *MsgData) GetContentType() int32 { return 0 } -func (m *MsgData) GetServerMsgID() string { - if m != nil { - return m.ServerMsgID - } - return "" -} - -func (m *MsgData) GetContent() string { +func (m *MsgData) GetContent() []byte { if m != nil { return m.Content } - return "" + return nil +} + +func (m *MsgData) GetSeq() uint32 { + if m != nil { + return m.Seq + } + return 0 } func (m *MsgData) GetSendTime() int64 { @@ -651,103 +1234,1533 @@ func (m *MsgData) GetSendTime() int64 { return 0 } -func (m *MsgData) GetSeq() int64 { +func (m *MsgData) GetCreateTime() int64 { if m != nil { - return m.Seq + return m.CreateTime } return 0 } -func (m *MsgData) GetSenderPlatformID() int32 { +func (m *MsgData) GetStatus() int32 { if m != nil { - return m.SenderPlatformID + return m.Status } return 0 } -func (m *MsgData) GetSenderNickName() string { +func (m *MsgData) GetOptions() map[string]bool { if m != nil { - return m.SenderNickName + return m.Options + } + return nil +} + +func (m *MsgData) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +type OfflinePushInfo struct { + Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=desc" json:"desc,omitempty"` + Ex string `protobuf:"bytes,3,opt,name=ex" json:"ex,omitempty"` + IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound" json:"iOSPushSound,omitempty"` + IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount" json:"iOSBadgeCount,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OfflinePushInfo) Reset() { *m = OfflinePushInfo{} } +func (m *OfflinePushInfo) String() string { return proto.CompactTextString(m) } +func (*OfflinePushInfo) ProtoMessage() {} +func (*OfflinePushInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{14} +} +func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) +} +func (m *OfflinePushInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OfflinePushInfo.Marshal(b, m, deterministic) +} +func (dst *OfflinePushInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_OfflinePushInfo.Merge(dst, src) +} +func (m *OfflinePushInfo) XXX_Size() int { + return xxx_messageInfo_OfflinePushInfo.Size(m) +} +func (m *OfflinePushInfo) XXX_DiscardUnknown() { + xxx_messageInfo_OfflinePushInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_OfflinePushInfo proto.InternalMessageInfo + +func (m *OfflinePushInfo) GetTitle() string { + if m != nil { + return m.Title } return "" } -func (m *MsgData) GetSenderFaceURL() string { +func (m *OfflinePushInfo) GetDesc() string { if m != nil { - return m.SenderFaceURL + return m.Desc } return "" } -func (m *MsgData) GetClientMsgID() string { +func (m *OfflinePushInfo) GetEx() string { if m != nil { - return m.ClientMsgID + return m.Ex } return "" } +func (m *OfflinePushInfo) GetIOSPushSound() string { + if m != nil { + return m.IOSPushSound + } + return "" +} + +func (m *OfflinePushInfo) GetIOSBadgeCount() bool { + if m != nil { + return m.IOSBadgeCount + } + return false +} + +type TipsComm struct { + Detail []byte `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` + DefaultTips string `protobuf:"bytes,2,opt,name=defaultTips" json:"defaultTips,omitempty"` + JsonDetail string `protobuf:"bytes,3,opt,name=jsonDetail" json:"jsonDetail,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TipsComm) Reset() { *m = TipsComm{} } +func (m *TipsComm) String() string { return proto.CompactTextString(m) } +func (*TipsComm) ProtoMessage() {} +func (*TipsComm) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{15} +} +func (m *TipsComm) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TipsComm.Unmarshal(m, b) +} +func (m *TipsComm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TipsComm.Marshal(b, m, deterministic) +} +func (dst *TipsComm) XXX_Merge(src proto.Message) { + xxx_messageInfo_TipsComm.Merge(dst, src) +} +func (m *TipsComm) XXX_Size() int { + return xxx_messageInfo_TipsComm.Size(m) +} +func (m *TipsComm) XXX_DiscardUnknown() { + xxx_messageInfo_TipsComm.DiscardUnknown(m) +} + +var xxx_messageInfo_TipsComm proto.InternalMessageInfo + +func (m *TipsComm) GetDetail() []byte { + if m != nil { + return m.Detail + } + return nil +} + +func (m *TipsComm) GetDefaultTips() string { + if m != nil { + return m.DefaultTips + } + return "" +} + +func (m *TipsComm) GetJsonDetail() string { + if m != nil { + return m.JsonDetail + } + return "" +} + +// OnGroupCreated() +type GroupCreatedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + MemberList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + GroupOwnerUser *GroupMemberFullInfo `protobuf:"bytes,5,opt,name=groupOwnerUser" json:"groupOwnerUser,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupCreatedTips) Reset() { *m = GroupCreatedTips{} } +func (m *GroupCreatedTips) String() string { return proto.CompactTextString(m) } +func (*GroupCreatedTips) ProtoMessage() {} +func (*GroupCreatedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{16} +} +func (m *GroupCreatedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupCreatedTips.Unmarshal(m, b) +} +func (m *GroupCreatedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupCreatedTips.Marshal(b, m, deterministic) +} +func (dst *GroupCreatedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupCreatedTips.Merge(dst, src) +} +func (m *GroupCreatedTips) XXX_Size() int { + return xxx_messageInfo_GroupCreatedTips.Size(m) +} +func (m *GroupCreatedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupCreatedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupCreatedTips proto.InternalMessageInfo + +func (m *GroupCreatedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupCreatedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupCreatedTips) GetMemberList() []*GroupMemberFullInfo { + if m != nil { + return m.MemberList + } + return nil +} + +func (m *GroupCreatedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +func (m *GroupCreatedTips) GetGroupOwnerUser() *GroupMemberFullInfo { + if m != nil { + return m.GroupOwnerUser + } + return nil +} + +// OnGroupInfoSet() +type GroupInfoSetTips struct { + OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser" json:"opUser,omitempty"` + MuteTime int64 `protobuf:"varint,2,opt,name=muteTime" json:"muteTime,omitempty"` + Group *GroupInfo `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupInfoSetTips) Reset() { *m = GroupInfoSetTips{} } +func (m *GroupInfoSetTips) String() string { return proto.CompactTextString(m) } +func (*GroupInfoSetTips) ProtoMessage() {} +func (*GroupInfoSetTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{17} +} +func (m *GroupInfoSetTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupInfoSetTips.Unmarshal(m, b) +} +func (m *GroupInfoSetTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupInfoSetTips.Marshal(b, m, deterministic) +} +func (dst *GroupInfoSetTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupInfoSetTips.Merge(dst, src) +} +func (m *GroupInfoSetTips) XXX_Size() int { + return xxx_messageInfo_GroupInfoSetTips.Size(m) +} +func (m *GroupInfoSetTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupInfoSetTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupInfoSetTips proto.InternalMessageInfo + +func (m *GroupInfoSetTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupInfoSetTips) GetMuteTime() int64 { + if m != nil { + return m.MuteTime + } + return 0 +} + +func (m *GroupInfoSetTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +// OnJoinGroupApplication() +type JoinGroupApplicationTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + Applicant *PublicUserInfo `protobuf:"bytes,2,opt,name=applicant" json:"applicant,omitempty"` + ReqMsg string `protobuf:"bytes,3,opt,name=reqMsg" json:"reqMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JoinGroupApplicationTips) Reset() { *m = JoinGroupApplicationTips{} } +func (m *JoinGroupApplicationTips) String() string { return proto.CompactTextString(m) } +func (*JoinGroupApplicationTips) ProtoMessage() {} +func (*JoinGroupApplicationTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{18} +} +func (m *JoinGroupApplicationTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_JoinGroupApplicationTips.Unmarshal(m, b) +} +func (m *JoinGroupApplicationTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_JoinGroupApplicationTips.Marshal(b, m, deterministic) +} +func (dst *JoinGroupApplicationTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_JoinGroupApplicationTips.Merge(dst, src) +} +func (m *JoinGroupApplicationTips) XXX_Size() int { + return xxx_messageInfo_JoinGroupApplicationTips.Size(m) +} +func (m *JoinGroupApplicationTips) XXX_DiscardUnknown() { + xxx_messageInfo_JoinGroupApplicationTips.DiscardUnknown(m) +} + +var xxx_messageInfo_JoinGroupApplicationTips proto.InternalMessageInfo + +func (m *JoinGroupApplicationTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *JoinGroupApplicationTips) GetApplicant() *PublicUserInfo { + if m != nil { + return m.Applicant + } + return nil +} + +func (m *JoinGroupApplicationTips) GetReqMsg() string { + if m != nil { + return m.ReqMsg + } + return "" +} + +// OnQuitGroup() +// Actively leave the group +type MemberQuitTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + QuitUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=quitUser" json:"quitUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberQuitTips) Reset() { *m = MemberQuitTips{} } +func (m *MemberQuitTips) String() string { return proto.CompactTextString(m) } +func (*MemberQuitTips) ProtoMessage() {} +func (*MemberQuitTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{19} +} +func (m *MemberQuitTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberQuitTips.Unmarshal(m, b) +} +func (m *MemberQuitTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberQuitTips.Marshal(b, m, deterministic) +} +func (dst *MemberQuitTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberQuitTips.Merge(dst, src) +} +func (m *MemberQuitTips) XXX_Size() int { + return xxx_messageInfo_MemberQuitTips.Size(m) +} +func (m *MemberQuitTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberQuitTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberQuitTips proto.InternalMessageInfo + +func (m *MemberQuitTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberQuitTips) GetQuitUser() *GroupMemberFullInfo { + if m != nil { + return m.QuitUser + } + return nil +} + +func (m *MemberQuitTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// OnApplicationGroupAccepted() +type GroupApplicationAcceptedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupApplicationAcceptedTips) Reset() { *m = GroupApplicationAcceptedTips{} } +func (m *GroupApplicationAcceptedTips) String() string { return proto.CompactTextString(m) } +func (*GroupApplicationAcceptedTips) ProtoMessage() {} +func (*GroupApplicationAcceptedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{20} +} +func (m *GroupApplicationAcceptedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupApplicationAcceptedTips.Unmarshal(m, b) +} +func (m *GroupApplicationAcceptedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupApplicationAcceptedTips.Marshal(b, m, deterministic) +} +func (dst *GroupApplicationAcceptedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupApplicationAcceptedTips.Merge(dst, src) +} +func (m *GroupApplicationAcceptedTips) XXX_Size() int { + return xxx_messageInfo_GroupApplicationAcceptedTips.Size(m) +} +func (m *GroupApplicationAcceptedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupApplicationAcceptedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupApplicationAcceptedTips proto.InternalMessageInfo + +func (m *GroupApplicationAcceptedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupApplicationAcceptedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupApplicationAcceptedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// OnApplicationGroupRejected() +type GroupApplicationRejectedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupApplicationRejectedTips) Reset() { *m = GroupApplicationRejectedTips{} } +func (m *GroupApplicationRejectedTips) String() string { return proto.CompactTextString(m) } +func (*GroupApplicationRejectedTips) ProtoMessage() {} +func (*GroupApplicationRejectedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{21} +} +func (m *GroupApplicationRejectedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupApplicationRejectedTips.Unmarshal(m, b) +} +func (m *GroupApplicationRejectedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupApplicationRejectedTips.Marshal(b, m, deterministic) +} +func (dst *GroupApplicationRejectedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupApplicationRejectedTips.Merge(dst, src) +} +func (m *GroupApplicationRejectedTips) XXX_Size() int { + return xxx_messageInfo_GroupApplicationRejectedTips.Size(m) +} +func (m *GroupApplicationRejectedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupApplicationRejectedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupApplicationRejectedTips proto.InternalMessageInfo + +func (m *GroupApplicationRejectedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupApplicationRejectedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupApplicationRejectedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// OnTransferGroupOwner() +type GroupOwnerTransferredTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + NewGroupOwner *GroupMemberFullInfo `protobuf:"bytes,3,opt,name=newGroupOwner" json:"newGroupOwner,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupOwnerTransferredTips) Reset() { *m = GroupOwnerTransferredTips{} } +func (m *GroupOwnerTransferredTips) String() string { return proto.CompactTextString(m) } +func (*GroupOwnerTransferredTips) ProtoMessage() {} +func (*GroupOwnerTransferredTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{22} +} +func (m *GroupOwnerTransferredTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupOwnerTransferredTips.Unmarshal(m, b) +} +func (m *GroupOwnerTransferredTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupOwnerTransferredTips.Marshal(b, m, deterministic) +} +func (dst *GroupOwnerTransferredTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupOwnerTransferredTips.Merge(dst, src) +} +func (m *GroupOwnerTransferredTips) XXX_Size() int { + return xxx_messageInfo_GroupOwnerTransferredTips.Size(m) +} +func (m *GroupOwnerTransferredTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupOwnerTransferredTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupOwnerTransferredTips proto.InternalMessageInfo + +func (m *GroupOwnerTransferredTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupOwnerTransferredTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupOwnerTransferredTips) GetNewGroupOwner() *GroupMemberFullInfo { + if m != nil { + return m.NewGroupOwner + } + return nil +} + +func (m *GroupOwnerTransferredTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// OnMemberKicked() +type MemberKickedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + KickedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=kickedUserList" json:"kickedUserList,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberKickedTips) Reset() { *m = MemberKickedTips{} } +func (m *MemberKickedTips) String() string { return proto.CompactTextString(m) } +func (*MemberKickedTips) ProtoMessage() {} +func (*MemberKickedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{23} +} +func (m *MemberKickedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberKickedTips.Unmarshal(m, b) +} +func (m *MemberKickedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberKickedTips.Marshal(b, m, deterministic) +} +func (dst *MemberKickedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberKickedTips.Merge(dst, src) +} +func (m *MemberKickedTips) XXX_Size() int { + return xxx_messageInfo_MemberKickedTips.Size(m) +} +func (m *MemberKickedTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberKickedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberKickedTips proto.InternalMessageInfo + +func (m *MemberKickedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberKickedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *MemberKickedTips) GetKickedUserList() []*GroupMemberFullInfo { + if m != nil { + return m.KickedUserList + } + return nil +} + +func (m *MemberKickedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// OnMemberInvited() +type MemberInvitedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + InvitedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=invitedUserList" json:"invitedUserList,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberInvitedTips) Reset() { *m = MemberInvitedTips{} } +func (m *MemberInvitedTips) String() string { return proto.CompactTextString(m) } +func (*MemberInvitedTips) ProtoMessage() {} +func (*MemberInvitedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{24} +} +func (m *MemberInvitedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberInvitedTips.Unmarshal(m, b) +} +func (m *MemberInvitedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberInvitedTips.Marshal(b, m, deterministic) +} +func (dst *MemberInvitedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberInvitedTips.Merge(dst, src) +} +func (m *MemberInvitedTips) XXX_Size() int { + return xxx_messageInfo_MemberInvitedTips.Size(m) +} +func (m *MemberInvitedTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberInvitedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberInvitedTips proto.InternalMessageInfo + +func (m *MemberInvitedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberInvitedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *MemberInvitedTips) GetInvitedUserList() []*GroupMemberFullInfo { + if m != nil { + return m.InvitedUserList + } + return nil +} + +func (m *MemberInvitedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// Actively join the group +type MemberEnterTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + EntrantUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=entrantUser" json:"entrantUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberEnterTips) Reset() { *m = MemberEnterTips{} } +func (m *MemberEnterTips) String() string { return proto.CompactTextString(m) } +func (*MemberEnterTips) ProtoMessage() {} +func (*MemberEnterTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{25} +} +func (m *MemberEnterTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberEnterTips.Unmarshal(m, b) +} +func (m *MemberEnterTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberEnterTips.Marshal(b, m, deterministic) +} +func (dst *MemberEnterTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberEnterTips.Merge(dst, src) +} +func (m *MemberEnterTips) XXX_Size() int { + return xxx_messageInfo_MemberEnterTips.Size(m) +} +func (m *MemberEnterTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberEnterTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberEnterTips proto.InternalMessageInfo + +func (m *MemberEnterTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberEnterTips) GetEntrantUser() *GroupMemberFullInfo { + if m != nil { + return m.EntrantUser + } + return nil +} + +func (m *MemberEnterTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +type FriendApplication struct { + AddTime int64 `protobuf:"varint,1,opt,name=addTime" json:"addTime,omitempty"` + AddSource string `protobuf:"bytes,2,opt,name=addSource" json:"addSource,omitempty"` + AddWording string `protobuf:"bytes,3,opt,name=addWording" json:"addWording,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplication) Reset() { *m = FriendApplication{} } +func (m *FriendApplication) String() string { return proto.CompactTextString(m) } +func (*FriendApplication) ProtoMessage() {} +func (*FriendApplication) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{26} +} +func (m *FriendApplication) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplication.Unmarshal(m, b) +} +func (m *FriendApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplication.Marshal(b, m, deterministic) +} +func (dst *FriendApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplication.Merge(dst, src) +} +func (m *FriendApplication) XXX_Size() int { + return xxx_messageInfo_FriendApplication.Size(m) +} +func (m *FriendApplication) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplication proto.InternalMessageInfo + +func (m *FriendApplication) GetAddTime() int64 { + if m != nil { + return m.AddTime + } + return 0 +} + +func (m *FriendApplication) GetAddSource() string { + if m != nil { + return m.AddSource + } + return "" +} + +func (m *FriendApplication) GetAddWording() string { + if m != nil { + return m.AddWording + } + return "" +} + +type FromToUserID struct { + FromUserID string `protobuf:"bytes,1,opt,name=fromUserID" json:"fromUserID,omitempty"` + ToUserID string `protobuf:"bytes,2,opt,name=toUserID" json:"toUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FromToUserID) Reset() { *m = FromToUserID{} } +func (m *FromToUserID) String() string { return proto.CompactTextString(m) } +func (*FromToUserID) ProtoMessage() {} +func (*FromToUserID) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{27} +} +func (m *FromToUserID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FromToUserID.Unmarshal(m, b) +} +func (m *FromToUserID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FromToUserID.Marshal(b, m, deterministic) +} +func (dst *FromToUserID) XXX_Merge(src proto.Message) { + xxx_messageInfo_FromToUserID.Merge(dst, src) +} +func (m *FromToUserID) XXX_Size() int { + return xxx_messageInfo_FromToUserID.Size(m) +} +func (m *FromToUserID) XXX_DiscardUnknown() { + xxx_messageInfo_FromToUserID.DiscardUnknown(m) +} + +var xxx_messageInfo_FromToUserID proto.InternalMessageInfo + +func (m *FromToUserID) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *FromToUserID) GetToUserID() string { + if m != nil { + return m.ToUserID + } + return "" +} + +// FromUserID apply to add ToUserID +type FriendApplicationTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplicationTips) Reset() { *m = FriendApplicationTips{} } +func (m *FriendApplicationTips) String() string { return proto.CompactTextString(m) } +func (*FriendApplicationTips) ProtoMessage() {} +func (*FriendApplicationTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{28} +} +func (m *FriendApplicationTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplicationTips.Unmarshal(m, b) +} +func (m *FriendApplicationTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplicationTips.Marshal(b, m, deterministic) +} +func (dst *FriendApplicationTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplicationTips.Merge(dst, src) +} +func (m *FriendApplicationTips) XXX_Size() int { + return xxx_messageInfo_FriendApplicationTips.Size(m) +} +func (m *FriendApplicationTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplicationTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplicationTips proto.InternalMessageInfo + +func (m *FriendApplicationTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +// FromUserID accept or reject ToUserID +type FriendApplicationApprovedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplicationApprovedTips) Reset() { *m = FriendApplicationApprovedTips{} } +func (m *FriendApplicationApprovedTips) String() string { return proto.CompactTextString(m) } +func (*FriendApplicationApprovedTips) ProtoMessage() {} +func (*FriendApplicationApprovedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{29} +} +func (m *FriendApplicationApprovedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplicationApprovedTips.Unmarshal(m, b) +} +func (m *FriendApplicationApprovedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplicationApprovedTips.Marshal(b, m, deterministic) +} +func (dst *FriendApplicationApprovedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplicationApprovedTips.Merge(dst, src) +} +func (m *FriendApplicationApprovedTips) XXX_Size() int { + return xxx_messageInfo_FriendApplicationApprovedTips.Size(m) +} +func (m *FriendApplicationApprovedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplicationApprovedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplicationApprovedTips proto.InternalMessageInfo + +func (m *FriendApplicationApprovedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +func (m *FriendApplicationApprovedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// FromUserID accept or reject ToUserID +type FriendApplicationRejectedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplicationRejectedTips) Reset() { *m = FriendApplicationRejectedTips{} } +func (m *FriendApplicationRejectedTips) String() string { return proto.CompactTextString(m) } +func (*FriendApplicationRejectedTips) ProtoMessage() {} +func (*FriendApplicationRejectedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{30} +} +func (m *FriendApplicationRejectedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplicationRejectedTips.Unmarshal(m, b) +} +func (m *FriendApplicationRejectedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplicationRejectedTips.Marshal(b, m, deterministic) +} +func (dst *FriendApplicationRejectedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplicationRejectedTips.Merge(dst, src) +} +func (m *FriendApplicationRejectedTips) XXX_Size() int { + return xxx_messageInfo_FriendApplicationRejectedTips.Size(m) +} +func (m *FriendApplicationRejectedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplicationRejectedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplicationRejectedTips proto.InternalMessageInfo + +func (m *FriendApplicationRejectedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +func (m *FriendApplicationRejectedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// FromUserID Added a friend ToUserID +type FriendAddedTips struct { + Friend *FriendInfo `protobuf:"bytes,1,opt,name=friend" json:"friend,omitempty"` + OperationTime int64 `protobuf:"varint,2,opt,name=operationTime" json:"operationTime,omitempty"` + OpUser *PublicUserInfo `protobuf:"bytes,3,opt,name=opUser" json:"opUser,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendAddedTips) Reset() { *m = FriendAddedTips{} } +func (m *FriendAddedTips) String() string { return proto.CompactTextString(m) } +func (*FriendAddedTips) ProtoMessage() {} +func (*FriendAddedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{31} +} +func (m *FriendAddedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendAddedTips.Unmarshal(m, b) +} +func (m *FriendAddedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendAddedTips.Marshal(b, m, deterministic) +} +func (dst *FriendAddedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendAddedTips.Merge(dst, src) +} +func (m *FriendAddedTips) XXX_Size() int { + return xxx_messageInfo_FriendAddedTips.Size(m) +} +func (m *FriendAddedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendAddedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendAddedTips proto.InternalMessageInfo + +func (m *FriendAddedTips) GetFriend() *FriendInfo { + if m != nil { + return m.Friend + } + return nil +} + +func (m *FriendAddedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +func (m *FriendAddedTips) GetOpUser() *PublicUserInfo { + if m != nil { + return m.OpUser + } + return nil +} + +// FromUserID deleted a friend ToUserID +type FriendDeletedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendDeletedTips) Reset() { *m = FriendDeletedTips{} } +func (m *FriendDeletedTips) String() string { return proto.CompactTextString(m) } +func (*FriendDeletedTips) ProtoMessage() {} +func (*FriendDeletedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{32} +} +func (m *FriendDeletedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendDeletedTips.Unmarshal(m, b) +} +func (m *FriendDeletedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendDeletedTips.Marshal(b, m, deterministic) +} +func (dst *FriendDeletedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendDeletedTips.Merge(dst, src) +} +func (m *FriendDeletedTips) XXX_Size() int { + return xxx_messageInfo_FriendDeletedTips.Size(m) +} +func (m *FriendDeletedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendDeletedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendDeletedTips proto.InternalMessageInfo + +func (m *FriendDeletedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +type BlackAddedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlackAddedTips) Reset() { *m = BlackAddedTips{} } +func (m *BlackAddedTips) String() string { return proto.CompactTextString(m) } +func (*BlackAddedTips) ProtoMessage() {} +func (*BlackAddedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{33} +} +func (m *BlackAddedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlackAddedTips.Unmarshal(m, b) +} +func (m *BlackAddedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlackAddedTips.Marshal(b, m, deterministic) +} +func (dst *BlackAddedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlackAddedTips.Merge(dst, src) +} +func (m *BlackAddedTips) XXX_Size() int { + return xxx_messageInfo_BlackAddedTips.Size(m) +} +func (m *BlackAddedTips) XXX_DiscardUnknown() { + xxx_messageInfo_BlackAddedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_BlackAddedTips proto.InternalMessageInfo + +func (m *BlackAddedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +type BlackDeletedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlackDeletedTips) Reset() { *m = BlackDeletedTips{} } +func (m *BlackDeletedTips) String() string { return proto.CompactTextString(m) } +func (*BlackDeletedTips) ProtoMessage() {} +func (*BlackDeletedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{34} +} +func (m *BlackDeletedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlackDeletedTips.Unmarshal(m, b) +} +func (m *BlackDeletedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlackDeletedTips.Marshal(b, m, deterministic) +} +func (dst *BlackDeletedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlackDeletedTips.Merge(dst, src) +} +func (m *BlackDeletedTips) XXX_Size() int { + return xxx_messageInfo_BlackDeletedTips.Size(m) +} +func (m *BlackDeletedTips) XXX_DiscardUnknown() { + xxx_messageInfo_BlackDeletedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_BlackDeletedTips proto.InternalMessageInfo + +func (m *BlackDeletedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +type FriendInfoChangedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendInfoChangedTips) Reset() { *m = FriendInfoChangedTips{} } +func (m *FriendInfoChangedTips) String() string { return proto.CompactTextString(m) } +func (*FriendInfoChangedTips) ProtoMessage() {} +func (*FriendInfoChangedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{35} +} +func (m *FriendInfoChangedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendInfoChangedTips.Unmarshal(m, b) +} +func (m *FriendInfoChangedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendInfoChangedTips.Marshal(b, m, deterministic) +} +func (dst *FriendInfoChangedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendInfoChangedTips.Merge(dst, src) +} +func (m *FriendInfoChangedTips) XXX_Size() int { + return xxx_messageInfo_FriendInfoChangedTips.Size(m) +} +func (m *FriendInfoChangedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendInfoChangedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendInfoChangedTips proto.InternalMessageInfo + +func (m *FriendInfoChangedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +// ////////////////////user///////////////////// +type UserInfoUpdatedTips struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserInfoUpdatedTips) Reset() { *m = UserInfoUpdatedTips{} } +func (m *UserInfoUpdatedTips) String() string { return proto.CompactTextString(m) } +func (*UserInfoUpdatedTips) ProtoMessage() {} +func (*UserInfoUpdatedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{36} +} +func (m *UserInfoUpdatedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserInfoUpdatedTips.Unmarshal(m, b) +} +func (m *UserInfoUpdatedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserInfoUpdatedTips.Marshal(b, m, deterministic) +} +func (dst *UserInfoUpdatedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInfoUpdatedTips.Merge(dst, src) +} +func (m *UserInfoUpdatedTips) XXX_Size() int { + return xxx_messageInfo_UserInfoUpdatedTips.Size(m) +} +func (m *UserInfoUpdatedTips) XXX_DiscardUnknown() { + xxx_messageInfo_UserInfoUpdatedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_UserInfoUpdatedTips proto.InternalMessageInfo + +func (m *UserInfoUpdatedTips) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +// ////////////////////conversation///////////////////// +type ConversationUpdateTips struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConversationUpdateTips) Reset() { *m = ConversationUpdateTips{} } +func (m *ConversationUpdateTips) String() string { return proto.CompactTextString(m) } +func (*ConversationUpdateTips) ProtoMessage() {} +func (*ConversationUpdateTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{37} +} +func (m *ConversationUpdateTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConversationUpdateTips.Unmarshal(m, b) +} +func (m *ConversationUpdateTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConversationUpdateTips.Marshal(b, m, deterministic) +} +func (dst *ConversationUpdateTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConversationUpdateTips.Merge(dst, src) +} +func (m *ConversationUpdateTips) XXX_Size() int { + return xxx_messageInfo_ConversationUpdateTips.Size(m) +} +func (m *ConversationUpdateTips) XXX_DiscardUnknown() { + xxx_messageInfo_ConversationUpdateTips.DiscardUnknown(m) +} + +var xxx_messageInfo_ConversationUpdateTips proto.InternalMessageInfo + +func (m *ConversationUpdateTips) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +// /cms +type RequestPagination struct { + PageNumber int32 `protobuf:"varint,1,opt,name=pageNumber" json:"pageNumber,omitempty"` + ShowNumber int32 `protobuf:"varint,2,opt,name=showNumber" json:"showNumber,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RequestPagination) Reset() { *m = RequestPagination{} } +func (m *RequestPagination) String() string { return proto.CompactTextString(m) } +func (*RequestPagination) ProtoMessage() {} +func (*RequestPagination) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{38} +} +func (m *RequestPagination) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RequestPagination.Unmarshal(m, b) +} +func (m *RequestPagination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RequestPagination.Marshal(b, m, deterministic) +} +func (dst *RequestPagination) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestPagination.Merge(dst, src) +} +func (m *RequestPagination) XXX_Size() int { + return xxx_messageInfo_RequestPagination.Size(m) +} +func (m *RequestPagination) XXX_DiscardUnknown() { + xxx_messageInfo_RequestPagination.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestPagination proto.InternalMessageInfo + +func (m *RequestPagination) GetPageNumber() int32 { + if m != nil { + return m.PageNumber + } + return 0 +} + +func (m *RequestPagination) GetShowNumber() int32 { + if m != nil { + return m.ShowNumber + } + return 0 +} + +type ResponsePagination struct { + CurrentPage int32 `protobuf:"varint,5,opt,name=CurrentPage" json:"CurrentPage,omitempty"` + ShowNumber int32 `protobuf:"varint,6,opt,name=ShowNumber" json:"ShowNumber,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResponsePagination) Reset() { *m = ResponsePagination{} } +func (m *ResponsePagination) String() string { return proto.CompactTextString(m) } +func (*ResponsePagination) ProtoMessage() {} +func (*ResponsePagination) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_c2d3d5fccaf1040a, []int{39} +} +func (m *ResponsePagination) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ResponsePagination.Unmarshal(m, b) +} +func (m *ResponsePagination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ResponsePagination.Marshal(b, m, deterministic) +} +func (dst *ResponsePagination) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponsePagination.Merge(dst, src) +} +func (m *ResponsePagination) XXX_Size() int { + return xxx_messageInfo_ResponsePagination.Size(m) +} +func (m *ResponsePagination) XXX_DiscardUnknown() { + xxx_messageInfo_ResponsePagination.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponsePagination proto.InternalMessageInfo + +func (m *ResponsePagination) GetCurrentPage() int32 { + if m != nil { + return m.CurrentPage + } + return 0 +} + +func (m *ResponsePagination) GetShowNumber() int32 { + if m != nil { + return m.ShowNumber + } + return 0 +} + func init() { - proto.RegisterType((*PullMessageBySeqListResp)(nil), "open_im_sdk.PullMessageBySeqListResp") - proto.RegisterType((*PullMessageBySeqListReq)(nil), "open_im_sdk.PullMessageBySeqListReq") - proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "open_im_sdk.GetMaxAndMinSeqReq") - proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "open_im_sdk.GetMaxAndMinSeqResp") - proto.RegisterType((*GatherFormat)(nil), "open_im_sdk.GatherFormat") - proto.RegisterType((*MsgFormat)(nil), "open_im_sdk.MsgFormat") - proto.RegisterType((*UserSendMsgReq)(nil), "open_im_sdk.UserSendMsgReq") - proto.RegisterMapType((map[string]int32)(nil), "open_im_sdk.UserSendMsgReq.OptionsEntry") - proto.RegisterType((*UserSendMsgResp)(nil), "open_im_sdk.UserSendMsgResp") - proto.RegisterType((*MsgData)(nil), "open_im_sdk.MsgData") + proto.RegisterType((*GroupInfo)(nil), "server_api_params.GroupInfo") + proto.RegisterType((*GroupMemberFullInfo)(nil), "server_api_params.GroupMemberFullInfo") + proto.RegisterType((*PublicUserInfo)(nil), "server_api_params.PublicUserInfo") + proto.RegisterType((*UserInfo)(nil), "server_api_params.UserInfo") + proto.RegisterType((*FriendInfo)(nil), "server_api_params.FriendInfo") + proto.RegisterType((*BlackInfo)(nil), "server_api_params.BlackInfo") + proto.RegisterType((*GroupRequest)(nil), "server_api_params.GroupRequest") + proto.RegisterType((*FriendRequest)(nil), "server_api_params.FriendRequest") + proto.RegisterType((*PullMessageBySeqListResp)(nil), "server_api_params.PullMessageBySeqListResp") + proto.RegisterType((*PullMessageBySeqListReq)(nil), "server_api_params.PullMessageBySeqListReq") + proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "server_api_params.GetMaxAndMinSeqReq") + proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "server_api_params.GetMaxAndMinSeqResp") + proto.RegisterType((*UserSendMsgResp)(nil), "server_api_params.UserSendMsgResp") + proto.RegisterType((*MsgData)(nil), "server_api_params.MsgData") + proto.RegisterMapType((map[string]bool)(nil), "server_api_params.MsgData.OptionsEntry") + proto.RegisterType((*OfflinePushInfo)(nil), "server_api_params.OfflinePushInfo") + proto.RegisterType((*TipsComm)(nil), "server_api_params.TipsComm") + proto.RegisterType((*GroupCreatedTips)(nil), "server_api_params.GroupCreatedTips") + proto.RegisterType((*GroupInfoSetTips)(nil), "server_api_params.GroupInfoSetTips") + proto.RegisterType((*JoinGroupApplicationTips)(nil), "server_api_params.JoinGroupApplicationTips") + proto.RegisterType((*MemberQuitTips)(nil), "server_api_params.MemberQuitTips") + proto.RegisterType((*GroupApplicationAcceptedTips)(nil), "server_api_params.GroupApplicationAcceptedTips") + proto.RegisterType((*GroupApplicationRejectedTips)(nil), "server_api_params.GroupApplicationRejectedTips") + proto.RegisterType((*GroupOwnerTransferredTips)(nil), "server_api_params.GroupOwnerTransferredTips") + proto.RegisterType((*MemberKickedTips)(nil), "server_api_params.MemberKickedTips") + proto.RegisterType((*MemberInvitedTips)(nil), "server_api_params.MemberInvitedTips") + proto.RegisterType((*MemberEnterTips)(nil), "server_api_params.MemberEnterTips") + proto.RegisterType((*FriendApplication)(nil), "server_api_params.FriendApplication") + proto.RegisterType((*FromToUserID)(nil), "server_api_params.FromToUserID") + proto.RegisterType((*FriendApplicationTips)(nil), "server_api_params.FriendApplicationTips") + proto.RegisterType((*FriendApplicationApprovedTips)(nil), "server_api_params.FriendApplicationApprovedTips") + proto.RegisterType((*FriendApplicationRejectedTips)(nil), "server_api_params.FriendApplicationRejectedTips") + proto.RegisterType((*FriendAddedTips)(nil), "server_api_params.FriendAddedTips") + proto.RegisterType((*FriendDeletedTips)(nil), "server_api_params.FriendDeletedTips") + proto.RegisterType((*BlackAddedTips)(nil), "server_api_params.BlackAddedTips") + proto.RegisterType((*BlackDeletedTips)(nil), "server_api_params.BlackDeletedTips") + proto.RegisterType((*FriendInfoChangedTips)(nil), "server_api_params.FriendInfoChangedTips") + proto.RegisterType((*UserInfoUpdatedTips)(nil), "server_api_params.UserInfoUpdatedTips") + proto.RegisterType((*ConversationUpdateTips)(nil), "server_api_params.ConversationUpdateTips") + proto.RegisterType((*RequestPagination)(nil), "server_api_params.RequestPagination") + proto.RegisterType((*ResponsePagination)(nil), "server_api_params.ResponsePagination") } -func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_f143de4f947df40f) } +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_c2d3d5fccaf1040a) } -var fileDescriptor_ws_f143de4f947df40f = []byte{ - // 739 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4b, 0x6b, 0xdb, 0x4a, - 0x14, 0x46, 0x52, 0xfc, 0xd0, 0xb1, 0xf3, 0x60, 0x6e, 0xc8, 0xd5, 0x0d, 0x97, 0x8b, 0x11, 0x97, - 0x62, 0xb2, 0x70, 0x20, 0xd9, 0x94, 0x94, 0x52, 0x9a, 0x3a, 0x09, 0x2e, 0x71, 0x1a, 0xc6, 0xc9, - 0xa6, 0x9b, 0xa0, 0xda, 0x53, 0x57, 0xd8, 0x7a, 0x58, 0x47, 0x79, 0xf8, 0xc7, 0xf4, 0x0f, 0x75, - 0xd1, 0x7f, 0x54, 0x28, 0x67, 0x46, 0x72, 0x66, 0x6c, 0xd3, 0x76, 0x37, 0xe7, 0xd3, 0x9c, 0x99, - 0x39, 0xdf, 0x03, 0xc1, 0x36, 0x8e, 0x26, 0x77, 0x8f, 0x78, 0xf8, 0x88, 0x9d, 0x34, 0x4b, 0xf2, - 0x84, 0x35, 0x92, 0x54, 0xc4, 0x77, 0x61, 0x74, 0x87, 0xa3, 0x89, 0xff, 0xcd, 0x02, 0xef, 0xfa, - 0x7e, 0x3a, 0xed, 0x0b, 0xc4, 0x60, 0x2c, 0x4e, 0xe7, 0x03, 0x31, 0xbb, 0x0c, 0x31, 0xe7, 0x02, - 0x53, 0xb6, 0x07, 0xd5, 0x7e, 0xf0, 0x34, 0x10, 0x33, 0xcf, 0x6a, 0x59, 0x6d, 0x87, 0x17, 0x95, - 0xc4, 0xc3, 0x98, 0x70, 0xbb, 0xc0, 0x65, 0xc5, 0xde, 0xc0, 0xe6, 0x20, 0x8c, 0xc7, 0x53, 0x71, - 0x8b, 0x22, 0xeb, 0xe3, 0xd8, 0x73, 0x5a, 0x4e, 0xbb, 0x71, 0xf4, 0x4f, 0x47, 0xbb, 0xb1, 0x73, - 0x11, 0xe4, 0x5f, 0x44, 0x76, 0x9e, 0x64, 0x51, 0x90, 0x73, 0x73, 0x3f, 0x7b, 0x0d, 0xcd, 0x8b, - 0x2c, 0xb9, 0x4f, 0xcb, 0xfe, 0x8d, 0xdf, 0xf5, 0x1b, 0xdb, 0xfd, 0x63, 0xf8, 0x7b, 0xfd, 0x2c, - 0x33, 0xe6, 0x41, 0x0d, 0x55, 0xe5, 0x59, 0x2d, 0xa7, 0xed, 0xf0, 0xb2, 0xf4, 0x77, 0x81, 0x5d, - 0x88, 0xbc, 0x1f, 0x3c, 0xbd, 0x8d, 0x47, 0x6a, 0x0e, 0x2e, 0x66, 0xfe, 0x19, 0xfc, 0xb5, 0x82, - 0x2a, 0x46, 0x22, 0x83, 0x91, 0x68, 0xc1, 0x48, 0x64, 0x30, 0xa2, 0x2a, 0xff, 0x3d, 0x34, 0xf5, - 0xf7, 0xb2, 0x2d, 0xb0, 0x7b, 0x5d, 0xd9, 0xeb, 0x72, 0xbb, 0xd7, 0x65, 0x07, 0xb0, 0x21, 0xdf, - 0x64, 0xcb, 0x41, 0xf7, 0x8c, 0x41, 0xfb, 0x38, 0x2e, 0xa6, 0x94, 0x7b, 0xfc, 0x1f, 0x36, 0xb8, - 0x0b, 0x8c, 0x6e, 0x1c, 0x88, 0x78, 0xb4, 0x38, 0xad, 0xa8, 0x08, 0xe7, 0x62, 0xf8, 0xd0, 0xeb, - 0xca, 0x97, 0xb8, 0xbc, 0xa8, 0x88, 0x00, 0x6a, 0xce, 0x92, 0xc8, 0x73, 0x5a, 0x56, 0xbb, 0xc2, - 0xcb, 0x92, 0xb5, 0xa0, 0xf1, 0x2e, 0x89, 0x73, 0x11, 0xe7, 0x37, 0xf3, 0x54, 0x78, 0x1b, 0xf2, - 0xab, 0x0e, 0xd1, 0x8e, 0x81, 0xc8, 0x1e, 0x24, 0xc9, 0xbd, 0xae, 0x57, 0x91, 0x07, 0xeb, 0x10, - 0x9d, 0x5e, 0x34, 0x78, 0x55, 0xf9, 0xb5, 0x2c, 0xd9, 0x0e, 0x38, 0x44, 0x4b, 0x4d, 0xd2, 0x42, - 0x4b, 0xb6, 0x0f, 0x75, 0x7a, 0xeb, 0x4d, 0x18, 0x09, 0xaf, 0x2e, 0xe1, 0x45, 0xcd, 0x0e, 0x60, - 0x87, 0xd6, 0x22, 0xbb, 0x9e, 0x06, 0xf9, 0xe7, 0x24, 0x8b, 0x7a, 0x5d, 0xcf, 0x95, 0x0f, 0x5a, - 0xc1, 0xd9, 0x0b, 0xd8, 0x52, 0xd8, 0x55, 0x38, 0x9c, 0x5c, 0x05, 0x91, 0xf0, 0x40, 0x5e, 0xbd, - 0x84, 0xb2, 0xff, 0x61, 0x53, 0x21, 0xe7, 0xc1, 0x50, 0xdc, 0xf2, 0x4b, 0xaf, 0x21, 0xb7, 0x99, - 0xa0, 0x64, 0x61, 0x1a, 0x8a, 0x38, 0x57, 0x33, 0x36, 0xd5, 0x8c, 0x1a, 0xe4, 0x7f, 0x77, 0x60, - 0x8b, 0x9c, 0x46, 0x7d, 0x7d, 0x1c, 0x93, 0xab, 0x4e, 0xa1, 0xf6, 0x21, 0xcd, 0xc3, 0x24, 0x46, - 0xe9, 0xaa, 0xc6, 0x51, 0xdb, 0x50, 0xd0, 0xdc, 0xdd, 0x29, 0xb6, 0x9e, 0xc5, 0x79, 0x36, 0xe7, - 0x65, 0xe3, 0x9a, 0x31, 0xec, 0x3f, 0x1b, 0xc3, 0x59, 0x37, 0xc6, 0x7f, 0x00, 0x1a, 0x75, 0x4a, - 0x4b, 0x0d, 0x51, 0x52, 0x22, 0x86, 0x49, 0x2c, 0xc5, 0xae, 0x28, 0xb1, 0x35, 0x48, 0x37, 0x4a, - 0xf5, 0x97, 0x46, 0xa9, 0xad, 0x1a, 0xe5, 0xd9, 0x7c, 0x75, 0xc3, 0x7c, 0xff, 0x82, 0x7b, 0x9e, - 0x64, 0x43, 0x21, 0xbd, 0xee, 0xb6, 0x9c, 0xb6, 0xcb, 0x9f, 0x01, 0xdd, 0x3c, 0x60, 0x9a, 0x67, - 0x49, 0x94, 0xc6, 0x8a, 0x28, 0xfb, 0x27, 0xd0, 0xd4, 0x69, 0x25, 0xbb, 0x4d, 0xc4, 0xbc, 0xc8, - 0x04, 0x2d, 0xd9, 0x2e, 0x54, 0x1e, 0x82, 0xe9, 0xbd, 0xa2, 0xb5, 0xc2, 0x55, 0x71, 0x62, 0xbf, - 0xb4, 0xfc, 0x19, 0x6c, 0x1b, 0x0a, 0x61, 0xba, 0xec, 0x74, 0x6b, 0xd5, 0xe9, 0x4b, 0x4f, 0xb2, - 0x57, 0x9e, 0x44, 0xfe, 0xc6, 0xd2, 0xdf, 0x8e, 0xf2, 0x77, 0x59, 0xfb, 0x5f, 0x1d, 0xc9, 0x6e, - 0x37, 0xc8, 0x03, 0x22, 0x0b, 0x8d, 0x04, 0xe3, 0x22, 0xc1, 0x99, 0x91, 0x60, 0x55, 0xd1, 0xcd, - 0xa8, 0x49, 0xa7, 0x52, 0xac, 0x43, 0x44, 0x64, 0x54, 0x48, 0xa7, 0x94, 0x2f, 0x4b, 0xea, 0x1d, - 0x6a, 0xd2, 0x15, 0xb2, 0x0f, 0xcd, 0x8c, 0xa3, 0x36, 0xb9, 0x4a, 0xb1, 0x0e, 0xd1, 0xe9, 0x45, - 0x83, 0x94, 0xde, 0xe5, 0x65, 0x69, 0x4c, 0x5c, 0x37, 0x27, 0x26, 0x41, 0x50, 0xcc, 0x64, 0x88, - 0x1d, 0x4e, 0x4b, 0xca, 0x38, 0x2e, 0x67, 0x1c, 0x54, 0xc6, 0x71, 0x4d, 0xc6, 0xd1, 0x0c, 0x87, - 0xf2, 0xc0, 0x12, 0x4a, 0xe1, 0x40, 0x23, 0x1c, 0x2a, 0xbf, 0x26, 0x28, 0x59, 0xd0, 0xb4, 0xdb, - 0x54, 0x33, 0x6a, 0xd0, 0xe9, 0xde, 0xc7, 0xdd, 0xce, 0xa1, 0xfa, 0x61, 0xbe, 0xd2, 0x92, 0xfc, - 0xa9, 0x2a, 0x7f, 0x9d, 0xc7, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x38, 0x51, 0xff, 0xb4, 0x4d, - 0x07, 0x00, 0x00, +var fileDescriptor_ws_c2d3d5fccaf1040a = []byte{ + // 2005 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4f, 0x6f, 0x23, 0x49, + 0x15, 0x57, 0xdb, 0xb1, 0x13, 0x3f, 0xc7, 0x71, 0xd2, 0xb3, 0x04, 0x13, 0x66, 0x87, 0xd0, 0x5a, + 0x2d, 0x23, 0x24, 0xb2, 0x68, 0x10, 0x12, 0xec, 0x0a, 0x50, 0xfe, 0x4c, 0xc2, 0x2c, 0x71, 0x12, + 0xda, 0x19, 0x16, 0x21, 0xa4, 0x51, 0xc7, 0xfd, 0xec, 0xf4, 0xa6, 0x5d, 0xd5, 0xae, 0xea, 0x4e, + 0x66, 0x24, 0x4e, 0x20, 0xf1, 0x0d, 0xe0, 0x03, 0x70, 0x41, 0x5c, 0x10, 0x17, 0xc4, 0x85, 0x23, + 0x5f, 0x80, 0x33, 0x5f, 0x81, 0x2b, 0x07, 0x24, 0x24, 0x50, 0xfd, 0xe9, 0xee, 0xaa, 0xb6, 0x93, + 0xb5, 0xa2, 0x68, 0x87, 0x9b, 0xdf, 0xaf, 0xeb, 0xbd, 0x7a, 0xff, 0xeb, 0x55, 0x19, 0xba, 0x3c, + 0xbc, 0x7a, 0x75, 0xc3, 0x3f, 0xb8, 0xe1, 0x3b, 0x09, 0xa3, 0x29, 0x75, 0x37, 0x38, 0xb2, 0x6b, + 0x64, 0xaf, 0x82, 0x24, 0x7a, 0x95, 0x04, 0x2c, 0x98, 0x70, 0xef, 0x5f, 0x35, 0x68, 0x1d, 0x31, + 0x9a, 0x25, 0x2f, 0xc8, 0x88, 0xba, 0x3d, 0x58, 0x1e, 0x4b, 0xe2, 0xa0, 0xe7, 0x6c, 0x3b, 0x4f, + 0x5b, 0x7e, 0x4e, 0xba, 0x8f, 0xa1, 0x25, 0x7f, 0x9e, 0x04, 0x13, 0xec, 0xd5, 0xe4, 0xb7, 0x12, + 0x70, 0x3d, 0x58, 0x25, 0x34, 0x8d, 0x46, 0xd1, 0x30, 0x48, 0x23, 0x4a, 0x7a, 0x75, 0xb9, 0xc0, + 0xc2, 0xc4, 0x9a, 0x88, 0xa4, 0x8c, 0x86, 0xd9, 0x50, 0xae, 0x59, 0x52, 0x6b, 0x4c, 0x4c, 0xec, + 0x3f, 0x0a, 0x86, 0xf8, 0xd2, 0x3f, 0xee, 0x35, 0xd4, 0xfe, 0x9a, 0x74, 0xb7, 0xa1, 0x4d, 0x6f, + 0x08, 0xb2, 0x97, 0x1c, 0xd9, 0x8b, 0x83, 0x5e, 0x53, 0x7e, 0x35, 0x21, 0xf7, 0x09, 0xc0, 0x90, + 0x61, 0x90, 0xe2, 0x79, 0x34, 0xc1, 0xde, 0xf2, 0xb6, 0xf3, 0xb4, 0xe3, 0x1b, 0x88, 0x90, 0x30, + 0xc1, 0xc9, 0x05, 0xb2, 0x7d, 0x9a, 0x91, 0xb4, 0xb7, 0x22, 0x17, 0x98, 0x90, 0xbb, 0x06, 0x35, + 0x7c, 0xdd, 0x6b, 0x49, 0xd1, 0x35, 0x7c, 0xed, 0x6e, 0x42, 0x93, 0xa7, 0x41, 0x9a, 0xf1, 0x1e, + 0x6c, 0x3b, 0x4f, 0x1b, 0xbe, 0xa6, 0xdc, 0xf7, 0xa0, 0x23, 0xe5, 0xd2, 0x5c, 0x9b, 0xb6, 0x64, + 0xb1, 0xc1, 0xc2, 0x63, 0xe7, 0x6f, 0x12, 0xec, 0xad, 0x4a, 0x01, 0x25, 0xe0, 0xfd, 0xa5, 0x06, + 0x8f, 0xa4, 0xdf, 0xfb, 0x52, 0x81, 0xc3, 0x2c, 0x8e, 0x3f, 0x23, 0x02, 0x9b, 0xd0, 0xcc, 0xd4, + 0x76, 0xca, 0xfd, 0x9a, 0x12, 0xfb, 0x30, 0x1a, 0xe3, 0x31, 0x5e, 0x63, 0x2c, 0x1d, 0xdf, 0xf0, + 0x4b, 0xc0, 0xdd, 0x82, 0x95, 0x4f, 0x69, 0x44, 0xa4, 0x4f, 0x96, 0xe4, 0xc7, 0x82, 0x16, 0xdf, + 0x48, 0x34, 0xbc, 0x22, 0x22, 0xa4, 0xca, 0xdd, 0x05, 0x6d, 0x46, 0xa2, 0x69, 0x47, 0xe2, 0x7d, + 0x58, 0x0b, 0x92, 0xa4, 0x1f, 0x90, 0x31, 0x32, 0xb5, 0xe9, 0xb2, 0x94, 0x5b, 0x41, 0x45, 0x3c, + 0xc4, 0x4e, 0x03, 0x9a, 0xb1, 0x21, 0x4a, 0x77, 0x37, 0x7c, 0x03, 0x11, 0x72, 0x68, 0x82, 0xcc, + 0x70, 0xa3, 0xf2, 0x7c, 0x05, 0xd5, 0x51, 0x81, 0x3c, 0x2a, 0xde, 0xaf, 0x1d, 0x58, 0x3b, 0xcb, + 0x2e, 0xe2, 0x68, 0x28, 0x17, 0x08, 0xa7, 0x95, 0xae, 0x71, 0x2c, 0xd7, 0x98, 0x06, 0xd6, 0x6e, + 0x37, 0xb0, 0x6e, 0x1b, 0xb8, 0x09, 0xcd, 0x31, 0x92, 0x10, 0x99, 0x76, 0x98, 0xa6, 0xb4, 0x22, + 0x8d, 0x42, 0x91, 0xdf, 0xd6, 0x60, 0xe5, 0x73, 0x56, 0x61, 0x1b, 0xda, 0xc9, 0x25, 0x25, 0x78, + 0x92, 0x89, 0xa4, 0xd1, 0xba, 0x98, 0x90, 0xfb, 0x0e, 0x34, 0x2e, 0x22, 0x96, 0x5e, 0xca, 0xa8, + 0x75, 0x7c, 0x45, 0x08, 0x14, 0x27, 0x41, 0xa4, 0x42, 0xd5, 0xf2, 0x15, 0xa1, 0x0d, 0x5a, 0x29, + 0xf2, 0xdd, 0xae, 0xa0, 0xd6, 0x4c, 0x05, 0xcd, 0x46, 0x1e, 0xe6, 0x45, 0xde, 0xfb, 0xb7, 0x03, + 0x70, 0xc8, 0x22, 0x24, 0xa1, 0x74, 0x4d, 0xa5, 0x74, 0x9d, 0xd9, 0xd2, 0xdd, 0x84, 0x26, 0xc3, + 0x49, 0xc0, 0xae, 0xf2, 0xd4, 0x56, 0x54, 0x45, 0xa1, 0xfa, 0x8c, 0x42, 0x1f, 0x01, 0x8c, 0xe4, + 0x3e, 0x42, 0x8e, 0x74, 0x55, 0xfb, 0xd9, 0x97, 0x77, 0x66, 0x9a, 0xdc, 0x4e, 0x1e, 0x25, 0xdf, + 0x58, 0x2e, 0xea, 0x26, 0x08, 0x43, 0x9d, 0x9e, 0x0d, 0x55, 0x37, 0x05, 0x30, 0x27, 0x3b, 0x9b, + 0x77, 0x64, 0xe7, 0x72, 0x91, 0x14, 0xff, 0x74, 0xa0, 0xb5, 0x17, 0x07, 0xc3, 0xab, 0x05, 0x4d, + 0xb7, 0x4d, 0xac, 0xcd, 0x98, 0x78, 0x04, 0x9d, 0x0b, 0x21, 0x2e, 0x37, 0x41, 0x7a, 0xa1, 0xfd, + 0xec, 0xab, 0x73, 0xac, 0xb4, 0x8b, 0xc2, 0xb7, 0xf9, 0x6c, 0x73, 0x97, 0x3e, 0xdb, 0xdc, 0xc6, + 0x1d, 0xe6, 0x36, 0x0b, 0x73, 0xff, 0x5e, 0x83, 0x55, 0xd9, 0xc6, 0x7c, 0x9c, 0x66, 0xc8, 0x53, + 0xf7, 0x7b, 0xb0, 0x92, 0xe5, 0xaa, 0x3a, 0x8b, 0xaa, 0x5a, 0xb0, 0xb8, 0x1f, 0xea, 0xa6, 0x29, + 0xf9, 0x6b, 0x92, 0xff, 0xf1, 0x1c, 0xfe, 0xe2, 0xc4, 0xf2, 0xcb, 0xe5, 0xe2, 0x80, 0xb9, 0x0c, + 0x48, 0x18, 0xa3, 0x8f, 0x3c, 0x8b, 0x53, 0xdd, 0x0b, 0x2d, 0x4c, 0x65, 0xda, 0xb4, 0xcf, 0xc7, + 0xfa, 0xf8, 0xd1, 0x94, 0xf0, 0x8e, 0x5a, 0x27, 0x3e, 0x29, 0xd3, 0x4b, 0x40, 0x14, 0x2a, 0xc3, + 0xa9, 0x8c, 0x90, 0x2a, 0xab, 0x9c, 0x2c, 0xf7, 0xd4, 0x5e, 0x53, 0x89, 0x60, 0x61, 0x22, 0xc4, + 0x8a, 0x96, 0x02, 0xd4, 0xb9, 0x63, 0x20, 0xd5, 0x63, 0xc7, 0xfb, 0x47, 0x1d, 0x3a, 0xaa, 0x7c, + 0x72, 0xa7, 0x3e, 0x11, 0x79, 0x4e, 0x27, 0x56, 0x16, 0x19, 0x88, 0xd0, 0x42, 0x50, 0x27, 0x76, + 0xa3, 0xb1, 0x30, 0x91, 0x8a, 0x82, 0x3e, 0xb4, 0x1a, 0x8e, 0x09, 0xe5, 0xbb, 0x1c, 0x99, 0x8d, + 0xc7, 0x40, 0x44, 0x2b, 0x4b, 0xa9, 0x95, 0x1d, 0x05, 0x2d, 0x78, 0x53, 0x5a, 0xec, 0xaf, 0xf2, + 0xc3, 0x40, 0x84, 0x7f, 0x53, 0x9a, 0xef, 0xad, 0x9c, 0x54, 0x02, 0x4a, 0xb2, 0xde, 0x57, 0x1d, + 0x14, 0x05, 0x3d, 0x13, 0xd5, 0xd6, 0x9d, 0x51, 0x05, 0x2b, 0xaa, 0x76, 0x71, 0xb5, 0x67, 0x8a, + 0xeb, 0x3d, 0xe8, 0x28, 0x39, 0x79, 0xd2, 0xaf, 0xaa, 0x83, 0xdc, 0x02, 0xed, 0xdc, 0xe8, 0x54, + 0x73, 0xc3, 0x8e, 0xee, 0xda, 0x2d, 0xd1, 0xed, 0x16, 0xd1, 0xfd, 0x05, 0xf4, 0xce, 0xb2, 0x38, + 0xee, 0x23, 0xe7, 0xc1, 0x18, 0xf7, 0xde, 0x0c, 0x70, 0x7a, 0x1c, 0xf1, 0xd4, 0x47, 0x9e, 0x88, + 0x3c, 0x43, 0xc6, 0xf6, 0x69, 0x88, 0x32, 0xc8, 0x0d, 0x3f, 0x27, 0x85, 0x85, 0xc8, 0x98, 0x50, + 0x40, 0x77, 0x48, 0x45, 0xb9, 0x3b, 0xb0, 0x14, 0x47, 0x5c, 0xe4, 0x7a, 0xfd, 0x69, 0xfb, 0xd9, + 0xd6, 0x9c, 0x52, 0xe9, 0xf3, 0xf1, 0x41, 0x90, 0x06, 0xbe, 0x5c, 0xe7, 0x4d, 0xe0, 0x8b, 0xf3, + 0x77, 0x9f, 0xde, 0x7a, 0x82, 0x89, 0x1e, 0x26, 0x9b, 0x40, 0x44, 0x49, 0x31, 0x7c, 0x98, 0x90, + 0x50, 0x9b, 0x2b, 0x39, 0x52, 0x8f, 0x8e, 0x9f, 0x93, 0xde, 0x3b, 0xe0, 0x1e, 0x61, 0xda, 0x0f, + 0x5e, 0xef, 0x92, 0xb0, 0x1f, 0x91, 0x01, 0x4e, 0x7d, 0x9c, 0x7a, 0xcf, 0xe1, 0xd1, 0x0c, 0xca, + 0x13, 0xa1, 0xc0, 0x24, 0x78, 0x3d, 0xc0, 0xa9, 0x54, 0xa0, 0xe3, 0x6b, 0x4a, 0xe2, 0x72, 0x95, + 0x6e, 0x8f, 0x9a, 0xf2, 0xa6, 0xd0, 0x15, 0x11, 0x1a, 0x20, 0x09, 0xfb, 0x7c, 0x2c, 0x45, 0x6c, + 0x43, 0x5b, 0x79, 0xa0, 0xcf, 0xc7, 0x65, 0xbf, 0x35, 0x20, 0xb1, 0x62, 0x18, 0x47, 0x48, 0x52, + 0xb5, 0x42, 0x5b, 0x63, 0x40, 0x22, 0x19, 0x39, 0x92, 0xb0, 0x38, 0x72, 0xea, 0x7e, 0x41, 0x7b, + 0x7f, 0x6d, 0xc0, 0xb2, 0x76, 0xa8, 0x9c, 0x0e, 0xc5, 0x11, 0x57, 0xf8, 0x4b, 0x51, 0x2a, 0x19, + 0x87, 0xd7, 0xe5, 0x9c, 0xa6, 0x28, 0x73, 0xb2, 0xab, 0xdb, 0x93, 0x5d, 0x45, 0xa7, 0xa5, 0x59, + 0x9d, 0x2a, 0x76, 0x35, 0x66, 0xed, 0xfa, 0x3a, 0xac, 0x73, 0x59, 0x30, 0x67, 0x71, 0x90, 0x8e, + 0x28, 0x9b, 0xe8, 0x13, 0xab, 0xe1, 0xcf, 0xe0, 0xa2, 0xd9, 0x2b, 0xac, 0x28, 0x58, 0x55, 0x91, + 0x15, 0x54, 0x94, 0x87, 0x42, 0xf2, 0xc2, 0x55, 0xa3, 0x82, 0x0d, 0x2a, 0xdd, 0x38, 0x8f, 0x28, + 0x91, 0x93, 0xae, 0xaa, 0x4f, 0x13, 0x12, 0x96, 0x4f, 0xf8, 0xf8, 0x90, 0xd1, 0x89, 0x1e, 0x18, + 0x72, 0x52, 0x5a, 0x4e, 0x49, 0x8a, 0x24, 0x95, 0xbc, 0x6d, 0xc5, 0x6b, 0x40, 0x82, 0x57, 0x93, + 0xb2, 0x38, 0x57, 0xfd, 0x9c, 0x74, 0xd7, 0xa1, 0xce, 0x71, 0xaa, 0x2b, 0x4e, 0xfc, 0xb4, 0x22, + 0xd7, 0xb5, 0x23, 0x57, 0x69, 0x05, 0xeb, 0xf2, 0xab, 0xd9, 0x0a, 0xca, 0x59, 0x7f, 0xc3, 0x9a, + 0xf5, 0x77, 0x61, 0x99, 0x26, 0x22, 0xcf, 0x79, 0xcf, 0x95, 0x35, 0xf6, 0xb5, 0xdb, 0x6b, 0x6c, + 0xe7, 0x54, 0xad, 0x7c, 0x4e, 0x52, 0xf6, 0xc6, 0xcf, 0xf9, 0xdc, 0x63, 0xe8, 0xd2, 0xd1, 0x28, + 0x8e, 0x08, 0x9e, 0x65, 0xfc, 0x52, 0x9e, 0x6c, 0x8f, 0xe4, 0xc9, 0xe6, 0xcd, 0x11, 0x75, 0x6a, + 0xaf, 0xf4, 0xab, 0xac, 0x5b, 0x1f, 0xc2, 0xaa, 0xb9, 0x8d, 0x70, 0xc3, 0x15, 0xbe, 0xd1, 0x39, + 0x28, 0x7e, 0x8a, 0x61, 0xef, 0x3a, 0x88, 0x33, 0x75, 0x0c, 0xac, 0xf8, 0x8a, 0xf8, 0xb0, 0xf6, + 0x1d, 0xc7, 0xfb, 0x8d, 0x03, 0xdd, 0xca, 0x06, 0x62, 0x75, 0x1a, 0xa5, 0x31, 0x6a, 0x09, 0x8a, + 0x70, 0x5d, 0x58, 0x0a, 0x91, 0x0f, 0x75, 0x0a, 0xcb, 0xdf, 0xba, 0x93, 0xd5, 0x8b, 0x71, 0x51, + 0x5c, 0xe8, 0x4e, 0x07, 0x42, 0xd0, 0x80, 0x66, 0x24, 0x2c, 0x2e, 0x74, 0x06, 0x26, 0x52, 0x28, + 0x3a, 0x1d, 0xec, 0x05, 0xe1, 0x18, 0xd5, 0xb5, 0xab, 0x21, 0x75, 0xb2, 0x41, 0x2f, 0x84, 0x95, + 0xf3, 0x28, 0xe1, 0xfb, 0x74, 0x32, 0x11, 0x81, 0x08, 0x31, 0x15, 0xb3, 0xaa, 0x23, 0xe3, 0xad, + 0x29, 0x91, 0x2a, 0x21, 0x8e, 0x82, 0x2c, 0x4e, 0xc5, 0xd2, 0xbc, 0x70, 0x0d, 0x48, 0x5e, 0x38, + 0x38, 0x25, 0x07, 0x8a, 0x5b, 0xe9, 0x69, 0x20, 0xde, 0xdf, 0x6a, 0xb0, 0x2e, 0x07, 0x87, 0x7d, + 0x19, 0xf6, 0x50, 0x32, 0x3d, 0x83, 0x86, 0x2c, 0x43, 0x3d, 0xac, 0xdc, 0x3d, 0x6c, 0xa8, 0xa5, + 0xee, 0xf7, 0xa1, 0x49, 0x13, 0x39, 0x72, 0xaa, 0x09, 0xe5, 0xfd, 0xdb, 0x98, 0xec, 0xbb, 0x9d, + 0xaf, 0xb9, 0xdc, 0x43, 0x00, 0x75, 0xed, 0x3c, 0x2e, 0x5b, 0xf7, 0xa2, 0x32, 0x0c, 0x4e, 0xe1, + 0xdc, 0xa2, 0x0d, 0x17, 0x17, 0xbc, 0xba, 0x6f, 0x83, 0xee, 0x09, 0xac, 0x49, 0xb5, 0x4f, 0xf3, + 0xa9, 0x53, 0xc6, 0x60, 0xf1, 0x1d, 0x2b, 0xdc, 0xde, 0xef, 0x1c, 0xed, 0x46, 0xf1, 0x75, 0x80, + 0xca, 0xf7, 0xa5, 0x4b, 0x9c, 0x7b, 0xb9, 0x64, 0x0b, 0x56, 0x26, 0x99, 0x31, 0x04, 0xd7, 0xfd, + 0x82, 0x2e, 0x43, 0x54, 0x5f, 0x38, 0x44, 0xde, 0xef, 0x1d, 0xe8, 0x7d, 0x4c, 0x23, 0x22, 0x3f, + 0xec, 0x26, 0x49, 0xac, 0x5f, 0x21, 0xee, 0x1d, 0xf3, 0x1f, 0x40, 0x2b, 0x50, 0x62, 0x48, 0xaa, + 0xc3, 0xbe, 0xc0, 0x60, 0x5b, 0xf2, 0x18, 0x33, 0x4a, 0xdd, 0x9c, 0x51, 0xbc, 0x3f, 0x3a, 0xb0, + 0xa6, 0x9c, 0xf2, 0xe3, 0x2c, 0x4a, 0xef, 0xad, 0xdf, 0x1e, 0xac, 0x4c, 0xb3, 0x28, 0xbd, 0x47, + 0x56, 0x16, 0x7c, 0xb3, 0xf9, 0x54, 0x9f, 0x93, 0x4f, 0xde, 0x9f, 0x1c, 0x78, 0x5c, 0x75, 0xeb, + 0xee, 0x70, 0x88, 0xc9, 0xdb, 0x2c, 0x29, 0x6b, 0x46, 0x5b, 0xaa, 0xcc, 0x68, 0x73, 0x55, 0xf6, + 0xf1, 0x53, 0x1c, 0xfe, 0xff, 0xaa, 0xfc, 0xab, 0x1a, 0x7c, 0xe9, 0xa8, 0x28, 0xbc, 0x73, 0x16, + 0x10, 0x3e, 0x42, 0xc6, 0xde, 0xa2, 0xbe, 0xc7, 0xd0, 0x21, 0x78, 0x53, 0xea, 0xa4, 0xcb, 0x71, + 0x51, 0x31, 0x36, 0xf3, 0x62, 0xbd, 0xcb, 0xfb, 0x8f, 0x03, 0xeb, 0x4a, 0xce, 0x8f, 0xa2, 0xe1, + 0xd5, 0x5b, 0x34, 0xfe, 0x04, 0xd6, 0xae, 0xa4, 0x06, 0x82, 0xba, 0x47, 0xdb, 0xae, 0x70, 0x2f, + 0x68, 0xfe, 0x7f, 0x1d, 0xd8, 0x50, 0x82, 0x5e, 0x90, 0xeb, 0xe8, 0x6d, 0x26, 0xeb, 0x19, 0x74, + 0x23, 0xa5, 0xc2, 0x3d, 0x1d, 0x50, 0x65, 0x5f, 0xd0, 0x03, 0x7f, 0x76, 0xa0, 0xab, 0x24, 0x3d, + 0x27, 0x29, 0xb2, 0x7b, 0xdb, 0xff, 0x43, 0x68, 0x23, 0x49, 0x59, 0x40, 0xee, 0xd3, 0x21, 0x4d, + 0xd6, 0x05, 0x9b, 0xe4, 0x15, 0x6c, 0xa8, 0x2b, 0xbc, 0xd1, 0x71, 0xc4, 0x2c, 0x1b, 0x84, 0x6a, + 0x3c, 0x75, 0x24, 0x53, 0x4e, 0xda, 0x8f, 0x33, 0xfa, 0x75, 0xbd, 0x7c, 0x9c, 0x79, 0x02, 0x10, + 0x84, 0xe1, 0x27, 0x94, 0x85, 0x11, 0xc9, 0x8f, 0x0f, 0x03, 0xf1, 0x3e, 0x86, 0x55, 0x31, 0x4d, + 0x9f, 0x1b, 0x97, 0xf1, 0x3b, 0x9f, 0x0b, 0xcc, 0x8b, 0x7c, 0xcd, 0xbe, 0xc8, 0x7b, 0x3f, 0x87, + 0x2f, 0xcc, 0x28, 0x2e, 0xbd, 0xbe, 0xaf, 0xde, 0x18, 0xf2, 0x4d, 0xb4, 0xf3, 0xbf, 0x32, 0xc7, + 0x85, 0xa6, 0x2e, 0xbe, 0xc5, 0xe4, 0xfd, 0xd2, 0x81, 0x77, 0x67, 0xc4, 0xef, 0x26, 0x09, 0xa3, + 0xd7, 0x3a, 0xb9, 0x1f, 0x62, 0x1b, 0xbb, 0xb5, 0xd6, 0xaa, 0xad, 0x75, 0xae, 0x12, 0xd6, 0x71, + 0xf0, 0x39, 0x28, 0xf1, 0x07, 0x07, 0xba, 0x5a, 0x89, 0x30, 0xd4, 0xdb, 0x7e, 0x1b, 0x9a, 0xea, + 0x7d, 0x52, 0x6f, 0xf8, 0xee, 0xdc, 0x0d, 0xf3, 0x77, 0x55, 0x5f, 0x2f, 0x9e, 0xcd, 0xc8, 0xda, + 0xbc, 0x31, 0xf0, 0xbb, 0x45, 0x07, 0x58, 0xf8, 0x05, 0x51, 0x33, 0x78, 0x3f, 0xcd, 0x93, 0xf9, + 0x00, 0x63, 0x7c, 0x48, 0x1f, 0x79, 0x2f, 0x61, 0x4d, 0x3e, 0x96, 0x96, 0x3e, 0x78, 0x10, 0xb1, + 0x9f, 0xc0, 0xba, 0x14, 0xfb, 0xe0, 0xfa, 0x16, 0xd5, 0x21, 0xfc, 0xb3, 0x7f, 0x19, 0x90, 0xf1, + 0x43, 0x4a, 0xff, 0x06, 0x3c, 0xca, 0x7d, 0xff, 0x32, 0x09, 0x8b, 0x2b, 0xca, 0x2d, 0x0f, 0x33, + 0xde, 0x37, 0x61, 0x73, 0x9f, 0x92, 0x6b, 0x64, 0x5c, 0x46, 0x59, 0xb1, 0xe4, 0x1c, 0x56, 0xf1, + 0x6b, 0xca, 0x1b, 0xc0, 0x86, 0x7e, 0x52, 0x3c, 0x0b, 0xc6, 0x11, 0x51, 0x5d, 0xe9, 0x09, 0x40, + 0x12, 0x8c, 0xf3, 0xbf, 0x14, 0xd4, 0xbb, 0x93, 0x81, 0x88, 0xef, 0xfc, 0x92, 0xde, 0xe8, 0xef, + 0x35, 0xf5, 0xbd, 0x44, 0xbc, 0x9f, 0x80, 0xeb, 0x23, 0x4f, 0x28, 0xe1, 0x68, 0x48, 0xdd, 0x86, + 0xf6, 0x7e, 0xc6, 0x18, 0x12, 0xb1, 0x55, 0xfe, 0xbe, 0x6e, 0x42, 0x42, 0xee, 0xa0, 0x94, 0xab, + 0xde, 0x2a, 0x0c, 0x64, 0xef, 0xf1, 0xcf, 0xb6, 0x76, 0x3e, 0x50, 0xff, 0x60, 0x7e, 0x34, 0xe3, + 0xc6, 0x8b, 0xa6, 0xfc, 0x47, 0xf3, 0x5b, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x45, 0x08, + 0x08, 0xe4, 0x1c, 0x00, 0x00, } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index 589e97a21..5919a6c2f 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -1,89 +1,448 @@ syntax = "proto3"; -package open_im_sdk;//The package name to which the proto file belongs -option go_package = "./sdk_ws;open_im_sdk";//The generated go pb file is in the current directory, and the package name is open_im_sdk +option go_package = "./sdk_ws;server_api_params"; +package server_api_params;//The package name to which the proto file belongs +//option go_package = "./sdk_ws;open_im_sdk";//The generated go pb file is in the current directory, and the package name is open_im_sdk + +////////////////////////////////base/////////////////////////////// + + +message GroupInfo{ + string groupID = 1; + string groupName = 2; + string notification = 3; + string introduction = 4; + string faceURL = 5; + string ownerUserID = 6; + uint32 createTime = 7; + uint32 memberCount = 8; + string ex = 9; + int32 status = 10; + string creatorUserID = 11; + int32 groupType = 12; +} + + +message GroupMemberFullInfo { + string groupID = 1 ; + string userID = 2 ; + int32 roleLevel = 3; + int32 joinTime = 4; + string nickname = 5; + string faceURL = 6; + int32 appMangerLevel = 7; //if >0 + int32 joinSource = 8; + string operatorUserID = 9; + string ex = 10; +} + +message PublicUserInfo{ + string userID = 1; + string nickname = 2; + string faceURL = 3; + int32 gender = 4; + string ex = 5; +} + +message UserInfo{ + string userID = 1; + string nickname = 2; + string faceURL = 3; + int32 gender = 4; + string phoneNumber = 5; + uint32 birth = 6; + string email = 7; + string ex = 8; + uint32 createTime = 9; + int32 appMangerLevel = 10; +} + +message FriendInfo{ + string ownerUserID = 1; + string remark = 2; + uint32 createTime = 3; + UserInfo friendUser = 4; + int32 addSource = 5; + string operatorUserID = 6; + string ex = 7; +} + +message BlackInfo{ + string ownerUserID = 1; + uint32 createTime = 2; + PublicUserInfo blackUserInfo = 3; + int32 addSource = 4; + string operatorUserID = 5; + string ex = 6; +} + +message GroupRequest{ + PublicUserInfo userInfo = 1; + GroupInfo groupInfo = 2; + int32 handleResult = 3; + string reqMsg = 4; + string handleMsg = 5; + uint32 reqTime = 6; + string handleUserID = 7; + uint32 handleTime = 8; + string ex = 9; +} + +message FriendRequest{ + string fromUserID = 1; + string fromNickname = 2; + string fromFaceURL = 3; + int32 fromGender = 4; + string toUserID = 5; + string toNickname = 6; + string toFaceURL = 7; + int32 toGender = 8; + int32 handleResult = 9; + string reqMsg = 10; + uint32 createTime = 11; + string handlerUserID = 12; + string handleMsg = 13; + uint32 handleTime = 14; + string ex = 15; +} + +///////////////////////////////////base end///////////////////////////////////// message PullMessageBySeqListResp { - int64 MaxSeq = 1; - int64 MinSeq = 2; - repeated GatherFormat SingleUserMsg = 3; - repeated GatherFormat GroupUserMsg = 4; + int32 errCode = 1; + string errMsg = 2; + repeated MsgData list = 3; } message PullMessageBySeqListReq{ - repeated int64 seqList =1; + string userID = 1; + string operationID = 2; + repeated uint32 seqList = 3; } message GetMaxAndMinSeqReq { } message GetMaxAndMinSeqResp { - int64 maxSeq = 1; - int64 minSeq = 2; -} -message GatherFormat{ - // @inject_tag: json:"id" - string ID = 1; - // @inject_tag: json:"list" - repeated MsgFormat List = 2;//detail msg -} -message MsgFormat{ - // @inject_tag: json:"sendID" - string SendID = 1; - // @inject_tag: json:"recvID" - string RecvID = 2; - // @inject_tag: json:"msgFrom" - int32 MsgFrom = 3; - // @inject_tag: json:"contentType" - int32 ContentType = 4; - // @inject_tag: json:"serverMsgID" - string ServerMsgID = 5; - // @inject_tag: json:"content" - string Content = 6; - // @inject_tag: json:"seq" - int64 Seq = 7; - // @inject_tag: json:"sendTime" - int64 SendTime = 8; - // @inject_tag: json:"senderPlatformID" - int32 SenderPlatformID = 9; - // @inject_tag: json:"senderNickName" - string SenderNickName = 10; - // @inject_tag: json:"senderFaceUrl" - string SenderFaceURL = 11; - // @inject_tag: json:"clientMsgID" - string ClientMsgID = 12; -} - -message UserSendMsgReq { - map Options= 1; - string SenderNickName = 2; - string SenderFaceURL = 3; - int32 PlatformID = 4; - int32 SessionType = 5; - int32 MsgFrom = 6; - int32 ContentType = 7; - string RecvID = 8; - repeated string ForceList = 9; - string Content = 10; - string ClientMsgID = 11; + uint32 maxSeq = 1; + uint32 minSeq = 2; } message UserSendMsgResp { - string ServerMsgID = 1; - string ClientMsgID = 2; + string serverMsgID = 1; + string clientMsgID = 2; int64 sendTime = 3; } message MsgData { string sendID = 1; string recvID = 2; - int32 sessionType = 3; - int32 msgFrom = 4; - int32 contentType = 5; - string serverMsgID = 6; - string content =7; - int64 sendTime =8; - int64 seq =9; - int32 senderPlatformID =10; - string senderNickName =11; - string senderFaceURL =12; - string clientMsgID =13; + string groupID = 3; + string clientMsgID = 4; + string serverMsgID = 5; + int32 senderPlatformID = 6; + string senderNickname = 7; + string senderFaceURL = 8; + int32 sessionType = 9; + int32 msgFrom = 10; + int32 contentType = 11; + bytes content = 12; + uint32 seq = 14; + int64 sendTime = 15; + int64 createTime = 16; + int32 status = 17; + map options = 18; + OfflinePushInfo offlinePushInfo = 19; } +message OfflinePushInfo{ + string title = 1; + string desc = 2; + string ex = 3; + string iOSPushSound = 4; + bool iOSBadgeCount = 5; +} + + + + + + + + + +message TipsComm{ + bytes detail = 1; + string defaultTips = 2; + string jsonDetail = 3; +} + +//////////////////////group///////////////////// + + +// OnGroupCreated() +message GroupCreatedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + repeated GroupMemberFullInfo memberList = 3; + int64 operationTime = 4; + GroupMemberFullInfo groupOwnerUser = 5; +} + +// OnGroupInfoSet() +message GroupInfoSetTips{ + GroupMemberFullInfo opUser = 1; //who do this + int64 muteTime = 2; + GroupInfo group = 3; +} + +// OnJoinGroupApplication() +message JoinGroupApplicationTips{ + GroupInfo group = 1; + PublicUserInfo applicant = 2; + string reqMsg = 3; +} + +// OnQuitGroup() +//Actively leave the group +message MemberQuitTips{ + GroupInfo group = 1; + GroupMemberFullInfo quitUser = 2; + int64 operationTime = 3; +} + + +// OnApplicationGroupAccepted() +message GroupApplicationAcceptedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + string handleMsg = 4; +} + +// OnApplicationGroupRejected() +message GroupApplicationRejectedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + string handleMsg = 4; +} + +// OnTransferGroupOwner() +message GroupOwnerTransferredTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + GroupMemberFullInfo newGroupOwner = 3; + int64 operationTime = 4; +} + + +// OnMemberKicked() +message MemberKickedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + repeated GroupMemberFullInfo kickedUserList = 3; + int64 operationTime = 4; +} + +// OnMemberInvited() +message MemberInvitedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + repeated GroupMemberFullInfo invitedUserList = 3; + int64 operationTime = 4; +} + +//Actively join the group +message MemberEnterTips{ + GroupInfo group = 1; + GroupMemberFullInfo entrantUser = 2; + int64 operationTime = 3; +} + + + + + + + + + + + +//////////////////////friend///////////////////// +//message FriendInfo{ +// UserInfo OwnerUser = 1; +// string Remark = 2; +// uint64 CreateTime = 3; +// UserInfo FriendUser = 4; +//} + +message FriendApplication{ + int64 addTime = 1; + string addSource = 2; + string addWording = 3; +} + +message FromToUserID{ + string fromUserID = 1; + string toUserID = 2; +} + +//FromUserID apply to add ToUserID +message FriendApplicationTips{ + FromToUserID fromToUserID = 1; +} + +//FromUserID accept or reject ToUserID +message FriendApplicationApprovedTips{ + FromToUserID fromToUserID = 1; + string handleMsg = 2; +} + +//FromUserID accept or reject ToUserID +message FriendApplicationRejectedTips{ + FromToUserID fromToUserID = 1; + string handleMsg = 2; +} + + +// FromUserID Added a friend ToUserID +message FriendAddedTips{ + FriendInfo friend = 1; + int64 operationTime = 2; + PublicUserInfo opUser = 3; //who do this + +} + +// FromUserID deleted a friend ToUserID +message FriendDeletedTips{ + FromToUserID fromToUserID = 1; +} + + + +message BlackAddedTips{ + FromToUserID fromToUserID = 1; +} + +message BlackDeletedTips{ + FromToUserID fromToUserID = 1; +} + +message FriendInfoChangedTips{ + FromToUserID fromToUserID = 1; +} +//////////////////////user///////////////////// +message UserInfoUpdatedTips{ + string userID = 1; +} + +//////////////////////conversation///////////////////// +message ConversationUpdateTips{ + string UserID = 1; + +} + + +///cms +message RequestPagination { + int32 pageNumber = 1; + int32 showNumber = 2; +} + +message ResponsePagination { + int32 CurrentPage = 5; + int32 ShowNumber = 6; +} + + +///////////////////signal////////////// +message SignalReq { + oneof payload { + SignalInviteReq invite = 1; + SignalInviteInGroupReq inviteInGroup= 2; + SignalCancelReq cancel = 3; + SignalAcceptReq accept = 4; + SignalHungUpReq hungUp = 5; + SignalRejectReq reject = 6; + } +} + +message SignalResp { + oneof payload { + SignalInviteReply invite = 1; + SignalInviteInGroupReply inviteInGroup= 2; + SignalCancelReply cancel = 3; + SignalAcceptReply accept = 4; + SignalHungUpReply hungUp = 5; + SignalRejectReply reject = 6; + } +} + +message InvitationInfo { + string inviterUserID = 1; + repeated string inviteeUserIDList = 2; + string customData = 3; + string groupID = 4; +} + + +message SignalInviteReq { + InvitationInfo invitation = 1; +} + +message SignalInviteReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalInviteInGroupReq { + InvitationInfo invitation = 1; +} + +message SignalInviteInGroupReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalCancelReq { + string inviterUserID = 1; + SignalInviteReq invitation = 2; +} + +message SignalCancelReply { + +} + +message SignalAcceptReq { + string inviteeUserID = 1; + SignalInviteReq invitation = 2; +} + +message SignalAcceptReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalHungUpReq { + string UserID = 1; + SignalInviteReq invitation = 2; +} + +message SignalHungUpReply { + +} + + +message SignalRejectReq { + string inviteeUserID = 1; + SignalInviteReq invitation = 2; +} + +message SignalRejectReply { + +} + + + + + diff --git a/pkg/proto/statistics/statistics.pb.go b/pkg/proto/statistics/statistics.pb.go new file mode 100644 index 000000000..5fd528d97 --- /dev/null +++ b/pkg/proto/statistics/statistics.pb.go @@ -0,0 +1,1498 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.19.3 +// source: statistics/statistics.proto + +package statistics + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` +} + +func (x *StatisticsReq) Reset() { + *x = StatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatisticsReq) ProtoMessage() {} + +func (x *StatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatisticsReq.ProtoReflect.Descriptor instead. +func (*StatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{0} +} + +func (x *StatisticsReq) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *StatisticsReq) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +type GetActiveUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetActiveUserReq) Reset() { + *x = GetActiveUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveUserReq) ProtoMessage() {} + +func (x *GetActiveUserReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveUserReq.ProtoReflect.Descriptor instead. +func (*GetActiveUserReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{1} +} + +func (x *GetActiveUserReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetActiveUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type UserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NickName string `protobuf:"bytes,1,opt,name=NickName,proto3" json:"NickName,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId,omitempty"` + MessageNum int32 `protobuf:"varint,3,opt,name=MessageNum,proto3" json:"MessageNum,omitempty"` +} + +func (x *UserResp) Reset() { + *x = UserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserResp) ProtoMessage() {} + +func (x *UserResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserResp.ProtoReflect.Descriptor instead. +func (*UserResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{2} +} + +func (x *UserResp) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *UserResp) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserResp) GetMessageNum() int32 { + if x != nil { + return x.MessageNum + } + return 0 +} + +type GetActiveUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*UserResp `protobuf:"bytes,1,rep,name=Users,proto3" json:"Users,omitempty"` +} + +func (x *GetActiveUserResp) Reset() { + *x = GetActiveUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveUserResp) ProtoMessage() {} + +func (x *GetActiveUserResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveUserResp.ProtoReflect.Descriptor instead. +func (*GetActiveUserResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{3} +} + +func (x *GetActiveUserResp) GetUsers() []*UserResp { + if x != nil { + return x.Users + } + return nil +} + +type GetActiveGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetActiveGroupReq) Reset() { + *x = GetActiveGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveGroupReq) ProtoMessage() {} + +func (x *GetActiveGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveGroupReq.ProtoReflect.Descriptor instead. +func (*GetActiveGroupReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{4} +} + +func (x *GetActiveGroupReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetActiveGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupName string `protobuf:"bytes,1,opt,name=GroupName,proto3" json:"GroupName,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + MessageNum int32 `protobuf:"varint,3,opt,name=MessageNum,proto3" json:"MessageNum,omitempty"` +} + +func (x *GroupResp) Reset() { + *x = GroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupResp) ProtoMessage() {} + +func (x *GroupResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupResp.ProtoReflect.Descriptor instead. +func (*GroupResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{5} +} + +func (x *GroupResp) GetGroupName() string { + if x != nil { + return x.GroupName + } + return "" +} + +func (x *GroupResp) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GroupResp) GetMessageNum() int32 { + if x != nil { + return x.MessageNum + } + return 0 +} + +type GetActiveGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Groups []*GroupResp `protobuf:"bytes,1,rep,name=Groups,proto3" json:"Groups,omitempty"` +} + +func (x *GetActiveGroupResp) Reset() { + *x = GetActiveGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveGroupResp) ProtoMessage() {} + +func (x *GetActiveGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveGroupResp.ProtoReflect.Descriptor instead. +func (*GetActiveGroupResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{6} +} + +func (x *GetActiveGroupResp) GetGroups() []*GroupResp { + if x != nil { + return x.Groups + } + return nil +} + +type DateNumList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Date string `protobuf:"bytes,1,opt,name=Date,proto3" json:"Date,omitempty"` + Num int32 `protobuf:"varint,2,opt,name=Num,proto3" json:"Num,omitempty"` +} + +func (x *DateNumList) Reset() { + *x = DateNumList{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DateNumList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DateNumList) ProtoMessage() {} + +func (x *DateNumList) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DateNumList.ProtoReflect.Descriptor instead. +func (*DateNumList) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{7} +} + +func (x *DateNumList) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *DateNumList) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type GetMessageStatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetMessageStatisticsReq) Reset() { + *x = GetMessageStatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMessageStatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMessageStatisticsReq) ProtoMessage() {} + +func (x *GetMessageStatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMessageStatisticsReq.ProtoReflect.Descriptor instead. +func (*GetMessageStatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{8} +} + +func (x *GetMessageStatisticsReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetMessageStatisticsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetMessageStatisticsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrivateMessageNum int32 `protobuf:"varint,1,opt,name=PrivateMessageNum,proto3" json:"PrivateMessageNum,omitempty"` + GroupMessageNum int32 `protobuf:"varint,2,opt,name=GroupMessageNum,proto3" json:"GroupMessageNum,omitempty"` + PrivateMessageNumList []*DateNumList `protobuf:"bytes,3,rep,name=PrivateMessageNumList,proto3" json:"PrivateMessageNumList,omitempty"` + GroupMessageNumList []*DateNumList `protobuf:"bytes,4,rep,name=GroupMessageNumList,proto3" json:"GroupMessageNumList,omitempty"` +} + +func (x *GetMessageStatisticsResp) Reset() { + *x = GetMessageStatisticsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMessageStatisticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMessageStatisticsResp) ProtoMessage() {} + +func (x *GetMessageStatisticsResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMessageStatisticsResp.ProtoReflect.Descriptor instead. +func (*GetMessageStatisticsResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{9} +} + +func (x *GetMessageStatisticsResp) GetPrivateMessageNum() int32 { + if x != nil { + return x.PrivateMessageNum + } + return 0 +} + +func (x *GetMessageStatisticsResp) GetGroupMessageNum() int32 { + if x != nil { + return x.GroupMessageNum + } + return 0 +} + +func (x *GetMessageStatisticsResp) GetPrivateMessageNumList() []*DateNumList { + if x != nil { + return x.PrivateMessageNumList + } + return nil +} + +func (x *GetMessageStatisticsResp) GetGroupMessageNumList() []*DateNumList { + if x != nil { + return x.GroupMessageNumList + } + return nil +} + +type GetGroupStatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetGroupStatisticsReq) Reset() { + *x = GetGroupStatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupStatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupStatisticsReq) ProtoMessage() {} + +func (x *GetGroupStatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupStatisticsReq.ProtoReflect.Descriptor instead. +func (*GetGroupStatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{10} +} + +func (x *GetGroupStatisticsReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetGroupStatisticsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetGroupStatisticsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncreaseGroupNum int32 `protobuf:"varint,1,opt,name=IncreaseGroupNum,proto3" json:"IncreaseGroupNum,omitempty"` + TotalGroupNum int32 `protobuf:"varint,2,opt,name=TotalGroupNum,proto3" json:"TotalGroupNum,omitempty"` + IncreaseGroupNumList []*DateNumList `protobuf:"bytes,3,rep,name=IncreaseGroupNumList,proto3" json:"IncreaseGroupNumList,omitempty"` + TotalGroupNumList []*DateNumList `protobuf:"bytes,4,rep,name=TotalGroupNumList,proto3" json:"TotalGroupNumList,omitempty"` +} + +func (x *GetGroupStatisticsResp) Reset() { + *x = GetGroupStatisticsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupStatisticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupStatisticsResp) ProtoMessage() {} + +func (x *GetGroupStatisticsResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupStatisticsResp.ProtoReflect.Descriptor instead. +func (*GetGroupStatisticsResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{11} +} + +func (x *GetGroupStatisticsResp) GetIncreaseGroupNum() int32 { + if x != nil { + return x.IncreaseGroupNum + } + return 0 +} + +func (x *GetGroupStatisticsResp) GetTotalGroupNum() int32 { + if x != nil { + return x.TotalGroupNum + } + return 0 +} + +func (x *GetGroupStatisticsResp) GetIncreaseGroupNumList() []*DateNumList { + if x != nil { + return x.IncreaseGroupNumList + } + return nil +} + +func (x *GetGroupStatisticsResp) GetTotalGroupNumList() []*DateNumList { + if x != nil { + return x.TotalGroupNumList + } + return nil +} + +type GetUserStatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetUserStatisticsReq) Reset() { + *x = GetUserStatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserStatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserStatisticsReq) ProtoMessage() {} + +func (x *GetUserStatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserStatisticsReq.ProtoReflect.Descriptor instead. +func (*GetUserStatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{12} +} + +func (x *GetUserStatisticsReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetUserStatisticsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetUserStatisticsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncreaseUserNum int32 `protobuf:"varint,1,opt,name=IncreaseUserNum,proto3" json:"IncreaseUserNum,omitempty"` + ActiveUserNum int32 `protobuf:"varint,2,opt,name=ActiveUserNum,proto3" json:"ActiveUserNum,omitempty"` + TotalUserNum int32 `protobuf:"varint,3,opt,name=TotalUserNum,proto3" json:"TotalUserNum,omitempty"` + IncreaseUserNumList []*DateNumList `protobuf:"bytes,4,rep,name=IncreaseUserNumList,proto3" json:"IncreaseUserNumList,omitempty"` + ActiveUserNumList []*DateNumList `protobuf:"bytes,5,rep,name=ActiveUserNumList,proto3" json:"ActiveUserNumList,omitempty"` + TotalUserNumList []*DateNumList `protobuf:"bytes,6,rep,name=TotalUserNumList,proto3" json:"TotalUserNumList,omitempty"` +} + +func (x *GetUserStatisticsResp) Reset() { + *x = GetUserStatisticsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserStatisticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserStatisticsResp) ProtoMessage() {} + +func (x *GetUserStatisticsResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserStatisticsResp.ProtoReflect.Descriptor instead. +func (*GetUserStatisticsResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{13} +} + +func (x *GetUserStatisticsResp) GetIncreaseUserNum() int32 { + if x != nil { + return x.IncreaseUserNum + } + return 0 +} + +func (x *GetUserStatisticsResp) GetActiveUserNum() int32 { + if x != nil { + return x.ActiveUserNum + } + return 0 +} + +func (x *GetUserStatisticsResp) GetTotalUserNum() int32 { + if x != nil { + return x.TotalUserNum + } + return 0 +} + +func (x *GetUserStatisticsResp) GetIncreaseUserNumList() []*DateNumList { + if x != nil { + return x.IncreaseUserNumList + } + return nil +} + +func (x *GetUserStatisticsResp) GetActiveUserNumList() []*DateNumList { + if x != nil { + return x.ActiveUserNumList + } + return nil +} + +func (x *GetUserStatisticsResp) GetTotalUserNumList() []*DateNumList { + if x != nil { + return x.TotalUserNumList + } + return nil +} + +var File_statistics_statistics_proto protoreflect.FileDescriptor + +var file_statistics_statistics_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x33, 0x0a, 0x0d, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, + 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x75, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x5e, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x3f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x05, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x52, + 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x22, 0x76, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x63, + 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4e, 0x75, 0x6d, 0x22, 0x43, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x06, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x52, 0x06, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x33, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x65, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4e, + 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0x7c, 0x0a, + 0x17, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x8c, 0x02, 0x0a, 0x18, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x11, 0x50, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x11, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x28, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, + 0x12, 0x4d, 0x0a, 0x15, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, + 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x15, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x49, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, + 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x15, 0x47, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xfe, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x2a, 0x0a, 0x10, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x49, 0x6e, 0x63, + 0x72, 0x65, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, + 0x0d, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4e, 0x75, 0x6d, 0x12, 0x4b, 0x0a, 0x14, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, + 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x14, 0x49, 0x6e, 0x63, 0x72, + 0x65, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x45, 0x0a, 0x11, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x11, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x79, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, + 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, + 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x22, 0xe2, 0x02, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x0f, + 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0d, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x22, 0x0a, 0x0c, + 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0c, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, + 0x12, 0x49, 0x0a, 0x13, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, + 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x13, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x11, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x43, 0x0a, 0x10, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4e, + 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x10, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x32, 0xbf, 0x03, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x12, 0x4c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x1c, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, + 0x1d, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, + 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x1d, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, + 0x1e, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x61, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x5b, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x21, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x12, 0x20, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x19, 0x5a, 0x17, 0x2e, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_statistics_statistics_proto_rawDescOnce sync.Once + file_statistics_statistics_proto_rawDescData = file_statistics_statistics_proto_rawDesc +) + +func file_statistics_statistics_proto_rawDescGZIP() []byte { + file_statistics_statistics_proto_rawDescOnce.Do(func() { + file_statistics_statistics_proto_rawDescData = protoimpl.X.CompressGZIP(file_statistics_statistics_proto_rawDescData) + }) + return file_statistics_statistics_proto_rawDescData +} + +var file_statistics_statistics_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_statistics_statistics_proto_goTypes = []interface{}{ + (*StatisticsReq)(nil), // 0: statistics.StatisticsReq + (*GetActiveUserReq)(nil), // 1: statistics.GetActiveUserReq + (*UserResp)(nil), // 2: statistics.UserResp + (*GetActiveUserResp)(nil), // 3: statistics.GetActiveUserResp + (*GetActiveGroupReq)(nil), // 4: statistics.GetActiveGroupReq + (*GroupResp)(nil), // 5: statistics.GroupResp + (*GetActiveGroupResp)(nil), // 6: statistics.GetActiveGroupResp + (*DateNumList)(nil), // 7: statistics.DateNumList + (*GetMessageStatisticsReq)(nil), // 8: statistics.GetMessageStatisticsReq + (*GetMessageStatisticsResp)(nil), // 9: statistics.GetMessageStatisticsResp + (*GetGroupStatisticsReq)(nil), // 10: statistics.GetGroupStatisticsReq + (*GetGroupStatisticsResp)(nil), // 11: statistics.GetGroupStatisticsResp + (*GetUserStatisticsReq)(nil), // 12: statistics.GetUserStatisticsReq + (*GetUserStatisticsResp)(nil), // 13: statistics.GetUserStatisticsResp +} +var file_statistics_statistics_proto_depIdxs = []int32{ + 0, // 0: statistics.GetActiveUserReq.StatisticsReq:type_name -> statistics.StatisticsReq + 2, // 1: statistics.GetActiveUserResp.Users:type_name -> statistics.UserResp + 0, // 2: statistics.GetActiveGroupReq.StatisticsReq:type_name -> statistics.StatisticsReq + 5, // 3: statistics.GetActiveGroupResp.Groups:type_name -> statistics.GroupResp + 0, // 4: statistics.GetMessageStatisticsReq.StatisticsReq:type_name -> statistics.StatisticsReq + 7, // 5: statistics.GetMessageStatisticsResp.PrivateMessageNumList:type_name -> statistics.DateNumList + 7, // 6: statistics.GetMessageStatisticsResp.GroupMessageNumList:type_name -> statistics.DateNumList + 0, // 7: statistics.GetGroupStatisticsReq.StatisticsReq:type_name -> statistics.StatisticsReq + 7, // 8: statistics.GetGroupStatisticsResp.IncreaseGroupNumList:type_name -> statistics.DateNumList + 7, // 9: statistics.GetGroupStatisticsResp.TotalGroupNumList:type_name -> statistics.DateNumList + 0, // 10: statistics.GetUserStatisticsReq.StatisticsReq:type_name -> statistics.StatisticsReq + 7, // 11: statistics.GetUserStatisticsResp.IncreaseUserNumList:type_name -> statistics.DateNumList + 7, // 12: statistics.GetUserStatisticsResp.ActiveUserNumList:type_name -> statistics.DateNumList + 7, // 13: statistics.GetUserStatisticsResp.TotalUserNumList:type_name -> statistics.DateNumList + 1, // 14: statistics.user.GetActiveUser:input_type -> statistics.GetActiveUserReq + 4, // 15: statistics.user.GetActiveGroup:input_type -> statistics.GetActiveGroupReq + 8, // 16: statistics.user.GetMessageStatistics:input_type -> statistics.GetMessageStatisticsReq + 10, // 17: statistics.user.GetGroupStatistics:input_type -> statistics.GetGroupStatisticsReq + 12, // 18: statistics.user.GetUserStatistics:input_type -> statistics.GetUserStatisticsReq + 3, // 19: statistics.user.GetActiveUser:output_type -> statistics.GetActiveUserResp + 6, // 20: statistics.user.GetActiveGroup:output_type -> statistics.GetActiveGroupResp + 9, // 21: statistics.user.GetMessageStatistics:output_type -> statistics.GetMessageStatisticsResp + 11, // 22: statistics.user.GetGroupStatistics:output_type -> statistics.GetGroupStatisticsResp + 13, // 23: statistics.user.GetUserStatistics:output_type -> statistics.GetUserStatisticsResp + 19, // [19:24] is the sub-list for method output_type + 14, // [14:19] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_statistics_statistics_proto_init() } +func file_statistics_statistics_proto_init() { + if File_statistics_statistics_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_statistics_statistics_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DateNumList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMessageStatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMessageStatisticsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupStatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupStatisticsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserStatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserStatisticsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_statistics_statistics_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_statistics_statistics_proto_goTypes, + DependencyIndexes: file_statistics_statistics_proto_depIdxs, + MessageInfos: file_statistics_statistics_proto_msgTypes, + }.Build() + File_statistics_statistics_proto = out.File + file_statistics_statistics_proto_rawDesc = nil + file_statistics_statistics_proto_goTypes = nil + file_statistics_statistics_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// UserClient is the client API for User service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type UserClient interface { + GetActiveUser(ctx context.Context, in *GetActiveUserReq, opts ...grpc.CallOption) (*GetActiveUserResp, error) + GetActiveGroup(ctx context.Context, in *GetActiveGroupReq, opts ...grpc.CallOption) (*GetActiveGroupResp, error) + GetMessageStatistics(ctx context.Context, in *GetMessageStatisticsReq, opts ...grpc.CallOption) (*GetMessageStatisticsResp, error) + GetGroupStatistics(ctx context.Context, in *GetGroupStatisticsReq, opts ...grpc.CallOption) (*GetGroupStatisticsResp, error) + GetUserStatistics(ctx context.Context, in *GetUserStatisticsReq, opts ...grpc.CallOption) (*GetUserStatisticsResp, error) +} + +type userClient struct { + cc grpc.ClientConnInterface +} + +func NewUserClient(cc grpc.ClientConnInterface) UserClient { + return &userClient{cc} +} + +func (c *userClient) GetActiveUser(ctx context.Context, in *GetActiveUserReq, opts ...grpc.CallOption) (*GetActiveUserResp, error) { + out := new(GetActiveUserResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetActiveUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetActiveGroup(ctx context.Context, in *GetActiveGroupReq, opts ...grpc.CallOption) (*GetActiveGroupResp, error) { + out := new(GetActiveGroupResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetActiveGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetMessageStatistics(ctx context.Context, in *GetMessageStatisticsReq, opts ...grpc.CallOption) (*GetMessageStatisticsResp, error) { + out := new(GetMessageStatisticsResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetMessageStatistics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetGroupStatistics(ctx context.Context, in *GetGroupStatisticsReq, opts ...grpc.CallOption) (*GetGroupStatisticsResp, error) { + out := new(GetGroupStatisticsResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetGroupStatistics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUserStatistics(ctx context.Context, in *GetUserStatisticsReq, opts ...grpc.CallOption) (*GetUserStatisticsResp, error) { + out := new(GetUserStatisticsResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetUserStatistics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServer is the server API for User service. +type UserServer interface { + GetActiveUser(context.Context, *GetActiveUserReq) (*GetActiveUserResp, error) + GetActiveGroup(context.Context, *GetActiveGroupReq) (*GetActiveGroupResp, error) + GetMessageStatistics(context.Context, *GetMessageStatisticsReq) (*GetMessageStatisticsResp, error) + GetGroupStatistics(context.Context, *GetGroupStatisticsReq) (*GetGroupStatisticsResp, error) + GetUserStatistics(context.Context, *GetUserStatisticsReq) (*GetUserStatisticsResp, error) +} + +// UnimplementedUserServer can be embedded to have forward compatible implementations. +type UnimplementedUserServer struct { +} + +func (*UnimplementedUserServer) GetActiveUser(context.Context, *GetActiveUserReq) (*GetActiveUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActiveUser not implemented") +} +func (*UnimplementedUserServer) GetActiveGroup(context.Context, *GetActiveGroupReq) (*GetActiveGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActiveGroup not implemented") +} +func (*UnimplementedUserServer) GetMessageStatistics(context.Context, *GetMessageStatisticsReq) (*GetMessageStatisticsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMessageStatistics not implemented") +} +func (*UnimplementedUserServer) GetGroupStatistics(context.Context, *GetGroupStatisticsReq) (*GetGroupStatisticsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupStatistics not implemented") +} +func (*UnimplementedUserServer) GetUserStatistics(context.Context, *GetUserStatisticsReq) (*GetUserStatisticsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserStatistics not implemented") +} + +func RegisterUserServer(s *grpc.Server, srv UserServer) { + s.RegisterService(&_User_serviceDesc, srv) +} + +func _User_GetActiveUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetActiveUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetActiveUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetActiveUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetActiveUser(ctx, req.(*GetActiveUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetActiveGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetActiveGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetActiveGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetActiveGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetActiveGroup(ctx, req.(*GetActiveGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetMessageStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMessageStatisticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetMessageStatistics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetMessageStatistics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetMessageStatistics(ctx, req.(*GetMessageStatisticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetGroupStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupStatisticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetGroupStatistics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetGroupStatistics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetGroupStatistics(ctx, req.(*GetGroupStatisticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUserStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserStatisticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUserStatistics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetUserStatistics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUserStatistics(ctx, req.(*GetUserStatisticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _User_serviceDesc = grpc.ServiceDesc{ + ServiceName: "statistics.user", + HandlerType: (*UserServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetActiveUser", + Handler: _User_GetActiveUser_Handler, + }, + { + MethodName: "GetActiveGroup", + Handler: _User_GetActiveGroup_Handler, + }, + { + MethodName: "GetMessageStatistics", + Handler: _User_GetMessageStatistics_Handler, + }, + { + MethodName: "GetGroupStatistics", + Handler: _User_GetGroupStatistics_Handler, + }, + { + MethodName: "GetUserStatistics", + Handler: _User_GetUserStatistics_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "statistics/statistics.proto", +} diff --git a/pkg/proto/statistics/statistics.proto b/pkg/proto/statistics/statistics.proto new file mode 100644 index 000000000..3c72e4bc5 --- /dev/null +++ b/pkg/proto/statistics/statistics.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; +// import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./statistics;statistics"; +package statistics; + +message StatisticsReq { + string from = 1; + string to = 2; +} + +message GetActiveUserReq{ + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + +message UserResp{ + string NickName = 1; + string UserId = 2; + int32 MessageNum = 3; +} + +message GetActiveUserResp { + repeated UserResp Users = 1; +} + +message GetActiveGroupReq{ + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + +message GroupResp { + string GroupName = 1; + string GroupId = 2; + int32 MessageNum = 3; +} + +message GetActiveGroupResp { + repeated GroupResp Groups = 1; +} + +message DateNumList { + string Date = 1; + int32 Num = 2; +} + + +message GetMessageStatisticsReq { + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + + +message GetMessageStatisticsResp { + int32 PrivateMessageNum = 1; + int32 GroupMessageNum = 2; + repeated DateNumList PrivateMessageNumList = 3; + repeated DateNumList GroupMessageNumList = 4; +} + +message GetGroupStatisticsReq { + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + + +message GetGroupStatisticsResp { + int32 IncreaseGroupNum = 1; + int32 TotalGroupNum = 2; + repeated DateNumList IncreaseGroupNumList = 3; + repeated DateNumList TotalGroupNumList = 4; +} + +message GetUserStatisticsReq { + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + +message GetUserStatisticsResp { + int32 IncreaseUserNum = 1; + int32 ActiveUserNum = 2; + int32 TotalUserNum = 3; + repeated DateNumList IncreaseUserNumList = 4; + repeated DateNumList ActiveUserNumList = 5; + repeated DateNumList TotalUserNumList = 6; +} + +service user { + rpc GetActiveUser(GetActiveUserReq) returns(GetActiveUserResp); + rpc GetActiveGroup(GetActiveGroupReq) returns(GetActiveGroupResp); + rpc GetMessageStatistics(GetMessageStatisticsReq) returns(GetMessageStatisticsResp); + rpc GetGroupStatistics(GetGroupStatisticsReq) returns(GetGroupStatisticsResp); + rpc GetUserStatistics(GetUserStatisticsReq) returns(GetUserStatisticsResp); +} \ No newline at end of file diff --git a/pkg/proto/user/user.pb.go b/pkg/proto/user/user.pb.go index 32771e8e3..aecc22680 100644 --- a/pkg/proto/user/user.pb.go +++ b/pkg/proto/user/user.pb.go @@ -1,674 +1,3732 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.15.5 // source: user/user.proto -package user // import "./user" +package user -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" import ( - context "golang.org/x/net/context" + sdk_ws "Open_IM/pkg/proto/sdk_ws" + context "context" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type CommonResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` } -func (m *CommonResp) Reset() { *m = CommonResp{} } -func (m *CommonResp) String() string { return proto.CompactTextString(m) } -func (*CommonResp) ProtoMessage() {} +func (x *CommonResp) Reset() { + *x = CommonResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommonResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResp) ProtoMessage() {} + +func (x *CommonResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonResp.ProtoReflect.Descriptor instead. func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{0} -} -func (m *CommonResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommonResp.Unmarshal(m, b) -} -func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) -} -func (dst *CommonResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommonResp.Merge(dst, src) -} -func (m *CommonResp) XXX_Size() int { - return xxx_messageInfo_CommonResp.Size(m) -} -func (m *CommonResp) XXX_DiscardUnknown() { - xxx_messageInfo_CommonResp.DiscardUnknown(m) + return file_user_user_proto_rawDescGZIP(), []int{0} } -var xxx_messageInfo_CommonResp proto.InternalMessageInfo - -func (m *CommonResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode +func (x *CommonResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode } return 0 } -func (m *CommonResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg +func (x *CommonResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +type DeleteUsersReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeleteUserIDList []string `protobuf:"bytes,2,rep,name=DeleteUserIDList,proto3" json:"DeleteUserIDList,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *DeleteUsersReq) Reset() { + *x = DeleteUsersReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUsersReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUsersReq) ProtoMessage() {} + +func (x *DeleteUsersReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUsersReq.ProtoReflect.Descriptor instead. +func (*DeleteUsersReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{1} +} + +func (x *DeleteUsersReq) GetDeleteUserIDList() []string { + if x != nil { + return x.DeleteUserIDList + } + return nil +} + +func (x *DeleteUsersReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *DeleteUsersReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } type DeleteUsersResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - FailedUidList []string `protobuf:"bytes,2,rep,name=failedUidList" json:"failedUidList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + FailedUserIDList []string `protobuf:"bytes,2,rep,name=FailedUserIDList,proto3" json:"FailedUserIDList,omitempty"` } -func (m *DeleteUsersResp) Reset() { *m = DeleteUsersResp{} } -func (m *DeleteUsersResp) String() string { return proto.CompactTextString(m) } -func (*DeleteUsersResp) ProtoMessage() {} +func (x *DeleteUsersResp) Reset() { + *x = DeleteUsersResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUsersResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUsersResp) ProtoMessage() {} + +func (x *DeleteUsersResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUsersResp.ProtoReflect.Descriptor instead. func (*DeleteUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{1} -} -func (m *DeleteUsersResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteUsersResp.Unmarshal(m, b) -} -func (m *DeleteUsersResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteUsersResp.Marshal(b, m, deterministic) -} -func (dst *DeleteUsersResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteUsersResp.Merge(dst, src) -} -func (m *DeleteUsersResp) XXX_Size() int { - return xxx_messageInfo_DeleteUsersResp.Size(m) -} -func (m *DeleteUsersResp) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteUsersResp.DiscardUnknown(m) + return file_user_user_proto_rawDescGZIP(), []int{2} } -var xxx_messageInfo_DeleteUsersResp proto.InternalMessageInfo - -func (m *DeleteUsersResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp +func (x *DeleteUsersResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp } return nil } -func (m *DeleteUsersResp) GetFailedUidList() []string { - if m != nil { - return m.FailedUidList +func (x *DeleteUsersResp) GetFailedUserIDList() []string { + if x != nil { + return x.FailedUserIDList } return nil } -type DeleteUsersReq struct { - DeleteUidList []string `protobuf:"bytes,2,rep,name=deleteUidList" json:"deleteUidList,omitempty"` - Token string `protobuf:"bytes,3,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type GetAllUserIDReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` } -func (m *DeleteUsersReq) Reset() { *m = DeleteUsersReq{} } -func (m *DeleteUsersReq) String() string { return proto.CompactTextString(m) } -func (*DeleteUsersReq) ProtoMessage() {} -func (*DeleteUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{2} -} -func (m *DeleteUsersReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeleteUsersReq.Unmarshal(m, b) -} -func (m *DeleteUsersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeleteUsersReq.Marshal(b, m, deterministic) -} -func (dst *DeleteUsersReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeleteUsersReq.Merge(dst, src) -} -func (m *DeleteUsersReq) XXX_Size() int { - return xxx_messageInfo_DeleteUsersReq.Size(m) -} -func (m *DeleteUsersReq) XXX_DiscardUnknown() { - xxx_messageInfo_DeleteUsersReq.DiscardUnknown(m) +func (x *GetAllUserIDReq) Reset() { + *x = GetAllUserIDReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -var xxx_messageInfo_DeleteUsersReq proto.InternalMessageInfo +func (x *GetAllUserIDReq) String() string { + return protoimpl.X.MessageStringOf(x) +} -func (m *DeleteUsersReq) GetDeleteUidList() []string { - if m != nil { - return m.DeleteUidList +func (*GetAllUserIDReq) ProtoMessage() {} + +func (x *GetAllUserIDReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllUserIDReq.ProtoReflect.Descriptor instead. +func (*GetAllUserIDReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{3} +} + +func (x *GetAllUserIDReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *GetAllUserIDReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetAllUserIDResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + UserIDList []string `protobuf:"bytes,2,rep,name=UserIDList,proto3" json:"UserIDList,omitempty"` +} + +func (x *GetAllUserIDResp) Reset() { + *x = GetAllUserIDResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAllUserIDResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllUserIDResp) ProtoMessage() {} + +func (x *GetAllUserIDResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllUserIDResp.ProtoReflect.Descriptor instead. +func (*GetAllUserIDResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{4} +} + +func (x *GetAllUserIDResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp } return nil } -func (m *DeleteUsersReq) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *DeleteUsersReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetAllUsersUidReq struct { - Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAllUsersUidReq) Reset() { *m = GetAllUsersUidReq{} } -func (m *GetAllUsersUidReq) String() string { return proto.CompactTextString(m) } -func (*GetAllUsersUidReq) ProtoMessage() {} -func (*GetAllUsersUidReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{3} -} -func (m *GetAllUsersUidReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAllUsersUidReq.Unmarshal(m, b) -} -func (m *GetAllUsersUidReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAllUsersUidReq.Marshal(b, m, deterministic) -} -func (dst *GetAllUsersUidReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAllUsersUidReq.Merge(dst, src) -} -func (m *GetAllUsersUidReq) XXX_Size() int { - return xxx_messageInfo_GetAllUsersUidReq.Size(m) -} -func (m *GetAllUsersUidReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetAllUsersUidReq.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAllUsersUidReq proto.InternalMessageInfo - -func (m *GetAllUsersUidReq) GetToken() string { - if m != nil { - return m.Token - } - return "" -} - -func (m *GetAllUsersUidReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -type GetAllUsersUidResp struct { - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` - UidList []string `protobuf:"bytes,2,rep,name=uidList" json:"uidList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetAllUsersUidResp) Reset() { *m = GetAllUsersUidResp{} } -func (m *GetAllUsersUidResp) String() string { return proto.CompactTextString(m) } -func (*GetAllUsersUidResp) ProtoMessage() {} -func (*GetAllUsersUidResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{4} -} -func (m *GetAllUsersUidResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAllUsersUidResp.Unmarshal(m, b) -} -func (m *GetAllUsersUidResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAllUsersUidResp.Marshal(b, m, deterministic) -} -func (dst *GetAllUsersUidResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAllUsersUidResp.Merge(dst, src) -} -func (m *GetAllUsersUidResp) XXX_Size() int { - return xxx_messageInfo_GetAllUsersUidResp.Size(m) -} -func (m *GetAllUsersUidResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetAllUsersUidResp.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAllUsersUidResp proto.InternalMessageInfo - -func (m *GetAllUsersUidResp) GetCommonResp() *CommonResp { - if m != nil { - return m.CommonResp +func (x *GetAllUserIDResp) GetUserIDList() []string { + if x != nil { + return x.UserIDList } return nil } -func (m *GetAllUsersUidResp) GetUidList() []string { - if m != nil { - return m.UidList +type AccountCheckReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CheckUserIDList []string `protobuf:"bytes,1,rep,name=CheckUserIDList,proto3" json:"CheckUserIDList,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *AccountCheckReq) Reset() { + *x = AccountCheckReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountCheckReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountCheckReq) ProtoMessage() {} + +func (x *AccountCheckReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountCheckReq.ProtoReflect.Descriptor instead. +func (*AccountCheckReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{5} +} + +func (x *AccountCheckReq) GetCheckUserIDList() []string { + if x != nil { + return x.CheckUserIDList + } + return nil +} + +func (x *AccountCheckReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *AccountCheckReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type AccountCheckResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` + ResultList []*AccountCheckResp_SingleUserStatus `protobuf:"bytes,2,rep,name=ResultList,proto3" json:"ResultList,omitempty"` +} + +func (x *AccountCheckResp) Reset() { + *x = AccountCheckResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountCheckResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountCheckResp) ProtoMessage() {} + +func (x *AccountCheckResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountCheckResp.ProtoReflect.Descriptor instead. +func (*AccountCheckResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{6} +} + +func (x *AccountCheckResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *AccountCheckResp) GetResultList() []*AccountCheckResp_SingleUserStatus { + if x != nil { + return x.ResultList } return nil } type GetUserInfoReq struct { - UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserIDList []string `protobuf:"bytes,1,rep,name=userIDList,proto3" json:"userIDList,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` } -func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } -func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } -func (*GetUserInfoReq) ProtoMessage() {} +func (x *GetUserInfoReq) Reset() { + *x = GetUserInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserInfoReq) ProtoMessage() {} + +func (x *GetUserInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserInfoReq.ProtoReflect.Descriptor instead. func (*GetUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{5} -} -func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) -} -func (m *GetUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserInfoReq.Marshal(b, m, deterministic) -} -func (dst *GetUserInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserInfoReq.Merge(dst, src) -} -func (m *GetUserInfoReq) XXX_Size() int { - return xxx_messageInfo_GetUserInfoReq.Size(m) -} -func (m *GetUserInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserInfoReq.DiscardUnknown(m) + return file_user_user_proto_rawDescGZIP(), []int{7} } -var xxx_messageInfo_GetUserInfoReq proto.InternalMessageInfo - -func (m *GetUserInfoReq) GetUserIDList() []string { - if m != nil { - return m.UserIDList +func (x *GetUserInfoReq) GetUserIDList() []string { + if x != nil { + return x.UserIDList } return nil } -func (m *GetUserInfoReq) GetToken() string { - if m != nil { - return m.Token +func (x *GetUserInfoReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *GetUserInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *GetUserInfoReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } type GetUserInfoResp struct { - ErrorCode int32 `protobuf:"varint,1,opt,name=errorCode" json:"errorCode,omitempty"` - ErrorMsg string `protobuf:"bytes,2,opt,name=errorMsg" json:"errorMsg,omitempty"` - Data []*UserInfo `protobuf:"bytes,3,rep,name=Data" json:"Data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` + UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,3,rep,name=UserInfoList,proto3" json:"UserInfoList,omitempty"` } -func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } -func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } -func (*GetUserInfoResp) ProtoMessage() {} +func (x *GetUserInfoResp) Reset() { + *x = GetUserInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserInfoResp) ProtoMessage() {} + +func (x *GetUserInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserInfoResp.ProtoReflect.Descriptor instead. func (*GetUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{6} -} -func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) -} -func (m *GetUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetUserInfoResp.Marshal(b, m, deterministic) -} -func (dst *GetUserInfoResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetUserInfoResp.Merge(dst, src) -} -func (m *GetUserInfoResp) XXX_Size() int { - return xxx_messageInfo_GetUserInfoResp.Size(m) -} -func (m *GetUserInfoResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetUserInfoResp.DiscardUnknown(m) + return file_user_user_proto_rawDescGZIP(), []int{8} } -var xxx_messageInfo_GetUserInfoResp proto.InternalMessageInfo - -func (m *GetUserInfoResp) GetErrorCode() int32 { - if m != nil { - return m.ErrorCode - } - return 0 -} - -func (m *GetUserInfoResp) GetErrorMsg() string { - if m != nil { - return m.ErrorMsg - } - return "" -} - -func (m *GetUserInfoResp) GetData() []*UserInfo { - if m != nil { - return m.Data +func (x *GetUserInfoResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp } return nil } -type UserInfo struct { - Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Icon string `protobuf:"bytes,3,opt,name=icon" json:"icon,omitempty"` - Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,5,opt,name=mobile" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,6,opt,name=birth" json:"birth,omitempty"` - Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` - Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *UserInfo) Reset() { *m = UserInfo{} } -func (m *UserInfo) String() string { return proto.CompactTextString(m) } -func (*UserInfo) ProtoMessage() {} -func (*UserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{7} -} -func (m *UserInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UserInfo.Unmarshal(m, b) -} -func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UserInfo.Marshal(b, m, deterministic) -} -func (dst *UserInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserInfo.Merge(dst, src) -} -func (m *UserInfo) XXX_Size() int { - return xxx_messageInfo_UserInfo.Size(m) -} -func (m *UserInfo) XXX_DiscardUnknown() { - xxx_messageInfo_UserInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_UserInfo proto.InternalMessageInfo - -func (m *UserInfo) GetUid() string { - if m != nil { - return m.Uid +func (x *GetUserInfoResp) GetUserInfoList() []*sdk_ws.UserInfo { + if x != nil { + return x.UserInfoList } - return "" -} - -func (m *UserInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *UserInfo) GetIcon() string { - if m != nil { - return m.Icon - } - return "" -} - -func (m *UserInfo) GetGender() int32 { - if m != nil { - return m.Gender - } - return 0 -} - -func (m *UserInfo) GetMobile() string { - if m != nil { - return m.Mobile - } - return "" -} - -func (m *UserInfo) GetBirth() string { - if m != nil { - return m.Birth - } - return "" -} - -func (m *UserInfo) GetEmail() string { - if m != nil { - return m.Email - } - return "" -} - -func (m *UserInfo) GetEx() string { - if m != nil { - return m.Ex - } - return "" -} - -type LogoutReq struct { - OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` - Token string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LogoutReq) Reset() { *m = LogoutReq{} } -func (m *LogoutReq) String() string { return proto.CompactTextString(m) } -func (*LogoutReq) ProtoMessage() {} -func (*LogoutReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{8} -} -func (m *LogoutReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LogoutReq.Unmarshal(m, b) -} -func (m *LogoutReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LogoutReq.Marshal(b, m, deterministic) -} -func (dst *LogoutReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogoutReq.Merge(dst, src) -} -func (m *LogoutReq) XXX_Size() int { - return xxx_messageInfo_LogoutReq.Size(m) -} -func (m *LogoutReq) XXX_DiscardUnknown() { - xxx_messageInfo_LogoutReq.DiscardUnknown(m) -} - -var xxx_messageInfo_LogoutReq proto.InternalMessageInfo - -func (m *LogoutReq) GetOperationID() string { - if m != nil { - return m.OperationID - } - return "" -} - -func (m *LogoutReq) GetToken() string { - if m != nil { - return m.Token - } - return "" + return nil } type UpdateUserInfoReq struct { - Icon string `protobuf:"bytes,1,opt,name=icon" json:"icon,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Gender int32 `protobuf:"varint,3,opt,name=gender" json:"gender,omitempty"` - Mobile string `protobuf:"bytes,4,opt,name=mobile" json:"mobile,omitempty"` - Birth string `protobuf:"bytes,5,opt,name=birth" json:"birth,omitempty"` - Email string `protobuf:"bytes,6,opt,name=email" json:"email,omitempty"` - Ex string `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"` - Token string `protobuf:"bytes,8,opt,name=token" json:"token,omitempty"` - OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` - Uid string `protobuf:"bytes,10,opt,name=Uid" json:"Uid,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserInfo *sdk_ws.UserInfo `protobuf:"bytes,1,opt,name=UserInfo,proto3" json:"UserInfo,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID,omitempty"` } -func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } -func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } -func (*UpdateUserInfoReq) ProtoMessage() {} +func (x *UpdateUserInfoReq) Reset() { + *x = UpdateUserInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserInfoReq) ProtoMessage() {} + +func (x *UpdateUserInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserInfoReq.ProtoReflect.Descriptor instead. func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9e1dacb346b997d7, []int{9} -} -func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) -} -func (m *UpdateUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_UpdateUserInfoReq.Marshal(b, m, deterministic) -} -func (dst *UpdateUserInfoReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_UpdateUserInfoReq.Merge(dst, src) -} -func (m *UpdateUserInfoReq) XXX_Size() int { - return xxx_messageInfo_UpdateUserInfoReq.Size(m) -} -func (m *UpdateUserInfoReq) XXX_DiscardUnknown() { - xxx_messageInfo_UpdateUserInfoReq.DiscardUnknown(m) + return file_user_user_proto_rawDescGZIP(), []int{9} } -var xxx_messageInfo_UpdateUserInfoReq proto.InternalMessageInfo +func (x *UpdateUserInfoReq) GetUserInfo() *sdk_ws.UserInfo { + if x != nil { + return x.UserInfo + } + return nil +} -func (m *UpdateUserInfoReq) GetIcon() string { - if m != nil { - return m.Icon +func (x *UpdateUserInfoReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *UpdateUserInfoReq) GetName() string { - if m != nil { - return m.Name +func (x *UpdateUserInfoReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *UpdateUserInfoReq) GetGender() int32 { - if m != nil { - return m.Gender +type UpdateUserInfoResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` +} + +func (x *UpdateUserInfoResp) Reset() { + *x = UpdateUserInfoResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserInfoResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserInfoResp) ProtoMessage() {} + +func (x *UpdateUserInfoResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserInfoResp.ProtoReflect.Descriptor instead. +func (*UpdateUserInfoResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{10} +} + +func (x *UpdateUserInfoResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +type SetReceiveMessageOptReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FromUserID string `protobuf:"bytes,1,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` + Opt int32 `protobuf:"varint,2,opt,name=opt,proto3" json:"opt,omitempty"` + ConversationIDList []string `protobuf:"bytes,3,rep,name=conversationIDList,proto3" json:"conversationIDList,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID,proto3" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,5,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` +} + +func (x *SetReceiveMessageOptReq) Reset() { + *x = SetReceiveMessageOptReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetReceiveMessageOptReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetReceiveMessageOptReq) ProtoMessage() {} + +func (x *SetReceiveMessageOptReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetReceiveMessageOptReq.ProtoReflect.Descriptor instead. +func (*SetReceiveMessageOptReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{11} +} + +func (x *SetReceiveMessageOptReq) GetFromUserID() string { + if x != nil { + return x.FromUserID + } + return "" +} + +func (x *SetReceiveMessageOptReq) GetOpt() int32 { + if x != nil { + return x.Opt } return 0 } -func (m *UpdateUserInfoReq) GetMobile() string { - if m != nil { - return m.Mobile +func (x *SetReceiveMessageOptReq) GetConversationIDList() []string { + if x != nil { + return x.ConversationIDList + } + return nil +} + +func (x *SetReceiveMessageOptReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *UpdateUserInfoReq) GetBirth() string { - if m != nil { - return m.Birth +func (x *SetReceiveMessageOptReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *UpdateUserInfoReq) GetEmail() string { - if m != nil { - return m.Email +type OptResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConversationID string `protobuf:"bytes,1,opt,name=conversationID,proto3" json:"conversationID,omitempty"` + Result int32 `protobuf:"varint,2,opt,name=result,proto3" json:"result,omitempty"` //-1: failed; 0:default; 1: not receive ; 2: not jpush +} + +func (x *OptResult) Reset() { + *x = OptResult{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptResult) ProtoMessage() {} + +func (x *OptResult) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OptResult.ProtoReflect.Descriptor instead. +func (*OptResult) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{12} +} + +func (x *OptResult) GetConversationID() string { + if x != nil { + return x.ConversationID } return "" } -func (m *UpdateUserInfoReq) GetEx() string { - if m != nil { - return m.Ex +func (x *OptResult) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +type SetReceiveMessageOptResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` + ConversationOptResultList []*OptResult `protobuf:"bytes,2,rep,name=conversationOptResultList,proto3" json:"conversationOptResultList,omitempty"` +} + +func (x *SetReceiveMessageOptResp) Reset() { + *x = SetReceiveMessageOptResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetReceiveMessageOptResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetReceiveMessageOptResp) ProtoMessage() {} + +func (x *SetReceiveMessageOptResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetReceiveMessageOptResp.ProtoReflect.Descriptor instead. +func (*SetReceiveMessageOptResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{13} +} + +func (x *SetReceiveMessageOptResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *SetReceiveMessageOptResp) GetConversationOptResultList() []*OptResult { + if x != nil { + return x.ConversationOptResultList + } + return nil +} + +type GetReceiveMessageOptReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FromUserID string `protobuf:"bytes,1,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` + ConversationIDList []string `protobuf:"bytes,2,rep,name=conversationIDList,proto3" json:"conversationIDList,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,4,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` +} + +func (x *GetReceiveMessageOptReq) Reset() { + *x = GetReceiveMessageOptReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetReceiveMessageOptReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetReceiveMessageOptReq) ProtoMessage() {} + +func (x *GetReceiveMessageOptReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetReceiveMessageOptReq.ProtoReflect.Descriptor instead. +func (*GetReceiveMessageOptReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{14} +} + +func (x *GetReceiveMessageOptReq) GetFromUserID() string { + if x != nil { + return x.FromUserID } return "" } -func (m *UpdateUserInfoReq) GetToken() string { - if m != nil { - return m.Token +func (x *GetReceiveMessageOptReq) GetConversationIDList() []string { + if x != nil { + return x.ConversationIDList + } + return nil +} + +func (x *GetReceiveMessageOptReq) GetOperationID() string { + if x != nil { + return x.OperationID } return "" } -func (m *UpdateUserInfoReq) GetOperationID() string { - if m != nil { - return m.OperationID +func (x *GetReceiveMessageOptReq) GetOpUserID() string { + if x != nil { + return x.OpUserID } return "" } -func (m *UpdateUserInfoReq) GetUid() string { - if m != nil { - return m.Uid +type GetReceiveMessageOptResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` + ConversationOptResultList []*OptResult `protobuf:"bytes,3,rep,name=conversationOptResultList,proto3" json:"conversationOptResultList,omitempty"` +} + +func (x *GetReceiveMessageOptResp) Reset() { + *x = GetReceiveMessageOptResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetReceiveMessageOptResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetReceiveMessageOptResp) ProtoMessage() {} + +func (x *GetReceiveMessageOptResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetReceiveMessageOptResp.ProtoReflect.Descriptor instead. +func (*GetReceiveMessageOptResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{15} +} + +func (x *GetReceiveMessageOptResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *GetReceiveMessageOptResp) GetConversationOptResultList() []*OptResult { + if x != nil { + return x.ConversationOptResultList + } + return nil +} + +type GetAllConversationMsgOptReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FromUserID string `protobuf:"bytes,1,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` +} + +func (x *GetAllConversationMsgOptReq) Reset() { + *x = GetAllConversationMsgOptReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAllConversationMsgOptReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllConversationMsgOptReq) ProtoMessage() {} + +func (x *GetAllConversationMsgOptReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllConversationMsgOptReq.ProtoReflect.Descriptor instead. +func (*GetAllConversationMsgOptReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{16} +} + +func (x *GetAllConversationMsgOptReq) GetFromUserID() string { + if x != nil { + return x.FromUserID } return "" } -func init() { - proto.RegisterType((*CommonResp)(nil), "user.CommonResp") - proto.RegisterType((*DeleteUsersResp)(nil), "user.DeleteUsersResp") - proto.RegisterType((*DeleteUsersReq)(nil), "user.DeleteUsersReq") - proto.RegisterType((*GetAllUsersUidReq)(nil), "user.GetAllUsersUidReq") - proto.RegisterType((*GetAllUsersUidResp)(nil), "user.GetAllUsersUidResp") - proto.RegisterType((*GetUserInfoReq)(nil), "user.GetUserInfoReq") - proto.RegisterType((*GetUserInfoResp)(nil), "user.GetUserInfoResp") - proto.RegisterType((*UserInfo)(nil), "user.UserInfo") - proto.RegisterType((*LogoutReq)(nil), "user.LogoutReq") - proto.RegisterType((*UpdateUserInfoReq)(nil), "user.UpdateUserInfoReq") +func (x *GetAllConversationMsgOptReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *GetAllConversationMsgOptReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +type GetAllConversationMsgOptResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` + ConversationOptResultList []*OptResult `protobuf:"bytes,3,rep,name=conversationOptResultList,proto3" json:"conversationOptResultList,omitempty"` +} + +func (x *GetAllConversationMsgOptResp) Reset() { + *x = GetAllConversationMsgOptResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAllConversationMsgOptResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllConversationMsgOptResp) ProtoMessage() {} + +func (x *GetAllConversationMsgOptResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAllConversationMsgOptResp.ProtoReflect.Descriptor instead. +func (*GetAllConversationMsgOptResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{17} +} + +func (x *GetAllConversationMsgOptResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *GetAllConversationMsgOptResp) GetConversationOptResultList() []*OptResult { + if x != nil { + return x.ConversationOptResultList + } + return nil +} + +type ResignUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *ResignUserReq) Reset() { + *x = ResignUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResignUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResignUserReq) ProtoMessage() {} + +func (x *ResignUserReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResignUserReq.ProtoReflect.Descriptor instead. +func (*ResignUserReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{18} +} + +func (x *ResignUserReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *ResignUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type ResignUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` +} + +func (x *ResignUserResp) Reset() { + *x = ResignUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResignUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResignUserResp) ProtoMessage() {} + +func (x *ResignUserResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResignUserResp.ProtoReflect.Descriptor instead. +func (*ResignUserResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{19} +} + +func (x *ResignUserResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +type GetUserByIdReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetUserByIdReq) Reset() { + *x = GetUserByIdReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserByIdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserByIdReq) ProtoMessage() {} + +func (x *GetUserByIdReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserByIdReq.ProtoReflect.Descriptor instead. +func (*GetUserByIdReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{20} +} + +func (x *GetUserByIdReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetUserByIdReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProfilePhoto string `protobuf:"bytes,1,opt,name=ProfilePhoto,proto3" json:"ProfilePhoto,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=Nickname,proto3" json:"Nickname,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=UserId,proto3" json:"UserId,omitempty"` + CreateTime string `protobuf:"bytes,4,opt,name=CreateTime,proto3" json:"CreateTime,omitempty"` + IsBlock bool `protobuf:"varint,5,opt,name=IsBlock,proto3" json:"IsBlock,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{21} +} + +func (x *User) GetProfilePhoto() string { + if x != nil { + return x.ProfilePhoto + } + return "" +} + +func (x *User) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +func (x *User) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *User) GetCreateTime() string { + if x != nil { + return x.CreateTime + } + return "" +} + +func (x *User) GetIsBlock() bool { + if x != nil { + return x.IsBlock + } + return false +} + +type GetUserByIdResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *GetUserByIdResp) Reset() { + *x = GetUserByIdResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserByIdResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserByIdResp) ProtoMessage() {} + +func (x *GetUserByIdResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserByIdResp.ProtoReflect.Descriptor instead. +func (*GetUserByIdResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{22} +} + +func (x *GetUserByIdResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *GetUserByIdResp) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +type GetUsersByNameReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserName string `protobuf:"bytes,1,opt,name=UserName,proto3" json:"UserName,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetUsersByNameReq) Reset() { + *x = GetUsersByNameReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUsersByNameReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUsersByNameReq) ProtoMessage() {} + +func (x *GetUsersByNameReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUsersByNameReq.ProtoReflect.Descriptor instead. +func (*GetUsersByNameReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{23} +} + +func (x *GetUsersByNameReq) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +func (x *GetUsersByNameReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetUsersByNameReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetUsersByNameResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + UserNums int32 `protobuf:"varint,3,opt,name=UserNums,proto3" json:"UserNums,omitempty"` +} + +func (x *GetUsersByNameResp) Reset() { + *x = GetUsersByNameResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUsersByNameResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUsersByNameResp) ProtoMessage() {} + +func (x *GetUsersByNameResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUsersByNameResp.ProtoReflect.Descriptor instead. +func (*GetUsersByNameResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{24} +} + +func (x *GetUsersByNameResp) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +func (x *GetUsersByNameResp) GetPagination() *sdk_ws.ResponsePagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetUsersByNameResp) GetUserNums() int32 { + if x != nil { + return x.UserNums + } + return 0 +} + +type AlterUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + PhoneNumber int64 `protobuf:"varint,3,opt,name=PhoneNumber,proto3" json:"PhoneNumber,omitempty"` + Nickname string `protobuf:"bytes,4,opt,name=Nickname,proto3" json:"Nickname,omitempty"` + Email string `protobuf:"bytes,5,opt,name=Email,proto3" json:"Email,omitempty"` + OpUserId string `protobuf:"bytes,6,opt,name=OpUserId,proto3" json:"OpUserId,omitempty"` +} + +func (x *AlterUserReq) Reset() { + *x = AlterUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AlterUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AlterUserReq) ProtoMessage() {} + +func (x *AlterUserReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AlterUserReq.ProtoReflect.Descriptor instead. +func (*AlterUserReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{25} +} + +func (x *AlterUserReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AlterUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *AlterUserReq) GetPhoneNumber() int64 { + if x != nil { + return x.PhoneNumber + } + return 0 +} + +func (x *AlterUserReq) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +func (x *AlterUserReq) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *AlterUserReq) GetOpUserId() string { + if x != nil { + return x.OpUserId + } + return "" +} + +type AlterUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` +} + +func (x *AlterUserResp) Reset() { + *x = AlterUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AlterUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AlterUserResp) ProtoMessage() {} + +func (x *AlterUserResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AlterUserResp.ProtoReflect.Descriptor instead. +func (*AlterUserResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{26} +} + +func (x *AlterUserResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +type GetUsersReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + UserName string `protobuf:"bytes,3,opt,name=UserName,proto3" json:"UserName,omitempty"` +} + +func (x *GetUsersReq) Reset() { + *x = GetUsersReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUsersReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUsersReq) ProtoMessage() {} + +func (x *GetUsersReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUsersReq.ProtoReflect.Descriptor instead. +func (*GetUsersReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{27} +} + +func (x *GetUsersReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *GetUsersReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetUsersReq) GetUserName() string { + if x != nil { + return x.UserName + } + return "" +} + +type GetUsersResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + User []*User `protobuf:"bytes,2,rep,name=user,proto3" json:"user,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + UserNums int32 `protobuf:"varint,4,opt,name=UserNums,proto3" json:"UserNums,omitempty"` +} + +func (x *GetUsersResp) Reset() { + *x = GetUsersResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUsersResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUsersResp) ProtoMessage() {} + +func (x *GetUsersResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUsersResp.ProtoReflect.Descriptor instead. +func (*GetUsersResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{28} +} + +func (x *GetUsersResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *GetUsersResp) GetUser() []*User { + if x != nil { + return x.User + } + return nil +} + +func (x *GetUsersResp) GetPagination() *sdk_ws.ResponsePagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetUsersResp) GetUserNums() int32 { + if x != nil { + return x.UserNums + } + return 0 +} + +type AddUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + PhoneNumber string `protobuf:"bytes,2,opt,name=PhoneNumber,proto3" json:"PhoneNumber,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=UserId,proto3" json:"UserId,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + OpUserId string `protobuf:"bytes,5,opt,name=OpUserId,proto3" json:"OpUserId,omitempty"` +} + +func (x *AddUserReq) Reset() { + *x = AddUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddUserReq) ProtoMessage() {} + +func (x *AddUserReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddUserReq.ProtoReflect.Descriptor instead. +func (*AddUserReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{29} +} + +func (x *AddUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *AddUserReq) GetPhoneNumber() string { + if x != nil { + return x.PhoneNumber + } + return "" +} + +func (x *AddUserReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *AddUserReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AddUserReq) GetOpUserId() string { + if x != nil { + return x.OpUserId + } + return "" +} + +type AddUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` +} + +func (x *AddUserResp) Reset() { + *x = AddUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddUserResp) ProtoMessage() {} + +func (x *AddUserResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddUserResp.ProtoReflect.Descriptor instead. +func (*AddUserResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{30} +} + +func (x *AddUserResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +type BlockUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"` + EndDisableTime string `protobuf:"bytes,2,opt,name=EndDisableTime,proto3" json:"EndDisableTime,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,4,opt,name=OpUserId,proto3" json:"OpUserId,omitempty"` +} + +func (x *BlockUserReq) Reset() { + *x = BlockUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockUserReq) ProtoMessage() {} + +func (x *BlockUserReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockUserReq.ProtoReflect.Descriptor instead. +func (*BlockUserReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{31} +} + +func (x *BlockUserReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *BlockUserReq) GetEndDisableTime() string { + if x != nil { + return x.EndDisableTime + } + return "" +} + +func (x *BlockUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *BlockUserReq) GetOpUserId() string { + if x != nil { + return x.OpUserId + } + return "" +} + +type BlockUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` +} + +func (x *BlockUserResp) Reset() { + *x = BlockUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockUserResp) ProtoMessage() {} + +func (x *BlockUserResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockUserResp.ProtoReflect.Descriptor instead. +func (*BlockUserResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{32} +} + +func (x *BlockUserResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +type UnBlockUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,3,opt,name=OpUserId,proto3" json:"OpUserId,omitempty"` +} + +func (x *UnBlockUserReq) Reset() { + *x = UnBlockUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnBlockUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnBlockUserReq) ProtoMessage() {} + +func (x *UnBlockUserReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnBlockUserReq.ProtoReflect.Descriptor instead. +func (*UnBlockUserReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{33} +} + +func (x *UnBlockUserReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UnBlockUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *UnBlockUserReq) GetOpUserId() string { + if x != nil { + return x.OpUserId + } + return "" +} + +type UnBlockUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` +} + +func (x *UnBlockUserResp) Reset() { + *x = UnBlockUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnBlockUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnBlockUserResp) ProtoMessage() {} + +func (x *UnBlockUserResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnBlockUserResp.ProtoReflect.Descriptor instead. +func (*UnBlockUserResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{34} +} + +func (x *UnBlockUserResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +type GetBlockUsersReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + BlockUserNum int32 `protobuf:"varint,3,opt,name=BlockUserNum,proto3" json:"BlockUserNum,omitempty"` +} + +func (x *GetBlockUsersReq) Reset() { + *x = GetBlockUsersReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlockUsersReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockUsersReq) ProtoMessage() {} + +func (x *GetBlockUsersReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlockUsersReq.ProtoReflect.Descriptor instead. +func (*GetBlockUsersReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{35} +} + +func (x *GetBlockUsersReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetBlockUsersReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *GetBlockUsersReq) GetBlockUserNum() int32 { + if x != nil { + return x.BlockUserNum + } + return 0 +} + +type BlockUser struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *User `protobuf:"bytes,1,opt,name=User,proto3" json:"User,omitempty"` + BeginDisableTime string `protobuf:"bytes,2,opt,name=BeginDisableTime,proto3" json:"BeginDisableTime,omitempty"` + EndDisableTime string `protobuf:"bytes,3,opt,name=EndDisableTime,proto3" json:"EndDisableTime,omitempty"` +} + +func (x *BlockUser) Reset() { + *x = BlockUser{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockUser) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockUser) ProtoMessage() {} + +func (x *BlockUser) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockUser.ProtoReflect.Descriptor instead. +func (*BlockUser) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{36} +} + +func (x *BlockUser) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *BlockUser) GetBeginDisableTime() string { + if x != nil { + return x.BeginDisableTime + } + return "" +} + +func (x *BlockUser) GetEndDisableTime() string { + if x != nil { + return x.EndDisableTime + } + return "" +} + +type GetBlockUsersResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + BlockUsers []*BlockUser `protobuf:"bytes,2,rep,name=BlockUsers,proto3" json:"BlockUsers,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + UserNums int32 `protobuf:"varint,4,opt,name=UserNums,proto3" json:"UserNums,omitempty"` +} + +func (x *GetBlockUsersResp) Reset() { + *x = GetBlockUsersResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlockUsersResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockUsersResp) ProtoMessage() {} + +func (x *GetBlockUsersResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlockUsersResp.ProtoReflect.Descriptor instead. +func (*GetBlockUsersResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{37} +} + +func (x *GetBlockUsersResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *GetBlockUsersResp) GetBlockUsers() []*BlockUser { + if x != nil { + return x.BlockUsers + } + return nil +} + +func (x *GetBlockUsersResp) GetPagination() *sdk_ws.ResponsePagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetBlockUsersResp) GetUserNums() int32 { + if x != nil { + return x.UserNums + } + return 0 +} + +type GetBlockUserByIdReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=User_id,json=UserId,proto3" json:"User_id,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetBlockUserByIdReq) Reset() { + *x = GetBlockUserByIdReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlockUserByIdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockUserByIdReq) ProtoMessage() {} + +func (x *GetBlockUserByIdReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlockUserByIdReq.ProtoReflect.Descriptor instead. +func (*GetBlockUserByIdReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{38} +} + +func (x *GetBlockUserByIdReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetBlockUserByIdReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetBlockUserByIdResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockUser *BlockUser `protobuf:"bytes,2,opt,name=BlockUser,proto3" json:"BlockUser,omitempty"` +} + +func (x *GetBlockUserByIdResp) Reset() { + *x = GetBlockUserByIdResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetBlockUserByIdResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlockUserByIdResp) ProtoMessage() {} + +func (x *GetBlockUserByIdResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlockUserByIdResp.ProtoReflect.Descriptor instead. +func (*GetBlockUserByIdResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{39} +} + +func (x *GetBlockUserByIdResp) GetBlockUser() *BlockUser { + if x != nil { + return x.BlockUser + } + return nil +} + +type DeleteUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=User_id,json=UserId,proto3" json:"User_id,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,3,opt,name=OpUserId,proto3" json:"OpUserId,omitempty"` +} + +func (x *DeleteUserReq) Reset() { + *x = DeleteUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserReq) ProtoMessage() {} + +func (x *DeleteUserReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserReq.ProtoReflect.Descriptor instead. +func (*DeleteUserReq) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{40} +} + +func (x *DeleteUserReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *DeleteUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *DeleteUserReq) GetOpUserId() string { + if x != nil { + return x.OpUserId + } + return "" +} + +type DeleteUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteUserResp) Reset() { + *x = DeleteUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserResp) ProtoMessage() {} + +func (x *DeleteUserResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserResp.ProtoReflect.Descriptor instead. +func (*DeleteUserResp) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{41} +} + +type AccountCheckResp_SingleUserStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` + AccountStatus string `protobuf:"bytes,2,opt,name=accountStatus,proto3" json:"accountStatus,omitempty"` +} + +func (x *AccountCheckResp_SingleUserStatus) Reset() { + *x = AccountCheckResp_SingleUserStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountCheckResp_SingleUserStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountCheckResp_SingleUserStatus) ProtoMessage() {} + +func (x *AccountCheckResp_SingleUserStatus) ProtoReflect() protoreflect.Message { + mi := &file_user_user_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountCheckResp_SingleUserStatus.ProtoReflect.Descriptor instead. +func (*AccountCheckResp_SingleUserStatus) Descriptor() ([]byte, []int) { + return file_user_user_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *AccountCheckResp_SingleUserStatus) GetUserID() string { + if x != nil { + return x.UserID + } + return "" +} + +func (x *AccountCheckResp_SingleUserStatus) GetAccountStatus() string { + if x != nil { + return x.AccountStatus + } + return "" +} + +var File_user_user_proto protoreflect.FileDescriptor + +var file_user_user_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x04, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x21, 0x4f, 0x70, 0x65, 0x6e, 0x5f, 0x49, 0x4d, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x64, 0x6b, 0x5f, 0x77, + 0x73, 0x2f, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0a, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x7a, 0x0a, 0x0e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x2a, 0x0a, 0x10, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x6f, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x10, 0x46, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x6c, + 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x64, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, + 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, + 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x79, + 0x0a, 0x0f, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x12, 0x28, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x4f, + 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, + 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xdf, 0x01, 0x0a, 0x10, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, + 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x47, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x50, 0x0a, 0x10, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x6e, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, + 0x0a, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x84, 0x01, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x30, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x3f, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, + 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, + 0x73, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x37, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, + 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, + 0x46, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0xb9, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, + 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x6f, 0x70, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x22, 0x4b, 0x0a, 0x09, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x22, 0x9b, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, + 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x4d, 0x0a, 0x19, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, + 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x52, 0x19, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xa7, + 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x72, + 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x12, 0x63, 0x6f, + 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, + 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x9b, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x19, 0x63, 0x6f, 0x6e, 0x76, 0x65, + 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x19, 0x63, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x7b, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, + 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x4f, + 0x70, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x22, 0x9f, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, + 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x19, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x19, 0x63, 0x6f, 0x6e, 0x76, + 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x49, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, + 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x22, 0x42, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x4a, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, + 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, + 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, + 0x22, 0x98, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x0a, + 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x49, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x63, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, + 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x1e, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x22, 0x97, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, + 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x99, 0x01, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x20, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, + 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x55, 0x73, + 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x0c, 0x41, 0x6c, 0x74, 0x65, 0x72, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x22, 0x41, 0x0a, 0x0d, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x91, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xc3, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0a, 0x50, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x98, + 0x01, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, + 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, + 0x20, 0x0a, 0x0b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x0b, 0x41, 0x64, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x8c, 0x01, 0x0a, 0x0c, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x45, 0x6e, 0x64, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x45, 0x6e, 0x64, + 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x66, 0x0a, 0x0e, + 0x55, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, + 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0f, 0x55, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x44, + 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x22, 0x7f, 0x0a, 0x09, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x42, 0x65, 0x67, 0x69, 0x6e, + 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x45, 0x6e, 0x64, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x45, 0x6e, 0x64, + 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xd9, 0x01, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x30, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x2f, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x73, 0x22, 0x50, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x45, 0x0a, 0x14, 0x47, 0x65, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x2d, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, + 0x22, 0x66, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x12, 0x17, 0x0a, 0x07, 0x55, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, + 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x32, 0xdd, 0x09, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x43, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x12, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x3d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, + 0x12, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x55, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, + 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x53, 0x65, + 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, + 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x55, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x12, 0x1d, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x61, 0x0a, + 0x18, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x3d, 0x0a, 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x12, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x3a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x14, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, + 0x64, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x43, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x37, 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x69, 0x67, + 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x09, 0x41, 0x6c, 0x74, + 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x6c, + 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x31, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x11, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x2e, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, + 0x11, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x34, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x12, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x0b, 0x55, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, + 0x49, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x37, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x13, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, + 0x75, 0x73, 0x65, 0x72, 0x3b, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_user_user_proto_rawDescOnce sync.Once + file_user_user_proto_rawDescData = file_user_user_proto_rawDesc +) + +func file_user_user_proto_rawDescGZIP() []byte { + file_user_user_proto_rawDescOnce.Do(func() { + file_user_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_user_proto_rawDescData) + }) + return file_user_user_proto_rawDescData +} + +var file_user_user_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_user_user_proto_goTypes = []interface{}{ + (*CommonResp)(nil), // 0: user.CommonResp + (*DeleteUsersReq)(nil), // 1: user.DeleteUsersReq + (*DeleteUsersResp)(nil), // 2: user.DeleteUsersResp + (*GetAllUserIDReq)(nil), // 3: user.GetAllUserIDReq + (*GetAllUserIDResp)(nil), // 4: user.GetAllUserIDResp + (*AccountCheckReq)(nil), // 5: user.AccountCheckReq + (*AccountCheckResp)(nil), // 6: user.AccountCheckResp + (*GetUserInfoReq)(nil), // 7: user.GetUserInfoReq + (*GetUserInfoResp)(nil), // 8: user.GetUserInfoResp + (*UpdateUserInfoReq)(nil), // 9: user.UpdateUserInfoReq + (*UpdateUserInfoResp)(nil), // 10: user.UpdateUserInfoResp + (*SetReceiveMessageOptReq)(nil), // 11: user.SetReceiveMessageOptReq + (*OptResult)(nil), // 12: user.OptResult + (*SetReceiveMessageOptResp)(nil), // 13: user.SetReceiveMessageOptResp + (*GetReceiveMessageOptReq)(nil), // 14: user.GetReceiveMessageOptReq + (*GetReceiveMessageOptResp)(nil), // 15: user.GetReceiveMessageOptResp + (*GetAllConversationMsgOptReq)(nil), // 16: user.GetAllConversationMsgOptReq + (*GetAllConversationMsgOptResp)(nil), // 17: user.GetAllConversationMsgOptResp + (*ResignUserReq)(nil), // 18: user.ResignUserReq + (*ResignUserResp)(nil), // 19: user.ResignUserResp + (*GetUserByIdReq)(nil), // 20: user.GetUserByIdReq + (*User)(nil), // 21: user.User + (*GetUserByIdResp)(nil), // 22: user.GetUserByIdResp + (*GetUsersByNameReq)(nil), // 23: user.GetUsersByNameReq + (*GetUsersByNameResp)(nil), // 24: user.GetUsersByNameResp + (*AlterUserReq)(nil), // 25: user.AlterUserReq + (*AlterUserResp)(nil), // 26: user.AlterUserResp + (*GetUsersReq)(nil), // 27: user.GetUsersReq + (*GetUsersResp)(nil), // 28: user.GetUsersResp + (*AddUserReq)(nil), // 29: user.AddUserReq + (*AddUserResp)(nil), // 30: user.AddUserResp + (*BlockUserReq)(nil), // 31: user.BlockUserReq + (*BlockUserResp)(nil), // 32: user.BlockUserResp + (*UnBlockUserReq)(nil), // 33: user.UnBlockUserReq + (*UnBlockUserResp)(nil), // 34: user.UnBlockUserResp + (*GetBlockUsersReq)(nil), // 35: user.GetBlockUsersReq + (*BlockUser)(nil), // 36: user.BlockUser + (*GetBlockUsersResp)(nil), // 37: user.GetBlockUsersResp + (*GetBlockUserByIdReq)(nil), // 38: user.GetBlockUserByIdReq + (*GetBlockUserByIdResp)(nil), // 39: user.GetBlockUserByIdResp + (*DeleteUserReq)(nil), // 40: user.DeleteUserReq + (*DeleteUserResp)(nil), // 41: user.DeleteUserResp + (*AccountCheckResp_SingleUserStatus)(nil), // 42: user.AccountCheckResp.SingleUserStatus + (*sdk_ws.UserInfo)(nil), // 43: server_api_params.UserInfo + (*sdk_ws.RequestPagination)(nil), // 44: server_api_params.RequestPagination + (*sdk_ws.ResponsePagination)(nil), // 45: server_api_params.ResponsePagination +} +var file_user_user_proto_depIdxs = []int32{ + 0, // 0: user.DeleteUsersResp.CommonResp:type_name -> user.CommonResp + 0, // 1: user.GetAllUserIDResp.CommonResp:type_name -> user.CommonResp + 0, // 2: user.AccountCheckResp.commonResp:type_name -> user.CommonResp + 42, // 3: user.AccountCheckResp.ResultList:type_name -> user.AccountCheckResp.SingleUserStatus + 0, // 4: user.GetUserInfoResp.commonResp:type_name -> user.CommonResp + 43, // 5: user.GetUserInfoResp.UserInfoList:type_name -> server_api_params.UserInfo + 43, // 6: user.UpdateUserInfoReq.UserInfo:type_name -> server_api_params.UserInfo + 0, // 7: user.UpdateUserInfoResp.commonResp:type_name -> user.CommonResp + 0, // 8: user.SetReceiveMessageOptResp.commonResp:type_name -> user.CommonResp + 12, // 9: user.SetReceiveMessageOptResp.conversationOptResultList:type_name -> user.OptResult + 0, // 10: user.GetReceiveMessageOptResp.commonResp:type_name -> user.CommonResp + 12, // 11: user.GetReceiveMessageOptResp.conversationOptResultList:type_name -> user.OptResult + 0, // 12: user.GetAllConversationMsgOptResp.commonResp:type_name -> user.CommonResp + 12, // 13: user.GetAllConversationMsgOptResp.conversationOptResultList:type_name -> user.OptResult + 0, // 14: user.ResignUserResp.commonResp:type_name -> user.CommonResp + 0, // 15: user.GetUserByIdResp.CommonResp:type_name -> user.CommonResp + 21, // 16: user.GetUserByIdResp.user:type_name -> user.User + 44, // 17: user.GetUsersByNameReq.Pagination:type_name -> server_api_params.RequestPagination + 21, // 18: user.GetUsersByNameResp.users:type_name -> user.User + 45, // 19: user.GetUsersByNameResp.Pagination:type_name -> server_api_params.ResponsePagination + 0, // 20: user.AlterUserResp.CommonResp:type_name -> user.CommonResp + 44, // 21: user.GetUsersReq.Pagination:type_name -> server_api_params.RequestPagination + 0, // 22: user.GetUsersResp.CommonResp:type_name -> user.CommonResp + 21, // 23: user.GetUsersResp.user:type_name -> user.User + 45, // 24: user.GetUsersResp.Pagination:type_name -> server_api_params.ResponsePagination + 0, // 25: user.AddUserResp.CommonResp:type_name -> user.CommonResp + 0, // 26: user.BlockUserResp.CommonResp:type_name -> user.CommonResp + 0, // 27: user.UnBlockUserResp.CommonResp:type_name -> user.CommonResp + 44, // 28: user.GetBlockUsersReq.Pagination:type_name -> server_api_params.RequestPagination + 21, // 29: user.BlockUser.User:type_name -> user.User + 0, // 30: user.GetBlockUsersResp.CommonResp:type_name -> user.CommonResp + 36, // 31: user.GetBlockUsersResp.BlockUsers:type_name -> user.BlockUser + 45, // 32: user.GetBlockUsersResp.Pagination:type_name -> server_api_params.ResponsePagination + 36, // 33: user.GetBlockUserByIdResp.BlockUser:type_name -> user.BlockUser + 7, // 34: user.user.GetUserInfo:input_type -> user.GetUserInfoReq + 9, // 35: user.user.UpdateUserInfo:input_type -> user.UpdateUserInfoReq + 1, // 36: user.user.DeleteUsers:input_type -> user.DeleteUsersReq + 3, // 37: user.user.GetAllUserID:input_type -> user.GetAllUserIDReq + 11, // 38: user.user.SetReceiveMessageOpt:input_type -> user.SetReceiveMessageOptReq + 14, // 39: user.user.GetReceiveMessageOpt:input_type -> user.GetReceiveMessageOptReq + 16, // 40: user.user.GetAllConversationMsgOpt:input_type -> user.GetAllConversationMsgOptReq + 5, // 41: user.user.AccountCheck:input_type -> user.AccountCheckReq + 20, // 42: user.user.GetUserById:input_type -> user.GetUserByIdReq + 23, // 43: user.user.GetUsersByName:input_type -> user.GetUsersByNameReq + 18, // 44: user.user.ResignUser:input_type -> user.ResignUserReq + 25, // 45: user.user.AlterUser:input_type -> user.AlterUserReq + 27, // 46: user.user.GetUsers:input_type -> user.GetUsersReq + 29, // 47: user.user.AddUser:input_type -> user.AddUserReq + 31, // 48: user.user.BlockUser:input_type -> user.BlockUserReq + 33, // 49: user.user.UnBlockUser:input_type -> user.UnBlockUserReq + 35, // 50: user.user.GetBlockUsers:input_type -> user.GetBlockUsersReq + 38, // 51: user.user.GetBlockUserById:input_type -> user.GetBlockUserByIdReq + 40, // 52: user.user.DeleteUser:input_type -> user.DeleteUserReq + 8, // 53: user.user.GetUserInfo:output_type -> user.GetUserInfoResp + 10, // 54: user.user.UpdateUserInfo:output_type -> user.UpdateUserInfoResp + 2, // 55: user.user.DeleteUsers:output_type -> user.DeleteUsersResp + 4, // 56: user.user.GetAllUserID:output_type -> user.GetAllUserIDResp + 13, // 57: user.user.SetReceiveMessageOpt:output_type -> user.SetReceiveMessageOptResp + 15, // 58: user.user.GetReceiveMessageOpt:output_type -> user.GetReceiveMessageOptResp + 17, // 59: user.user.GetAllConversationMsgOpt:output_type -> user.GetAllConversationMsgOptResp + 6, // 60: user.user.AccountCheck:output_type -> user.AccountCheckResp + 22, // 61: user.user.GetUserById:output_type -> user.GetUserByIdResp + 24, // 62: user.user.GetUsersByName:output_type -> user.GetUsersByNameResp + 19, // 63: user.user.ResignUser:output_type -> user.ResignUserResp + 26, // 64: user.user.AlterUser:output_type -> user.AlterUserResp + 28, // 65: user.user.GetUsers:output_type -> user.GetUsersResp + 30, // 66: user.user.AddUser:output_type -> user.AddUserResp + 32, // 67: user.user.BlockUser:output_type -> user.BlockUserResp + 34, // 68: user.user.UnBlockUser:output_type -> user.UnBlockUserResp + 37, // 69: user.user.GetBlockUsers:output_type -> user.GetBlockUsersResp + 39, // 70: user.user.GetBlockUserById:output_type -> user.GetBlockUserByIdResp + 41, // 71: user.user.DeleteUser:output_type -> user.DeleteUserResp + 53, // [53:72] is the sub-list for method output_type + 34, // [34:53] is the sub-list for method input_type + 34, // [34:34] is the sub-list for extension type_name + 34, // [34:34] is the sub-list for extension extendee + 0, // [0:34] is the sub-list for field type_name +} + +func init() { file_user_user_proto_init() } +func file_user_user_proto_init() { + if File_user_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommonResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUsersReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUsersResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllUserIDReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllUserIDResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountCheckReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountCheckResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserInfoResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetReceiveMessageOptReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetReceiveMessageOptResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReceiveMessageOptReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetReceiveMessageOptResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllConversationMsgOptReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllConversationMsgOptResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResignUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResignUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserByIdReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserByIdResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUsersByNameReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUsersByNameResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AlterUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AlterUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUsersReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUsersResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnBlockUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnBlockUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockUsersReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockUser); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockUsersResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockUserByIdReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockUserByIdResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountCheckResp_SingleUserStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 43, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_user_proto_goTypes, + DependencyIndexes: file_user_user_proto_depIdxs, + MessageInfos: file_user_user_proto_msgTypes, + }.Build() + File_user_user_proto = out.File + file_user_user_proto_rawDesc = nil + file_user_user_proto_goTypes = nil + file_user_user_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for User service +const _ = grpc.SupportPackageIsVersion6 +// UserClient is the client API for User service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type UserClient interface { GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) - UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) - GetAllUsersUid(ctx context.Context, in *GetAllUsersUidReq, opts ...grpc.CallOption) (*GetAllUsersUidResp, error) + GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts ...grpc.CallOption) (*GetAllUserIDResp, error) + SetReceiveMessageOpt(ctx context.Context, in *SetReceiveMessageOptReq, opts ...grpc.CallOption) (*SetReceiveMessageOptResp, error) + GetReceiveMessageOpt(ctx context.Context, in *GetReceiveMessageOptReq, opts ...grpc.CallOption) (*GetReceiveMessageOptResp, error) + GetAllConversationMsgOpt(ctx context.Context, in *GetAllConversationMsgOptReq, opts ...grpc.CallOption) (*GetAllConversationMsgOptResp, error) + AccountCheck(ctx context.Context, in *AccountCheckReq, opts ...grpc.CallOption) (*AccountCheckResp, error) + GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdResp, error) + GetUsersByName(ctx context.Context, in *GetUsersByNameReq, opts ...grpc.CallOption) (*GetUsersByNameResp, error) + ResignUser(ctx context.Context, in *ResignUserReq, opts ...grpc.CallOption) (*ResignUserResp, error) + AlterUser(ctx context.Context, in *AlterUserReq, opts ...grpc.CallOption) (*AlterUserResp, error) + GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersResp, error) + AddUser(ctx context.Context, in *AddUserReq, opts ...grpc.CallOption) (*AddUserResp, error) + BlockUser(ctx context.Context, in *BlockUserReq, opts ...grpc.CallOption) (*BlockUserResp, error) + UnBlockUser(ctx context.Context, in *UnBlockUserReq, opts ...grpc.CallOption) (*UnBlockUserResp, error) + GetBlockUsers(ctx context.Context, in *GetBlockUsersReq, opts ...grpc.CallOption) (*GetBlockUsersResp, error) + GetBlockUserById(ctx context.Context, in *GetBlockUserByIdReq, opts ...grpc.CallOption) (*GetBlockUserByIdResp, error) + DeleteUser(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserResp, error) } type userClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewUserClient(cc *grpc.ClientConn) UserClient { +func NewUserClient(cc grpc.ClientConnInterface) UserClient { return &userClient{cc} } func (c *userClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { out := new(GetUserInfoResp) - err := grpc.Invoke(ctx, "/user.user/getUserInfo", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/user.user/GetUserInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*CommonResp, error) { - out := new(CommonResp) - err := grpc.Invoke(ctx, "/user.user/UpdateUserInfo", in, out, c.cc, opts...) +func (c *userClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) { + out := new(UpdateUserInfoResp) + err := c.cc.Invoke(ctx, "/user.user/UpdateUserInfo", in, out, opts...) if err != nil { return nil, err } @@ -677,29 +3735,240 @@ func (c *userClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, func (c *userClient) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) { out := new(DeleteUsersResp) - err := grpc.Invoke(ctx, "/user.user/DeleteUsers", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/user.user/DeleteUsers", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userClient) GetAllUsersUid(ctx context.Context, in *GetAllUsersUidReq, opts ...grpc.CallOption) (*GetAllUsersUidResp, error) { - out := new(GetAllUsersUidResp) - err := grpc.Invoke(ctx, "/user.user/GetAllUsersUid", in, out, c.cc, opts...) +func (c *userClient) GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts ...grpc.CallOption) (*GetAllUserIDResp, error) { + out := new(GetAllUserIDResp) + err := c.cc.Invoke(ctx, "/user.user/GetAllUserID", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for User service +func (c *userClient) SetReceiveMessageOpt(ctx context.Context, in *SetReceiveMessageOptReq, opts ...grpc.CallOption) (*SetReceiveMessageOptResp, error) { + out := new(SetReceiveMessageOptResp) + err := c.cc.Invoke(ctx, "/user.user/SetReceiveMessageOpt", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} +func (c *userClient) GetReceiveMessageOpt(ctx context.Context, in *GetReceiveMessageOptReq, opts ...grpc.CallOption) (*GetReceiveMessageOptResp, error) { + out := new(GetReceiveMessageOptResp) + err := c.cc.Invoke(ctx, "/user.user/GetReceiveMessageOpt", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetAllConversationMsgOpt(ctx context.Context, in *GetAllConversationMsgOptReq, opts ...grpc.CallOption) (*GetAllConversationMsgOptResp, error) { + out := new(GetAllConversationMsgOptResp) + err := c.cc.Invoke(ctx, "/user.user/GetAllConversationMsgOpt", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) AccountCheck(ctx context.Context, in *AccountCheckReq, opts ...grpc.CallOption) (*AccountCheckResp, error) { + out := new(AccountCheckResp) + err := c.cc.Invoke(ctx, "/user.user/AccountCheck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdResp, error) { + out := new(GetUserByIdResp) + err := c.cc.Invoke(ctx, "/user.user/GetUserById", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUsersByName(ctx context.Context, in *GetUsersByNameReq, opts ...grpc.CallOption) (*GetUsersByNameResp, error) { + out := new(GetUsersByNameResp) + err := c.cc.Invoke(ctx, "/user.user/GetUsersByName", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) ResignUser(ctx context.Context, in *ResignUserReq, opts ...grpc.CallOption) (*ResignUserResp, error) { + out := new(ResignUserResp) + err := c.cc.Invoke(ctx, "/user.user/ResignUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) AlterUser(ctx context.Context, in *AlterUserReq, opts ...grpc.CallOption) (*AlterUserResp, error) { + out := new(AlterUserResp) + err := c.cc.Invoke(ctx, "/user.user/AlterUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersResp, error) { + out := new(GetUsersResp) + err := c.cc.Invoke(ctx, "/user.user/GetUsers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) AddUser(ctx context.Context, in *AddUserReq, opts ...grpc.CallOption) (*AddUserResp, error) { + out := new(AddUserResp) + err := c.cc.Invoke(ctx, "/user.user/AddUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) BlockUser(ctx context.Context, in *BlockUserReq, opts ...grpc.CallOption) (*BlockUserResp, error) { + out := new(BlockUserResp) + err := c.cc.Invoke(ctx, "/user.user/BlockUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) UnBlockUser(ctx context.Context, in *UnBlockUserReq, opts ...grpc.CallOption) (*UnBlockUserResp, error) { + out := new(UnBlockUserResp) + err := c.cc.Invoke(ctx, "/user.user/UnBlockUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetBlockUsers(ctx context.Context, in *GetBlockUsersReq, opts ...grpc.CallOption) (*GetBlockUsersResp, error) { + out := new(GetBlockUsersResp) + err := c.cc.Invoke(ctx, "/user.user/GetBlockUsers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetBlockUserById(ctx context.Context, in *GetBlockUserByIdReq, opts ...grpc.CallOption) (*GetBlockUserByIdResp, error) { + out := new(GetBlockUserByIdResp) + err := c.cc.Invoke(ctx, "/user.user/GetBlockUserById", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) DeleteUser(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserResp, error) { + out := new(DeleteUserResp) + err := c.cc.Invoke(ctx, "/user.user/DeleteUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServer is the server API for User service. type UserServer interface { GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) - UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*CommonResp, error) + UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) DeleteUsers(context.Context, *DeleteUsersReq) (*DeleteUsersResp, error) - GetAllUsersUid(context.Context, *GetAllUsersUidReq) (*GetAllUsersUidResp, error) + GetAllUserID(context.Context, *GetAllUserIDReq) (*GetAllUserIDResp, error) + SetReceiveMessageOpt(context.Context, *SetReceiveMessageOptReq) (*SetReceiveMessageOptResp, error) + GetReceiveMessageOpt(context.Context, *GetReceiveMessageOptReq) (*GetReceiveMessageOptResp, error) + GetAllConversationMsgOpt(context.Context, *GetAllConversationMsgOptReq) (*GetAllConversationMsgOptResp, error) + AccountCheck(context.Context, *AccountCheckReq) (*AccountCheckResp, error) + GetUserById(context.Context, *GetUserByIdReq) (*GetUserByIdResp, error) + GetUsersByName(context.Context, *GetUsersByNameReq) (*GetUsersByNameResp, error) + ResignUser(context.Context, *ResignUserReq) (*ResignUserResp, error) + AlterUser(context.Context, *AlterUserReq) (*AlterUserResp, error) + GetUsers(context.Context, *GetUsersReq) (*GetUsersResp, error) + AddUser(context.Context, *AddUserReq) (*AddUserResp, error) + BlockUser(context.Context, *BlockUserReq) (*BlockUserResp, error) + UnBlockUser(context.Context, *UnBlockUserReq) (*UnBlockUserResp, error) + GetBlockUsers(context.Context, *GetBlockUsersReq) (*GetBlockUsersResp, error) + GetBlockUserById(context.Context, *GetBlockUserByIdReq) (*GetBlockUserByIdResp, error) + DeleteUser(context.Context, *DeleteUserReq) (*DeleteUserResp, error) +} + +// UnimplementedUserServer can be embedded to have forward compatible implementations. +type UnimplementedUserServer struct { +} + +func (*UnimplementedUserServer) GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented") +} +func (*UnimplementedUserServer) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented") +} +func (*UnimplementedUserServer) DeleteUsers(context.Context, *DeleteUsersReq) (*DeleteUsersResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUsers not implemented") +} +func (*UnimplementedUserServer) GetAllUserID(context.Context, *GetAllUserIDReq) (*GetAllUserIDResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllUserID not implemented") +} +func (*UnimplementedUserServer) SetReceiveMessageOpt(context.Context, *SetReceiveMessageOptReq) (*SetReceiveMessageOptResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetReceiveMessageOpt not implemented") +} +func (*UnimplementedUserServer) GetReceiveMessageOpt(context.Context, *GetReceiveMessageOptReq) (*GetReceiveMessageOptResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetReceiveMessageOpt not implemented") +} +func (*UnimplementedUserServer) GetAllConversationMsgOpt(context.Context, *GetAllConversationMsgOptReq) (*GetAllConversationMsgOptResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllConversationMsgOpt not implemented") +} +func (*UnimplementedUserServer) AccountCheck(context.Context, *AccountCheckReq) (*AccountCheckResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountCheck not implemented") +} +func (*UnimplementedUserServer) GetUserById(context.Context, *GetUserByIdReq) (*GetUserByIdResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserById not implemented") +} +func (*UnimplementedUserServer) GetUsersByName(context.Context, *GetUsersByNameReq) (*GetUsersByNameResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUsersByName not implemented") +} +func (*UnimplementedUserServer) ResignUser(context.Context, *ResignUserReq) (*ResignUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResignUser not implemented") +} +func (*UnimplementedUserServer) AlterUser(context.Context, *AlterUserReq) (*AlterUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AlterUser not implemented") +} +func (*UnimplementedUserServer) GetUsers(context.Context, *GetUsersReq) (*GetUsersResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUsers not implemented") +} +func (*UnimplementedUserServer) AddUser(context.Context, *AddUserReq) (*AddUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddUser not implemented") +} +func (*UnimplementedUserServer) BlockUser(context.Context, *BlockUserReq) (*BlockUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockUser not implemented") +} +func (*UnimplementedUserServer) UnBlockUser(context.Context, *UnBlockUserReq) (*UnBlockUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnBlockUser not implemented") +} +func (*UnimplementedUserServer) GetBlockUsers(context.Context, *GetBlockUsersReq) (*GetBlockUsersResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockUsers not implemented") +} +func (*UnimplementedUserServer) GetBlockUserById(context.Context, *GetBlockUserByIdReq) (*GetBlockUserByIdResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockUserById not implemented") +} +func (*UnimplementedUserServer) DeleteUser(context.Context, *DeleteUserReq) (*DeleteUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") } func RegisterUserServer(s *grpc.Server, srv UserServer) { @@ -760,20 +4029,290 @@ func _User_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _User_GetAllUsersUid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAllUsersUidReq) +func _User_GetAllUserID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllUserIDReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserServer).GetAllUsersUid(ctx, in) + return srv.(UserServer).GetAllUserID(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/user.user/GetAllUsersUid", + FullMethod: "/user.user/GetAllUserID", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServer).GetAllUsersUid(ctx, req.(*GetAllUsersUidReq)) + return srv.(UserServer).GetAllUserID(ctx, req.(*GetAllUserIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_SetReceiveMessageOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetReceiveMessageOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).SetReceiveMessageOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/SetReceiveMessageOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).SetReceiveMessageOpt(ctx, req.(*SetReceiveMessageOptReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetReceiveMessageOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReceiveMessageOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetReceiveMessageOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetReceiveMessageOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetReceiveMessageOpt(ctx, req.(*GetReceiveMessageOptReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetAllConversationMsgOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllConversationMsgOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetAllConversationMsgOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetAllConversationMsgOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetAllConversationMsgOpt(ctx, req.(*GetAllConversationMsgOptReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_AccountCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountCheckReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).AccountCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/AccountCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).AccountCheck(ctx, req.(*AccountCheckReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserByIdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUserById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetUserById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUserById(ctx, req.(*GetUserByIdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUsersByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUsersByNameReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUsersByName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetUsersByName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUsersByName(ctx, req.(*GetUsersByNameReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_ResignUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResignUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).ResignUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/ResignUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).ResignUser(ctx, req.(*ResignUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_AlterUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AlterUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).AlterUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/AlterUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).AlterUser(ctx, req.(*AlterUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUsers(ctx, req.(*GetUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_AddUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).AddUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/AddUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).AddUser(ctx, req.(*AddUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_BlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).BlockUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/BlockUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).BlockUser(ctx, req.(*BlockUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_UnBlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnBlockUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).UnBlockUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/UnBlockUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).UnBlockUser(ctx, req.(*UnBlockUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetBlockUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlockUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetBlockUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetBlockUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetBlockUsers(ctx, req.(*GetBlockUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetBlockUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlockUserByIdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetBlockUserById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetBlockUserById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetBlockUserById(ctx, req.(*GetBlockUserByIdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/DeleteUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).DeleteUser(ctx, req.(*DeleteUserReq)) } return interceptor(ctx, in, info, handler) } @@ -783,7 +4322,7 @@ var _User_serviceDesc = grpc.ServiceDesc{ HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "getUserInfo", + MethodName: "GetUserInfo", Handler: _User_GetUserInfo_Handler, }, { @@ -795,52 +4334,70 @@ var _User_serviceDesc = grpc.ServiceDesc{ Handler: _User_DeleteUsers_Handler, }, { - MethodName: "GetAllUsersUid", - Handler: _User_GetAllUsersUid_Handler, + MethodName: "GetAllUserID", + Handler: _User_GetAllUserID_Handler, + }, + { + MethodName: "SetReceiveMessageOpt", + Handler: _User_SetReceiveMessageOpt_Handler, + }, + { + MethodName: "GetReceiveMessageOpt", + Handler: _User_GetReceiveMessageOpt_Handler, + }, + { + MethodName: "GetAllConversationMsgOpt", + Handler: _User_GetAllConversationMsgOpt_Handler, + }, + { + MethodName: "AccountCheck", + Handler: _User_AccountCheck_Handler, + }, + { + MethodName: "GetUserById", + Handler: _User_GetUserById_Handler, + }, + { + MethodName: "GetUsersByName", + Handler: _User_GetUsersByName_Handler, + }, + { + MethodName: "ResignUser", + Handler: _User_ResignUser_Handler, + }, + { + MethodName: "AlterUser", + Handler: _User_AlterUser_Handler, + }, + { + MethodName: "GetUsers", + Handler: _User_GetUsers_Handler, + }, + { + MethodName: "AddUser", + Handler: _User_AddUser_Handler, + }, + { + MethodName: "BlockUser", + Handler: _User_BlockUser_Handler, + }, + { + MethodName: "UnBlockUser", + Handler: _User_UnBlockUser_Handler, + }, + { + MethodName: "GetBlockUsers", + Handler: _User_GetBlockUsers_Handler, + }, + { + MethodName: "GetBlockUserById", + Handler: _User_GetBlockUserById_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _User_DeleteUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/user.proto", } - -func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_9e1dacb346b997d7) } - -var fileDescriptor_user_9e1dacb346b997d7 = []byte{ - // 562 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x95, 0xed, 0x24, 0x8d, 0x27, 0x6a, 0x92, 0xae, 0x0a, 0xac, 0x22, 0x84, 0x22, 0x8b, 0x43, - 0x4e, 0x01, 0x85, 0x1b, 0x3d, 0x41, 0x22, 0xaa, 0x88, 0xa2, 0x4a, 0x96, 0x7c, 0xe1, 0x84, 0xd3, - 0x9d, 0xa6, 0x2b, 0x1c, 0xaf, 0xb1, 0x37, 0x52, 0x8f, 0xfc, 0x24, 0xfe, 0x1a, 0xff, 0x00, 0xed, - 0x38, 0x4e, 0xfc, 0x55, 0x0e, 0x70, 0xb1, 0x76, 0xde, 0xae, 0xdf, 0xdb, 0x37, 0x33, 0x3b, 0x30, - 0xda, 0x67, 0x98, 0xbe, 0x31, 0x9f, 0x79, 0x92, 0x2a, 0xad, 0x58, 0xc7, 0xac, 0xbd, 0x4f, 0x00, - 0x4b, 0xb5, 0xdb, 0xa9, 0xd8, 0xc7, 0x2c, 0x61, 0x2f, 0xc1, 0xc5, 0x34, 0x55, 0xe9, 0x52, 0x09, - 0xe4, 0xd6, 0xd4, 0x9a, 0x75, 0xfd, 0x13, 0xc0, 0x26, 0xd0, 0xa7, 0xe0, 0x4b, 0xb6, 0xe5, 0xf6, - 0xd4, 0x9a, 0xb9, 0xfe, 0x31, 0xf6, 0x24, 0x8c, 0x56, 0x18, 0xa1, 0xc6, 0x20, 0xc3, 0x34, 0x23, - 0xb2, 0xb7, 0x00, 0x77, 0x47, 0x6a, 0x62, 0x1b, 0x2c, 0xc6, 0x73, 0xba, 0xc1, 0x49, 0xd2, 0x2f, - 0x9d, 0x61, 0xaf, 0xe1, 0xfc, 0x3e, 0x94, 0x11, 0x8a, 0x40, 0x8a, 0x1b, 0x99, 0x69, 0x6e, 0x4f, - 0x9d, 0x99, 0xeb, 0x57, 0x41, 0x2f, 0x86, 0x61, 0x45, 0xea, 0x87, 0xf9, 0x4f, 0xe4, 0x48, 0xf5, - 0xbf, 0x0a, 0xc8, 0x2e, 0xa1, 0xab, 0xd5, 0x77, 0x8c, 0xb9, 0x43, 0x77, 0xcf, 0x03, 0x36, 0x85, - 0xc1, 0x6d, 0x82, 0x69, 0xa8, 0xa5, 0x8a, 0xd7, 0x2b, 0xde, 0xa1, 0xbd, 0x32, 0xe4, 0x7d, 0x86, - 0x8b, 0x6b, 0xd4, 0x1f, 0xa2, 0x88, 0xf4, 0x02, 0x29, 0x8c, 0xe4, 0x91, 0xcc, 0xae, 0x91, 0xa9, - 0x12, 0x59, 0x2e, 0x54, 0x86, 0xbc, 0x6f, 0xc0, 0xea, 0x64, 0xff, 0x94, 0x2a, 0x0e, 0x67, 0xfb, - 0x8a, 0xd9, 0x22, 0xf4, 0x1e, 0x60, 0x78, 0x8d, 0xda, 0xd0, 0xaf, 0xe3, 0x7b, 0x65, 0xee, 0xfa, - 0x0a, 0xc0, 0x50, 0xad, 0x57, 0x74, 0xdc, 0xa2, 0xe3, 0x25, 0xe4, 0x69, 0x2f, 0xb7, 0x4d, 0x2f, - 0xe5, 0xc4, 0x28, 0x18, 0x55, 0x94, 0xfe, 0xa7, 0x81, 0x98, 0x07, 0x9d, 0x55, 0xa8, 0x43, 0xee, - 0x4c, 0x9d, 0xd9, 0x60, 0x31, 0xcc, 0xcd, 0x1f, 0xb9, 0x69, 0xcf, 0xfb, 0x65, 0x41, 0xbf, 0x80, - 0xd8, 0x18, 0x9c, 0xbd, 0x14, 0x24, 0xe2, 0xfa, 0x66, 0xc9, 0x18, 0x74, 0xe2, 0x70, 0x87, 0x07, - 0x6a, 0x5a, 0x1b, 0x4c, 0xde, 0xa9, 0xa2, 0xe6, 0xb4, 0x66, 0xcf, 0xa1, 0xb7, 0xc5, 0x58, 0x60, - 0x4a, 0xd5, 0xee, 0xfa, 0x87, 0xc8, 0xe0, 0x3b, 0xb5, 0x91, 0x11, 0xf2, 0x2e, 0x9d, 0x3e, 0x44, - 0x26, 0x3f, 0x1b, 0x99, 0xea, 0x07, 0xde, 0xcb, 0xf3, 0x43, 0x81, 0x41, 0x71, 0x17, 0xca, 0x88, - 0x9f, 0xe5, 0x28, 0x05, 0x6c, 0x08, 0x36, 0x3e, 0xf2, 0x3e, 0x41, 0x36, 0x3e, 0x7a, 0x4b, 0x70, - 0x6f, 0xd4, 0x56, 0xed, 0xb5, 0x29, 0x44, 0x2d, 0xa5, 0x56, 0x23, 0xa5, 0xed, 0xa5, 0xf0, 0x7e, - 0x5b, 0x70, 0x11, 0x24, 0x22, 0xcc, 0x5b, 0xbe, 0x28, 0x6b, 0x61, 0xcd, 0x2a, 0x59, 0x6b, 0x4b, - 0xc1, 0xc9, 0xae, 0xf3, 0x84, 0xdd, 0x4e, 0xbb, 0xdd, 0x6e, 0xab, 0xdd, 0x5e, 0xd3, 0xee, 0x59, - 0x61, 0xf7, 0x74, 0xff, 0xfe, 0x5f, 0x5a, 0xc9, 0x6d, 0xfa, 0x1e, 0x83, 0x13, 0x48, 0xc1, 0x21, - 0x2f, 0x66, 0x20, 0xc5, 0xe2, 0xa7, 0x0d, 0x34, 0xa1, 0xd8, 0x7b, 0x18, 0x6c, 0x4f, 0x5d, 0xc6, - 0x2e, 0xf3, 0xce, 0xa8, 0xb6, 0xf8, 0xe4, 0x59, 0x0b, 0x9a, 0x25, 0xec, 0x0a, 0x86, 0xd5, 0xbc, - 0xb1, 0x17, 0x87, 0xc6, 0xaa, 0x67, 0x73, 0xd2, 0x78, 0x6e, 0x46, 0xb8, 0x34, 0x67, 0x0a, 0xe1, - 0xea, 0xe8, 0x29, 0x84, 0xeb, 0xb3, 0x6f, 0x49, 0x8f, 0xb0, 0xf4, 0xcc, 0x0b, 0xe1, 0xc6, 0x24, - 0x99, 0xf0, 0xf6, 0x8d, 0x2c, 0xf9, 0x78, 0xfe, 0x75, 0x30, 0xa7, 0x89, 0x7d, 0x65, 0x3e, 0x9b, - 0x1e, 0xcd, 0xed, 0x77, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, 0xbd, 0x59, 0x5b, 0xca, 0x05, - 0x00, 0x00, -} diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index e1d38fec6..298b8da84 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -1,73 +1,268 @@ syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; option go_package = "./user;user"; package user; message CommonResp{ - int32 errorCode = 1; - string errorMsg = 2; -} -message DeleteUsersResp{ - CommonResp commonResp = 1; - repeated string failedUidList = 2; + int32 errCode = 1; + string errMsg = 2; } + message DeleteUsersReq{ - repeated string deleteUidList = 2; - string token = 3; + repeated string DeleteUserIDList = 2; + string OpUserID = 3; string OperationID = 4; } -message GetAllUsersUidReq{ - string token = 2; - string operationID = 3; + +message DeleteUsersResp{ + CommonResp CommonResp = 1; + repeated string FailedUserIDList = 2; +} + + +message GetAllUserIDReq{ + string opUserID = 1; + string operationID = 2; +} +message GetAllUserIDResp{ + CommonResp CommonResp = 1; + repeated string UserIDList = 2; +} + + +message AccountCheckReq{ + repeated string CheckUserIDList = 1; + string OpUserID = 2; + string OperationID = 3; } -message GetAllUsersUidResp{ +message AccountCheckResp{ CommonResp commonResp = 1; - repeated string uidList = 2; - + message SingleUserStatus { + string userID = 1; + string accountStatus = 2; + } + repeated SingleUserStatus ResultList = 2; } + + message GetUserInfoReq{ repeated string userIDList = 1; - string token = 2; + string OpUserID = 2; string OperationID = 3; } message GetUserInfoResp{ - int32 errorCode = 1; - string errorMsg = 2; - repeated UserInfo Data = 3; -} -message UserInfo{ - string uid = 1; - string name = 2; - string icon = 3; - int32 gender = 4; - string mobile = 5; - string birth = 6; - string email = 7; - string ex = 8; + CommonResp commonResp = 1; + repeated server_api_params.UserInfo UserInfoList = 3; } -message LogoutReq{ - string OperationID = 1; - string token = 2; -} message UpdateUserInfoReq{ - string icon = 1; - string name = 2; - int32 gender = 3; - string mobile = 4; - string birth = 5; - string email = 6; - string ex = 7; - string token = 8; - string OperationID = 9; - string Uid = 10; + server_api_params.UserInfo UserInfo = 1; + string OpUserID = 2; + string operationID = 3; +} +message UpdateUserInfoResp{ + CommonResp commonResp = 1; +} + + +message SetReceiveMessageOptReq{ + string FromUserID = 1; + int32 opt = 2; + repeated string conversationIDList = 3; + string operationID = 4; + string OpUserID = 5; +} +message OptResult{ + string conversationID = 1; + int32 result = 2; //-1: failed; 0:default; 1: not receive ; 2: not jpush +} +message SetReceiveMessageOptResp{ + CommonResp commonResp = 1; + repeated OptResult conversationOptResultList = 2; +} + + +message GetReceiveMessageOptReq{ + string FromUserID = 1; + repeated string conversationIDList = 2; + string operationID = 3; + string OpUserID = 4; +} +message GetReceiveMessageOptResp{ + CommonResp commonResp = 1; + repeated OptResult conversationOptResultList = 3; +} + + +message GetAllConversationMsgOptReq{ + string FromUserID = 1; + string operationID = 2; + string OpUserID = 3; +} +message GetAllConversationMsgOptResp{ + CommonResp commonResp = 1; + repeated OptResult conversationOptResultList = 3; +} + +message ResignUserReq{ + string UserId = 1; + string OperationID = 2; +} + +message ResignUserResp{ + CommonResp commonResp = 1; +} + +message GetUserByIdReq{ + string UserId = 1; + string OperationID = 2; +} + +message User{ + string ProfilePhoto = 1; + string Nickname = 2; + string UserId = 3; + string CreateTime = 4; + bool IsBlock = 5; +} + +message GetUserByIdResp{ + CommonResp CommonResp = 1; + User user = 2; +} + +message GetUsersByNameReq { + string UserName = 1; + server_api_params.RequestPagination Pagination =2; + string OperationID = 3; +} + +message GetUsersByNameResp { + repeated User users = 1; + server_api_params.ResponsePagination Pagination = 2; + int32 UserNums = 3; +} + +message AlterUserReq{ + string UserId = 1; + string OperationID = 2; + int64 PhoneNumber = 3; + string Nickname = 4; + string Email = 5; + string OpUserId = 6; +} + +message AlterUserResp{ + CommonResp CommonResp = 1; +} + +message GetUsersReq { + string OperationID = 1; + server_api_params.RequestPagination Pagination = 2; + string UserName = 3; +} + +message GetUsersResp{ + CommonResp CommonResp = 1; + repeated User user = 2; + server_api_params.ResponsePagination Pagination = 3; + int32 UserNums = 4; +} + +message AddUserReq{ + string OperationID = 1; + string PhoneNumber = 2; + string UserId = 3; + string name = 4; + string OpUserId = 5; +} + +message AddUserResp{ + CommonResp CommonResp = 1; +} + + +message BlockUserReq{ + string UserId = 1; + string EndDisableTime = 2; + string OperationID = 3; + string OpUserId = 4; +} + +message BlockUserResp{ + CommonResp CommonResp = 1; +} + +message UnBlockUserReq{ + string UserId = 1; + string OperationID = 2; + string OpUserId = 3; +} + +message UnBlockUserResp{ + CommonResp CommonResp = 1; +} + +message GetBlockUsersReq{ + server_api_params.RequestPagination Pagination =1; + string OperationID = 2; + int32 BlockUserNum = 3; +} + +message BlockUser { + User User = 1; + string BeginDisableTime = 2; + string EndDisableTime = 3; +} + +message GetBlockUsersResp{ + CommonResp CommonResp = 1; + repeated BlockUser BlockUsers = 2; + server_api_params.ResponsePagination Pagination = 3; + int32 UserNums = 4; +} + +message GetBlockUserByIdReq { + string User_id = 1; + string OperationID = 2; +} + +message GetBlockUserByIdResp { + BlockUser BlockUser = 2; +} + +message DeleteUserReq { + string User_id = 1; + string OperationID = 2; + string OpUserId = 3; +} + +message DeleteUserResp { + } service user { - rpc getUserInfo(GetUserInfoReq) returns(GetUserInfoResp); - rpc UpdateUserInfo(UpdateUserInfoReq) returns(CommonResp); + rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp); + rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp); rpc DeleteUsers(DeleteUsersReq)returns(DeleteUsersResp); - rpc GetAllUsersUid(GetAllUsersUidReq)returns(GetAllUsersUidResp); + rpc GetAllUserID(GetAllUserIDReq)returns(GetAllUserIDResp); + rpc SetReceiveMessageOpt(SetReceiveMessageOptReq)returns(SetReceiveMessageOptResp); + rpc GetReceiveMessageOpt(GetReceiveMessageOptReq)returns(GetReceiveMessageOptResp); + rpc GetAllConversationMsgOpt(GetAllConversationMsgOptReq)returns(GetAllConversationMsgOptResp); + rpc AccountCheck(AccountCheckReq)returns(AccountCheckResp); + + rpc GetUserById(GetUserByIdReq) returns (GetUserByIdResp); + rpc GetUsersByName(GetUsersByNameReq) returns (GetUsersByNameResp); + rpc ResignUser(ResignUserReq) returns (ResignUserResp); + rpc AlterUser(AlterUserReq) returns (AlterUserResp); + rpc GetUsers(GetUsersReq) returns (GetUsersResp); + rpc AddUser(AddUserReq) returns (AddUserResp); + rpc BlockUser(BlockUserReq) returns (BlockUserResp); + rpc UnBlockUser(UnBlockUserReq) returns (UnBlockUserResp); + rpc GetBlockUsers(GetBlockUsersReq) returns (GetBlockUsersResp); + rpc GetBlockUserById(GetBlockUserByIdReq) returns (GetBlockUserByIdResp); + rpc DeleteUser(DeleteUserReq) returns (DeleteUserResp); } diff --git a/pkg/statistics/statistics.go b/pkg/statistics/statistics.go new file mode 100644 index 000000000..bea4479bd --- /dev/null +++ b/pkg/statistics/statistics.go @@ -0,0 +1,32 @@ +package statistics + +import ( + "Open_IM/pkg/common/log" + "time" +) + +type Statistics struct { + Count *uint64 + ModuleName string + PrintArgs string + SleepTime int +} + +func (s *Statistics) output() { + t := time.NewTicker(time.Duration(s.SleepTime) * time.Second) + defer t.Stop() + var sum uint64 + for { + sum = *s.Count + select { + case <-t.C: + } + log.NewWarn("", " system stat ", s.ModuleName, s.PrintArgs, *s.Count-sum, "total:", *s.Count) + } +} + +func NewStatistics(count *uint64, moduleName, printArgs string, sleepTime int) *Statistics { + p := &Statistics{Count: count, ModuleName: moduleName, SleepTime: sleepTime, PrintArgs: printArgs} + go p.output() + return p +} diff --git a/pkg/utils/get_server_ip.go b/pkg/utils/get_server_ip.go index b7f6076c2..239c75a19 100644 --- a/pkg/utils/get_server_ip.go +++ b/pkg/utils/get_server_ip.go @@ -17,7 +17,7 @@ func init() { // see https://gist.github.com/jniltinho/9787946#gistcomment-3019898 conn, err := net.Dial("udp", "8.8.8.8:80") if err != nil { - panic(err) + panic(err.Error()) } defer conn.Close() diff --git a/pkg/utils/jwt_token.go b/pkg/utils/jwt_token.go deleted file mode 100644 index fd6a69ea0..000000000 --- a/pkg/utils/jwt_token.go +++ /dev/null @@ -1,153 +0,0 @@ -package utils - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db" - "errors" - "github.com/golang-jwt/jwt/v4" - "time" -) - -var ( - TokenExpired = errors.New("token is timed out, please log in again") - TokenInvalid = errors.New("token has been invalidated") - TokenNotValidYet = errors.New("token not active yet") - TokenMalformed = errors.New("that's not even a token") - TokenUnknown = errors.New("couldn't handle this token") -) - -type Claims struct { - UID string - Platform string //login platform - jwt.RegisteredClaims -} - -func BuildClaims(uid, platform string, ttl int64) Claims { - now := time.Now() - return Claims{ - UID: uid, - Platform: platform, - RegisteredClaims: jwt.RegisteredClaims{ - ExpiresAt: jwt.NewNumericDate(now.Add(time.Duration(ttl*24) * time.Hour)), //Expiration time - IssuedAt: jwt.NewNumericDate(now), //Issuing time - NotBefore: jwt.NewNumericDate(now), //Begin Effective time - }} -} - -func CreateToken(userID string, platform int32) (string, int64, error) { - claims := BuildClaims(userID, PlatformIDToName(platform), config.Config.TokenPolicy.AccessExpire) - token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) - tokenString, err := token.SignedString([]byte(config.Config.TokenPolicy.AccessSecret)) - - return tokenString, claims.ExpiresAt.Time.Unix(), err -} - -func secret() jwt.Keyfunc { - return func(token *jwt.Token) (interface{}, error) { - return []byte(config.Config.TokenPolicy.AccessSecret), nil - } -} - -func getClaimFromToken(tokensString string) (*Claims, error) { - token, err := jwt.ParseWithClaims(tokensString, &Claims{}, secret()) - if err != nil { - if ve, ok := err.(*jwt.ValidationError); ok { - if ve.Errors&jwt.ValidationErrorMalformed != 0 { - return nil, TokenMalformed - } else if ve.Errors&jwt.ValidationErrorExpired != 0 { - return nil, TokenExpired - } else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 { - return nil, TokenNotValidYet - } else { - return nil, TokenUnknown - } - } - } - if claims, ok := token.Claims.(*Claims); ok && token.Valid { - return claims, nil - } - return nil, err -} - -func ParseToken(tokensString string) (claims *Claims, err error) { - claims, err = getClaimFromToken(tokensString) - - if err != nil { - return nil, err - } - - // 1.check userid and platform class 0 not exists and 1 exists - existsInterface, err := db.DB.ExistsUserIDAndPlatform(claims.UID, Platform2class[claims.Platform]) - if err != nil { - return nil, err - } - exists := existsInterface.(int64) - //get config multi login policy - if config.Config.MultiLoginPolicy.OnlyOneTerminalAccess { - //OnlyOneTerminalAccess policy need to check all terminal - //When only one end is allowed to log in, there is a situation that needs to be paid attention to. After PC login, - //mobile login should check two platform times. One of them is less than the redis storage time, which is the invalid token. - platform := "PC" - if Platform2class[claims.Platform] == "PC" { - platform = "Mobile" - } - - existsInterface, err = db.DB.ExistsUserIDAndPlatform(claims.UID, platform) - if err != nil { - return nil, err - } - - exists = existsInterface.(int64) - if exists == 1 { - res, err := MakeTheTokenInvalid(claims, platform) - if err != nil { - return nil, err - } - if res { - return nil, TokenInvalid - } - } - } - // config.Config.MultiLoginPolicy.MobileAndPCTerminalAccessButOtherTerminalKickEachOther == true - // or PC/Mobile validate success - // final check - if exists == 1 { - res, err := MakeTheTokenInvalid(claims, Platform2class[claims.Platform]) - if err != nil { - return nil, err - } - if res { - return nil, TokenInvalid - } - } - return claims, nil -} - -func MakeTheTokenInvalid(currentClaims *Claims, platformClass string) (bool, error) { - storedRedisTokenInterface, err := db.DB.GetPlatformToken(currentClaims.UID, platformClass) - if err != nil { - return false, err - } - storedRedisPlatformClaims, err := ParseRedisInterfaceToken(storedRedisTokenInterface) - if err != nil { - return false, err - } - //if issue time less than redis token then make this token invalid - if currentClaims.IssuedAt.Time.Unix() < storedRedisPlatformClaims.IssuedAt.Time.Unix() { - return true, TokenInvalid - } - return false, nil -} - -func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) { - return getClaimFromToken(string(redisToken.([]uint8))) -} - -//Validation token, false means failure, true means successful verification -func VerifyToken(token, uid string) bool { - claims, err := ParseToken(token) - if err != nil || claims.UID != uid { - return false - } - return true -} diff --git a/pkg/utils/map.go b/pkg/utils/map.go index 2807805db..fc24cc87d 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -111,13 +111,19 @@ func MapIntToJsonString(param map[string]int32) string { dataString := string(dataType) return dataString } -func JsonStringToMap(str string) (tempMap map[string]interface{}) { +func JsonStringToMap(str string) (tempMap map[string]int32) { _ = json.Unmarshal([]byte(str), &tempMap) return tempMap } -func GetSwitchFromOptions(Options map[string]interface{}, key string) (result bool) { - if flag, ok := Options[key]; !ok || flag == 1 { +func GetSwitchFromOptions(Options map[string]bool, key string) (result bool) { + if flag, ok := Options[key]; !ok || flag { return true } return false } +func SetSwitchFromOptions(options map[string]bool, key string, value bool) { + if options == nil { + options = make(map[string]bool, 5) + } + options[key] = value +} diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go index 39c797859..3265d2dc4 100644 --- a/pkg/utils/strings.go +++ b/pkg/utils/strings.go @@ -7,6 +7,7 @@ package utils import ( + "Open_IM/pkg/common/constant" "encoding/json" "math/rand" "strconv" @@ -24,10 +25,12 @@ func StringToInt64(i string) int64 { j, _ := strconv.ParseInt(i, 10, 64) return j } +func Int32ToString(i int32) string { + return strconv.FormatInt(int64(i), 10) +} //judge a string whether in the string list func IsContain(target string, List []string) bool { - for _, element := range List { if target == element { @@ -35,7 +38,6 @@ func IsContain(target string, List []string) bool { } } return false - } func InterfaceArrayToStringArray(data []interface{}) (i []string) { @@ -50,6 +52,11 @@ func StructToJsonString(param interface{}) string { return dataString } +func StructToJsonBytes(param interface{}) []byte { + dataType, _ := json.Marshal(param) + return dataType +} + //The incoming parameter must be a pointer func JsonStringToStruct(s string, args interface{}) error { err := json.Unmarshal([]byte(s), args) @@ -60,6 +67,15 @@ func GetMsgID(sendID string) string { t := int64ToString(GetCurrentTimestampByNano()) return Md5(t + sendID + int64ToString(rand.Int63n(GetCurrentTimestampByNano()))) } +func GetConversationIDBySessionType(sourceID string, sessionType int) string { + switch sessionType { + case constant.SingleChatType: + return "single_" + sourceID + case constant.GroupChatType: + return "group_" + sourceID + } + return "" +} func int64ToString(i int64) string { return strconv.FormatInt(i, 10) } diff --git a/pkg/utils/time_format.go b/pkg/utils/time_format.go index 3accd0567..c8f6e21fa 100644 --- a/pkg/utils/time_format.go +++ b/pkg/utils/time_format.go @@ -30,6 +30,9 @@ func UnixSecondToTime(second int64) time.Time { func UnixNanoSecondToTime(nanoSecond int64) time.Time { return time.Unix(0, nanoSecond) } +func UnixMillSecondToTime(millSecond int64) time.Time { + return time.Unix(0, millSecond*1e6) +} //Get the current timestamp by Nano func GetCurrentTimestampByNano() int64 { @@ -75,3 +78,8 @@ func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64 { tm, _ := time.Parse(timeFormat, timeSrc) return tm.Unix() } + +func TimeStringToTime(timeString string) (time.Time, error) { + t, err := time.Parse("2006-01-02", timeString) + return t, err +} diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go new file mode 100644 index 000000000..440d3a993 --- /dev/null +++ b/pkg/utils/utils.go @@ -0,0 +1,73 @@ +package utils + +import ( + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "runtime" + "strconv" + "strings" +) + +// copy a by b b->a +func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error) { + return copier.Copy(a, b) +} + +func Wrap(err error, message string) error { + return errors.Wrap(err, "==> "+printCallerNameAndLine()+message) +} + +func WithMessage(err error, message string) error { + return errors.WithMessage(err, "==> "+printCallerNameAndLine()+message) +} + +func printCallerNameAndLine() string { + pc, _, line, _ := runtime.Caller(2) + return runtime.FuncForPC(pc).Name() + "()@" + strconv.Itoa(line) + ": " +} + +func GetSelfFuncName() string { + pc, _, _, _ := runtime.Caller(1) + return cleanUpFuncName(runtime.FuncForPC(pc).Name()) +} +func cleanUpFuncName(funcName string) string { + end := strings.LastIndex(funcName, ".") + if end == -1 { + return "" + } + return funcName[end+1:] +} +func Intersect(slice1, slice2 []uint32) []uint32 { + m := make(map[uint32]bool) + n := make([]uint32, 0) + for _, v := range slice1 { + m[v] = true + } + for _, v := range slice2 { + flag, _ := m[v] + if flag { + n = append(n, v) + } + } + return n +} +func Difference(slice1, slice2 []uint32) []uint32 { + m := make(map[uint32]bool) + n := make([]uint32, 0) + inter := Intersect(slice1, slice2) + for _, v := range inter { + m[v] = true + } + for _, v := range slice1 { + if !m[v] { + n = append(n, v) + } + } + + for _, v := range slice2 { + if !m[v] { + n = append(n, v) + } + } + return n +} diff --git a/script/build_images.sh b/script/build_images.sh new file mode 100644 index 000000000..ad37e24e4 --- /dev/null +++ b/script/build_images.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +image=openim/open_im_server:v1.0.5 +rm Open-IM-Server -rf +git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive +cd Open-IM-Server +git checkout tuoyun +cd cmd/Open-IM-SDK-Core/ +git checkout tuoyun +cd ../../ +docker build -t $image . -f deploy.Dockerfile +docker push $image \ No newline at end of file diff --git a/script/check_all.sh b/script/check_all.sh index 0c7313743..d0f48597b 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -4,6 +4,7 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh service_port_name=( + openImCmsApiPort openImApiPort openImUserPort openImFriendPort @@ -15,6 +16,9 @@ service_port_name=( openImWsPort openImSdkWsPort openImDemoPort + openImAdminCmsPort + openImMessageCmsPort + openImStatisticsPort ) switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}') for i in ${service_port_name[*]}; do @@ -48,13 +52,13 @@ else fi -check=$(ps aux | grep -w ./${timer_task_name} | grep -v grep | wc -l) -if [ $check -ge 1 ]; then - echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImMsgTimer"${COLOR_SUFFIX} -else - echo -e ${RED_PREFIX}"openImMsgTimer service does not start normally"${COLOR_SUFFIX} - echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX} - exit -1 -fi +#check=$(ps aux | grep -w ./${timer_task_name} | grep -v grep | wc -l) +#if [ $check -ge 1 ]; then +# echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImMsgTimer"${COLOR_SUFFIX} +#else +# echo -e ${RED_PREFIX}"openImMsgTimer service does not start normally"${COLOR_SUFFIX} +# echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX} +# exit -1 +#fi echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX} diff --git a/script/docker_check_service.sh b/script/docker_check_service.sh index a8e24adab..6236712ba 100644 --- a/script/docker_check_service.sh +++ b/script/docker_check_service.sh @@ -1,19 +1,11 @@ #!/usr/bin/env bash -source ./style_info.cfg - -echo "docker-compose ps..................................." +echo "docker-compose ps..........................." docker-compose ps +echo "check OpenIM, waiting 30s...................." +sleep 30 -echo -e "check OpenIM result............................." -i=1 -t=10 -while [ $i -le $t ] -do - p=`awk 'BEGIN{printf "%.2f%\n",('$i'/'$t')*100}'` - echo -e ${GREEN_PREFIX} "=> $p"${COLOR_SUFFIX} - sleep 5 - let i++ -done - +echo "check OpenIM................................" ./check_all.sh + + diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index f1a1fd859..09f0d162b 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -1,9 +1,26 @@ #!/usr/bin/env bash +#fixme This script is the total startup script +#fixme The full name of the shell script that needs to be started is placed in the need_to_start_server_shell array + +#fixme Put the shell script name here +need_to_start_server_shell=( + start_rpc_service.sh + msg_gateway_start.sh + push_start.sh + msg_transfer_start.sh + sdk_svr_start.sh + timer_start.sh + demo_svr_start.sh +) #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started + sleep 10 -./start_all.sh +for i in ${need_to_start_server_shell[*]}; do + chmod +x $i + ./$i +done sleep 15 diff --git a/script/msg_gateway_start.sh b/script/msg_gateway_start.sh index 1df53cfdd..978cc11fb 100644 --- a/script/msg_gateway_start.sh +++ b/script/msg_gateway_start.sh @@ -3,6 +3,8 @@ source ./style_info.cfg source ./path_info.cfg source ./function.sh +ulimit -n 200000 + list1=$(cat $config_path | grep openImOnlineRelayPort | awk -F '[:]' '{print $NF}') list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') list_to_string $list1 diff --git a/script/path_info.cfg b/script/path_info.cfg index ea9fa76e9..7fe9622b6 100644 --- a/script/path_info.cfg +++ b/script/path_info.cfg @@ -39,11 +39,15 @@ config_path="../config/config.yaml" service_source_root=( #api service file ../cmd/open_im_api/ + ../cmd/open_im_cms_api/ #rpc service file ../cmd/rpc/open_im_user/ ../cmd/rpc/open_im_friend/ ../cmd/rpc/open_im_group/ ../cmd/rpc/open_im_auth/ + ../cmd/rpc/open_im_admin_cms/ + ../cmd/rpc/open_im_message_cms/ + ../cmd/rpc/open_im_statistics/ ${msg_gateway_source_root} ${msg_transfer_source_root} ${msg_source_root} @@ -56,11 +60,15 @@ service_source_root=( service_names=( #api service filename open_im_api + open_im_cms_api #rpc service filename open_im_user open_im_friend open_im_group open_im_auth + open_im_admin_cms + open_im_message_cms + open_im_statistics ${msg_gateway_name} ${msg_transfer_name} ${msg_name} diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index 97c694233..5f47228dc 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -6,13 +6,14 @@ source ./function.sh list1=$(cat $config_path | grep openImApiPort | awk -F '[:]' '{print $NF}') list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') list3=$(cat $config_path | grep openImSdkWsPort | awk -F '[:]' '{print $NF}') +logLevel=$(cat $config_path | grep remainLogLevel | awk -F '[:]' '{print $NF}') list_to_string $list1 api_ports=($ports_array) list_to_string $list2 ws_ports=($ports_array) list_to_string $list3 sdk_ws_ports=($ports_array) - +list_to_string $list4 @@ -26,7 +27,7 @@ fi #Waiting port recycling sleep 1 cd ${sdk_server_binary_root} - nohup ./${sdk_server_name} -openIM_api_port ${api_ports[0]} -openIM_ws_port ${ws_ports[0]} -sdk_ws_port ${sdk_ws_ports[0]} >>../logs/openIM.log 2>&1 & + nohup ./${sdk_server_name} -openIM_api_port ${api_ports[0]} -openIM_ws_port ${ws_ports[0]} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & #Check launched service process sleep 3 diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh index 5b59107d5..2d685f478 100644 --- a/script/start_rpc_service.sh +++ b/script/start_rpc_service.sh @@ -8,11 +8,15 @@ source ./function.sh service_filename=( #api open_im_api + open_im_cms_api #rpc open_im_user open_im_friend open_im_group open_im_auth + open_im_admin_cms + open_im_message_cms + open_im_statistics ${msg_name} ) @@ -20,11 +24,15 @@ service_filename=( service_port_name=( #api port name openImApiPort + openImCmsApiPort #rpc port name openImUserPort openImFriendPort openImGroupPort openImAuthPort + openImAdminCmsPort + openImMessageCmsPort + openImStatisticsPort openImOfflineMessagePort )