diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 61d3e127e..8b3818aa8 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -38,7 +38,8 @@ func main() { // user routing group, which handles user registration and login services userRouterGroup := r.Group("/user") { - userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1 + userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1 + userRouterGroup.POST("/set_global_msg_recv_opt", user.SetGlobalRecvMessageOpt) userRouterGroup.POST("/get_users_info", user.GetUsersInfo) //1 userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1 userRouterGroup.POST("/get_users_online_status", user.GetUsersOnlineStatus) //1 @@ -70,7 +71,7 @@ func main() { { groupRouterGroup.POST("/create_group", group.CreateGroup) //1 groupRouterGroup.POST("/set_group_info", group.SetGroupInfo) //1 - groupRouterGroup.POST("join_group", group.JoinGroup) //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 @@ -82,8 +83,8 @@ func main() { 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 - groupRouterGroup.POST("/dismiss_group", group.DismissGroup) // + groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) + groupRouterGroup.POST("/dismiss_group", group.DismissGroup) // groupRouterGroup.POST("/mute_group_member", group.MuteGroupMember) groupRouterGroup.POST("/cancel_mute_group_member", group.CancelMuteGroupMember) //MuteGroup groupRouterGroup.POST("/mute_group", group.MuteGroup) @@ -91,12 +92,18 @@ func main() { groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname) groupRouterGroup.POST("/set_group_member_info", group.SetGroupMemberInfo) } + superGroupRouterGroup := r.Group("/super_group") + { + superGroupRouterGroup.POST("/get_joined_group_list", group.GetJoinedSuperGroupList) + superGroupRouterGroup.POST("/get_groups_info", group.GetSuperGroupsInfo) + } //certificate authRouterGroup := r.Group("/auth") { authRouterGroup.POST("/user_register", apiAuth.UserRegister) //1 authRouterGroup.POST("/user_token", apiAuth.UserToken) //1 authRouterGroup.POST("/parse_token", apiAuth.ParseToken) //1 + authRouterGroup.POST("/force_logout", apiAuth.ForceLogout) //1 } //Third service thirdGroup := r.Group("/third") @@ -117,6 +124,7 @@ func main() { chatGroup.POST("/send_msg", apiChat.SendMsg) chatGroup.POST("/pull_msg_by_seq", apiChat.PullMsgBySeqList) chatGroup.POST("/del_msg", apiChat.DelMsg) + chatGroup.POST("/clear_msg", apiChat.ClearMsg) } //Manager managementGroup := r.Group("/manager") @@ -127,7 +135,6 @@ func main() { 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") diff --git a/config/config.yaml b/config/config.yaml index fa6934593..923b95591 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -23,7 +23,7 @@ mysql: mongo: dbUri: ""#当dbUri值不为空则直接使用该值 - dbAddress: [ 127.0.0.1:37017 ] #mongo地址 目前仅支持单机,默认即可 + dbAddress: 127.0.0.1:37017 #单机时为mongo地址,使用分片集群时,为mongos地址 默认即可 dbDirect: false dbTimeout: 60 dbDatabase: openIM #mongo db 默认即可 @@ -34,11 +34,12 @@ mongo: dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改 redis: - dbAddress: 127.0.0.1:16379 #redis地址 目前仅支持单机,默认即可 + dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时,填写一个地址即可,使用redis集群时候,填写集群中多个节点地址(主从地址都可以填写,增加容灾能力),默认即可 dbMaxIdle: 128 dbMaxActive: 0 dbIdleTimeout: 120 dbPassWord: openIM #redis密码 建议修改 + enableCluster: false #如果外部redis以集群方式启动,需要打开此开关 kafka: ws2mschat: @@ -47,12 +48,15 @@ kafka: ws2mschatoffline: addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 topic: "ws2ms_chat_offline" + msgtomongo: + addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 + topic: "msg_to_mongo" ms2pschat: addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 topic: "ms2ps_chat" consumergroupid: - msgToMongo: mongo - msgToMongoOffline: mongo_offline + msgToTransfer: mongo + msgToMongo: mongo_ex msgToMySql: mysql msgToPush: push @@ -218,6 +222,7 @@ manager: #app管理员userID和对应的secret 建议修改。 用于管理后台登录,也可以用户管理后台对应的api appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"] secrets: [ "openIM1","openIM2", "openIM333", "openIMAdmin"] + appSysNotificationName: "系统通知" secret: tuoyun # 多端互踢策略 @@ -229,11 +234,12 @@ chatpersistencemysql: true #可靠性存储 reliablestorage: false #消息缓存时间 -msgCacheTimeout: 3600 +msgCacheTimeout: 86400 #群聊已读开启 -groupMessageHasReadReceiptEnable: false +groupMessageHasReadReceiptEnable: true #单聊已读开启 -singleMessageHasReadReceiptEnable: false +singleMessageHasReadReceiptEnable: true + #token config tokenpolicy: accessSecret: "open_im_server" #token生成相关,默认即可 @@ -700,4 +706,4 @@ demo: imAPIURL: http://127.0.0.1:10002 rtc: - signalTimeout: 60 + signalTimeout: 35 diff --git a/docker-compose.yaml b/docker-compose.yaml index 4a419ae1b..52d488f4a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -75,7 +75,7 @@ services: TZ: Asia/Shanghai KAFKA_BROKER_ID: 0 KAFKA_ZOOKEEPER_CONNECT: 127.0.0.1:2181 - KAFKA_CREATE_TOPICS: "ws2ms_chat:2:1,ms2ps_chat:2:1" + KAFKA_CREATE_TOPICS: "ws2ms_chat:8:1,ms2ps_chat:8:1,msg_to_mongo:8:1" KAFKA_ADVERTISED_LISTENERS: INSIDE://127.0.0.1:9092,OUTSIDE://103.116.45.174:9093 KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9093 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT" diff --git a/go.mod b/go.mod index 0fcf1b807..e34d69ab0 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/antonfisher/nested-logrus-formatter v1.3.0 github.com/bwmarrin/snowflake v0.3.0 github.com/fatih/structs v1.1.0 - 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-redis/redis/v8 v8.11.5 @@ -51,3 +50,5 @@ require ( gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) + +replace github.com/Shopify/sarama => github.com/Shopify/sarama v1.29.0 diff --git a/go.sum b/go.sum index 3d828c7c2..ac8ee760f 100644 --- a/go.sum +++ b/go.sum @@ -3,10 +3,10 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= -github.com/Shopify/sarama v1.32.0 h1:P+RUjEaRU0GMMbYexGMDyrMkLhbbBVUVISDywi+IlFU= -github.com/Shopify/sarama v1.32.0/go.mod h1:+EmJJKZWVT/faR9RcOxJerP+LId4iWdQPBGLy1Y1Njs= -github.com/Shopify/toxiproxy/v2 v2.3.0 h1:62YkpiP4bzdhKMH+6uC5E95y608k3zDwdzuBMsnn3uQ= -github.com/Shopify/toxiproxy/v2 v2.3.0/go.mod h1:KvQTtB6RjCJY4zqNJn7C7JDFgsG5uoHYDirfUfpIm0c= +github.com/Shopify/sarama v1.29.0 h1:ARid8o8oieau9XrHI55f/L3EoRAhm9px6sonbD7yuUE= +github.com/Shopify/sarama v1.29.0/go.mod h1:2QpgD79wpdAESqNQMxNc0KYMkycd4slxGdV3TWSVqrU= +github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= +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/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -70,7 +70,6 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 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/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= 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= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -101,13 +100,11 @@ 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.2 h1:SPb1KFFmM+ybpEjPUhCCkZOM5xlovT5UbrMvWnXyBns= -github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -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= 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= @@ -162,8 +159,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS 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.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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= @@ -172,9 +169,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ 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 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -182,7 +178,6 @@ github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= @@ -233,10 +228,10 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 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.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= 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/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= -github.com/klauspost/compress v1.14.4/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= @@ -244,9 +239,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/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= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -310,8 +304,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -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/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= +github.com/pierrec/lz4 v2.6.0+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= @@ -338,12 +332,8 @@ 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 v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -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/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 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.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -376,14 +366,14 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= 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/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= 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/scram v1.1.0 h1:d70R37I0HrDLsafRrMBXyrD4lmQbCHE873t00Vr0gm0= -github.com/xdg-go/scram v1.1.0/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/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= 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.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -416,8 +406,8 @@ golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/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-20220214200702-86341886e292 h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 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= @@ -451,9 +441,10 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R 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-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210427231257-85d9c07bbe3a/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -571,7 +562,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 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= diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go index 59ad579ca..84beaa32b 100644 --- a/internal/api/auth/auth.go +++ b/internal/api/auth/auth.go @@ -36,7 +36,13 @@ func UserRegister(c *gin.Context) { //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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewAuthClient(etcdConn) reply, err := client.UserRegister(context.Background(), req) if err != nil { @@ -84,7 +90,13 @@ func UserToken(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewAuthClient(etcdConn) reply, err := client.UserToken(context.Background(), req) if err != nil { @@ -124,3 +136,46 @@ func ParseToken(c *gin.Context) { log.NewInfo(params.OperationID, "ParseToken return ", resp) c.JSON(http.StatusOK, resp) } + +func ForceLogout(c *gin.Context) { + params := api.ForceLogoutReq{} + if err := c.BindJSON(¶ms); err != nil { + errMsg := " BindJSON failed " + err.Error() + log.NewError("0", errMsg) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": errMsg}) + return + } + + req := &rpc.ForceLogoutReq{} + utils.CopyStructFields(req, ¶ms) + + var ok bool + var errInfo string + ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + log.NewInfo(req.OperationID, "ForceLogout args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewAuthClient(etcdConn) + reply, err := client.ForceLogout(context.Background(), req) + if err != nil { + errMsg := req.OperationID + " UserToken failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + resp := api.ForceLogoutResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(params.OperationID, utils.GetSelfFuncName(), " return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/chat/del_msg.go b/internal/api/chat/del_msg.go index d883f095c..cb13f3dca 100644 --- a/internal/api/chat/del_msg.go +++ b/internal/api/chat/del_msg.go @@ -5,8 +5,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" - pbChat "Open_IM/pkg/proto/chat" + rpc "Open_IM/pkg/proto/chat" pbCommon "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" @@ -29,8 +30,14 @@ func DelMsg(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, &req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) } - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) - msgClient := pbChat.NewChatClient(grpcConn) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID) + if grpcConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + msgClient := rpc.NewChatClient(grpcConn) respPb, err := msgClient.DelMsgList(context.Background(), &reqPb) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) @@ -42,3 +49,47 @@ func DelMsg(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp) c.JSON(http.StatusOK, resp) } + +func ClearMsg(c *gin.Context) { + params := api.CleanUpMsgReq{} + 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.ClearMsgReq{} + utils.CopyStructFields(req, ¶ms) + + var ok bool + var errInfo string + ok, req.OpUserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + " getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewChatClient(etcdConn) + RpcResp, err := client.ClearMsg(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, " CleanUpMsg failed ", err.Error(), req.String(), RpcResp.ErrMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": RpcResp.ErrMsg}) + return + } + + resp := api.CleanUpMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/chat/get_max_min_seq.go b/internal/api/chat/get_max_min_seq.go index 38379d4cc..410a6ffb0 100644 --- a/internal/api/chat/get_max_min_seq.go +++ b/internal/api/chat/get_max_min_seq.go @@ -5,7 +5,8 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" - pbMsg "Open_IM/pkg/proto/chat" + pbChat "Open_IM/pkg/proto/chat" + sdk_ws "Open_IM/pkg/proto/sdk_ws" "context" "github.com/gin-gonic/gin" "net/http" @@ -31,11 +32,18 @@ func GetSeq(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err" + err.Error()}) return } - pbData := pbMsg.GetMaxAndMinSeqReq{} + pbData := sdk_ws.GetMaxAndMinSeqReq{} pbData.UserID = params.SendID pbData.OperationID = params.OperationID - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) - msgClient := pbMsg.NewChatClient(grpcConn) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID) + if grpcConn == nil { + errMsg := pbData.OperationID + " getcdv3.GetConn == nil" + log.NewError(pbData.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) if err != nil { log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error()) diff --git a/internal/api/chat/pull_msg.go b/internal/api/chat/pull_msg.go index 787ae7141..3e1a2314f 100644 --- a/internal/api/chat/pull_msg.go +++ b/internal/api/chat/pull_msg.go @@ -51,7 +51,13 @@ func PullMsgBySeqList(c *gin.Context) { pbData.OperationID = params.OperationID pbData.SeqList = params.SeqList - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID) + if grpcConn == nil { + errMsg := pbData.OperationID + "getcdv3.GetConn == nil" + log.NewError(pbData.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData) if err != nil { diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go index b75cd0ddd..af5bf5d7b 100644 --- a/internal/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -69,9 +69,15 @@ func SendMsg(c *gin.Context) { token := c.Request.Header.Get("token") log.NewInfo(params.OperationID, "api call success to sendMsgReq", params) pbData := newUserSendMsgReq(token, ¶ms) - log.Info("", "", "api SendMsg call start..., [data: %s]", pbData.String()) + log.Info(params.OperationID, "", "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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID) + if etcdConn == nil { + errMsg := params.OperationID + "getcdv3.GetConn == nil" + log.NewError(params.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbChat.NewChatClient(etcdConn) log.Info("", "", "api SendMsg call, api call rpc...") @@ -82,7 +88,7 @@ func SendMsg(c *gin.Context) { 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()) + log.Info(params.OperationID, "", "api SendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) c.JSON(http.StatusOK, gin.H{ "errCode": reply.ErrCode, diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 2e1709847..b60b89ed4 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -32,7 +32,13 @@ func SetConversation(c *gin.Context) { if err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetConversation(context.Background(), &reqPb) if err != nil { @@ -63,7 +69,13 @@ func ModifyConversationField(c *gin.Context) { if err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbConversation.NewConversationClient(etcdConn) respPb, err := client.ModifyConversationField(context.Background(), &reqPb) if err != nil { @@ -92,7 +104,13 @@ func BatchSetConversations(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.BatchSetConversations(context.Background(), &reqPb) if err != nil { @@ -124,7 +142,13 @@ func GetAllConversations(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.GetAllConversations(context.Background(), &reqPb) if err != nil { @@ -156,7 +180,13 @@ func GetConversation(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.GetConversation(context.Background(), &reqPb) if err != nil { @@ -188,7 +218,13 @@ func GetConversations(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.GetConversations(context.Background(), &reqPb) if err != nil { @@ -220,7 +256,13 @@ func SetRecvMsgOpt(c *gin.Context) { if err := utils.CopyStructFields(&reqPb, req); err != nil { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetRecvMsgOpt(context.Background(), &reqPb) if err != nil { diff --git a/internal/api/friend/friend.go b/internal/api/friend/friend.go index 58cf37f7f..e756983a9 100644 --- a/internal/api/friend/friend.go +++ b/internal/api/friend/friend.go @@ -36,7 +36,7 @@ func AddBlack(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.AddBlacklist(context.Background(), req) if err != nil { @@ -69,8 +69,14 @@ func ImportFriend(c *gin.Context) { } 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, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } - 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 { @@ -114,7 +120,13 @@ func AddFriend(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.AddFriend(context.Background(), req) if err != nil { @@ -153,7 +165,14 @@ func AddFriendResponse(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.AddFriendResponse(context.Background(), req) if err != nil { @@ -189,7 +208,13 @@ func DeleteFriend(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.DeleteFriend(context.Background(), req) if err != nil { @@ -225,7 +250,13 @@ func GetBlacklist(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetBlacklist(context.Background(), req) if err != nil { @@ -268,7 +299,13 @@ func SetFriendRemark(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.SetFriendRemark(context.Background(), req) if err != nil { @@ -303,7 +340,14 @@ func RemoveBlack(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.RemoveBlacklist(context.Background(), req) if err != nil { @@ -338,7 +382,13 @@ func IsFriend(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.IsFriend(context.Background(), req) if err != nil { @@ -375,7 +425,13 @@ func GetFriendList(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetFriendList(context.Background(), req) if err != nil { @@ -413,7 +469,13 @@ func GetFriendApplyList(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetFriendApplyList(context.Background(), req) @@ -451,7 +513,13 @@ func GetSelfFriendApplyList(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewFriendClient(etcdConn) RpcResp, err := client.GetSelfApplyList(context.Background(), req) if err != nil { diff --git a/internal/api/group/group.go b/internal/api/group/group.go index 529e7494c..d9b1bf9ff 100644 --- a/internal/api/group/group.go +++ b/internal/api/group/group.go @@ -43,7 +43,13 @@ func KickGroupMember(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.KickGroupMember(context.Background(), req) if err != nil { @@ -88,7 +94,13 @@ func GetGroupMembersInfo(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupMembersInfo(context.Background(), req) @@ -126,7 +138,13 @@ func GetGroupMemberList(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupMemberList(context.Background(), req) @@ -165,7 +183,13 @@ func GetGroupAllMemberList(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupAllMember(context.Background(), req) if err != nil { @@ -202,7 +226,13 @@ func GetJoinedGroupList(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetJoinedGroupList(context.Background(), req) if err != nil { @@ -239,7 +269,13 @@ func InviteUserToGroup(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.InviteUserToGroup(context.Background(), req) if err != nil { @@ -291,7 +327,13 @@ func CreateGroup(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.CreateGroup(context.Background(), req) if err != nil { @@ -328,7 +370,13 @@ func GetRecvGroupApplicationList(c *gin.Context) { //} 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.GetGroupApplicationList(context.Background(), req) if err != nil { @@ -359,7 +407,13 @@ func GetUserReqGroupApplicationList(c *gin.Context) { // 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetUserReqApplicationList(context.Background(), req) if err != nil { @@ -395,7 +449,13 @@ func GetGroupsInfo(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.GetGroupsInfo(context.Background(), req) if err != nil { @@ -433,7 +493,13 @@ func ApplicationGroupResponse(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.GroupApplicationResponse(context.Background(), req) if err != nil { @@ -468,7 +534,13 @@ func JoinGroup(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.JoinGroup(context.Background(), req) @@ -504,7 +576,13 @@ func QuitGroup(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.QuitGroup(context.Background(), req) if err != nil { @@ -540,7 +618,13 @@ func SetGroupInfo(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) RpcResp, err := client.SetGroupInfo(context.Background(), req) if err != nil { @@ -575,7 +659,13 @@ func TransferGroupOwner(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.TransferGroupOwner(context.Background(), req) if err != nil { @@ -611,7 +701,13 @@ func DismissGroup(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.DismissGroup(context.Background(), req) if err != nil { @@ -647,7 +743,13 @@ func MuteGroupMember(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.MuteGroupMember(context.Background(), req) if err != nil { @@ -683,7 +785,13 @@ func CancelMuteGroupMember(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.CancelMuteGroupMember(context.Background(), req) if err != nil { @@ -719,7 +827,13 @@ func MuteGroup(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.MuteGroup(context.Background(), req) if err != nil { @@ -755,7 +869,13 @@ func CancelMuteGroup(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.CancelMuteGroup(context.Background(), req) if err != nil { @@ -793,7 +913,13 @@ func SetGroupMemberNickname(c *gin.Context) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) reply, err := client.SetGroupMemberNickname(context.Background(), req) if err != nil { @@ -846,7 +972,13 @@ func SetGroupMemberInfo(c *gin.Context) { reqPb.RoleLevel = &wrappers.Int32Value{Value: *req.RoleLevel} } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewGroupClient(etcdConn) respPb, err := client.SetGroupMemberInfo(context.Background(), reqPb) if err != nil { diff --git a/internal/api/group/super_group.go b/internal/api/group/super_group.go new file mode 100644 index 000000000..b5c123700 --- /dev/null +++ b/internal/api/group/super_group.go @@ -0,0 +1,88 @@ +package group + +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/group" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func GetJoinedSuperGroupList(c *gin.Context) { + req := api.GetJoinedSuperGroupListReq{} + 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 + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + reqPb := rpc.GetJoinedSuperGroupListReq{OperationID: req.OperationID, OpUserID: opUserID, UserID: req.FromUserID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewGroupClient(etcdConn) + rpcResp, err := client.GetJoinedSuperGroupList(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), reqPb.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + GroupListResp := api.GetJoinedSuperGroupListResp{GetJoinedGroupListResp: api.GetJoinedGroupListResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupList}} + GroupListResp.Data = jsonData.JsonDataList(GroupListResp.GroupInfoList) + log.NewInfo(req.OperationID, "GetJoinedGroupList api return ", GroupListResp) + c.JSON(http.StatusOK, GroupListResp) +} + +func GetSuperGroupsInfo(c *gin.Context) { + req := api.GetSuperGroupsInfoReq{} + 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 + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, opUserID, errInfo := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + reqPb := rpc.GetSuperGroupsInfoReq{OperationID: req.OperationID, OpUserID: opUserID, GroupIDList: req.GroupIDList} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewGroupClient(etcdConn) + rpcResp, err := client.GetSuperGroupsInfo(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), reqPb.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + resp := api.GetSuperGroupsInfoResp{GetGroupInfoResp: api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: rpcResp.CommonResp.ErrCode, ErrMsg: rpcResp.CommonResp.ErrMsg}, GroupInfoList: rpcResp.GroupInfoList}} + resp.Data = jsonData.JsonDataList(resp.GroupInfoList) + log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index 22835fcd0..6c9cd5ece 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -138,7 +138,7 @@ func ManagementSendMsg(c *gin.Context) { log.Error(c.PostForm("operationID"), "data args validate err", err.Error()) return } - log.NewInfo("", data, params) + log.NewInfo(params.OperationID, data, params) token := c.Request.Header.Get("token") claims, err := token_verify.ParseToken(token, params.OperationID) if err != nil { @@ -169,12 +169,18 @@ func ManagementSendMsg(c *gin.Context) { log.NewInfo(params.OperationID, "Ws call success to ManagementSendMsgReq", params) pbData := newUserSendMsgReq(¶ms) - log.Info("", "", "api ManagementSendMsg call start..., [data: %s]", pbData.String()) + log.Info(params.OperationID, "", "api ManagementSendMsg call start..., [data: %s]", pbData.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID) + if etcdConn == nil { + errMsg := params.OperationID + "getcdv3.GetConn == nil" + log.NewError(params.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbChat.NewChatClient(etcdConn) - log.Info("", "", "api ManagementSendMsg call, api call rpc...") + log.Info(params.OperationID, "", "api ManagementSendMsg call, api call rpc...") RpcResp, err := client.SendMsg(context.Background(), pbData) if err != nil { @@ -182,7 +188,7 @@ func ManagementSendMsg(c *gin.Context) { 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()) + log.Info(params.OperationID, "", "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) @@ -239,7 +245,7 @@ func ManagementBatchSendMsg(c *gin.Context) { log.Error(c.PostForm("operationID"), "data args validate err", err.Error()) return } - log.NewInfo("", data, params) + log.NewInfo(params.OperationID, data, params) token := c.Request.Header.Get("token") claims, err := token_verify.ParseToken(token, params.OperationID) if err != nil { @@ -256,8 +262,14 @@ func ManagementBatchSendMsg(c *gin.Context) { for _, recvID := range params.RecvIDList { pbData := newUserSendMsgReq(¶ms.ManagementSendMsgReq) pbData.MsgData.RecvID = recvID - log.Info("", "", "api ManagementSendMsg call start..., [data: %s]", pbData.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + log.Info(params.OperationID, "", "api ManagementSendMsg call start..., ", pbData.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID) + if etcdConn == nil { + errMsg := params.OperationID + "getcdv3.GetConn == nil" + log.NewError(params.OperationID, errMsg) + resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) + continue + } client := pbChat.NewChatClient(etcdConn) rpcResp, err := client.SendMsg(context.Background(), pbData) if err != nil { @@ -266,7 +278,7 @@ func ManagementBatchSendMsg(c *gin.Context) { continue } if rpcResp.ErrCode != 0 { - log.NewError(params.OperationID, utils.GetSelfFuncName(), "rpc failed", pbData) + log.NewError(params.OperationID, utils.GetSelfFuncName(), "rpc failed", pbData, rpcResp) resp.Data.FailedIDList = append(resp.Data.FailedIDList, recvID) continue } @@ -347,15 +359,15 @@ type RevokeElem struct { RevokeMsgClientID string `mapstructure:"revokeMsgClientID" validate:"required"` } type OANotificationElem struct { - NotificationName string `mapstructure:"notificationName" validate:"required"` - NotificationFaceURL string `mapstructure:"notificationFaceURL" validate:"required"` - NotificationType int32 `mapstructure:"notificationType" validate:"required"` - Text string `mapstructure:"text" validate:"required"` - Url string `mapstructure:"url"` - MixType int32 `mapstructure:"mixType"` - PictureElem PictureElem `mapstructure:"pictureElem"` - SoundElem SoundElem `mapstructure:"soundElem"` - VideoElem VideoElem `mapstructure:"videoElem"` - FileElem FileElem `mapstructure:"fileElem"` - Ex string `mapstructure:"ex"` + NotificationName string `mapstructure:"notificationName" json:"notificationName" validate:"required"` + NotificationFaceURL string `mapstructure:"notificationFaceURL" json:"notificationFaceURL" validate:"required"` + NotificationType int32 `mapstructure:"notificationType" json:"notificationType" validate:"required"` + Text string `mapstructure:"text" json:"text" validate:"required"` + Url string `mapstructure:"url" json:"url"` + MixType int32 `mapstructure:"mixType" json:"mixType"` + PictureElem PictureElem `mapstructure:"pictureElem" json:"pictureElem"` + SoundElem SoundElem `mapstructure:"soundElem" json:"soundElem"` + VideoElem VideoElem `mapstructure:"videoElem" json:"videoElem"` + FileElem FileElem `mapstructure:"fileElem" json:"fileElem"` + Ex string `mapstructure:"ex" json:"ex"` } diff --git a/internal/api/manage/management_user.go b/internal/api/manage/management_user.go index 6fc9d161d..62d2d6651 100644 --- a/internal/api/manage/management_user.go +++ b/internal/api/manage/management_user.go @@ -42,7 +42,13 @@ func DeleteUser(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.DeleteUsers(context.Background(), req) @@ -78,7 +84,13 @@ func GetAllUsersUid(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetAllUserID(context.Background(), req) if err != nil { @@ -114,7 +126,13 @@ func AccountCheck(c *gin.Context) { } 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.AccountCheck(context.Background(), req) diff --git a/internal/api/office/tag.go b/internal/api/office/tag.go index 02278f60e..9617d381d 100644 --- a/internal/api/office/tag.go +++ b/internal/api/office/tag.go @@ -42,7 +42,13 @@ func GetUserTags(c *gin.Context) { reqPb.UserID = userID reqPb.OperationID = req.OperationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserTags(context.Background(), &reqPb) if err != nil { @@ -89,7 +95,13 @@ func CreateTag(c *gin.Context) { } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.CreateTag(context.Background(), &reqPb) if err != nil { @@ -131,7 +143,13 @@ func DeleteTag(c *gin.Context) { } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.DeleteTag(context.Background(), &reqPb) if err != nil { @@ -173,7 +191,13 @@ func SetTag(c *gin.Context) { } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.SetTag(context.Background(), &reqPb) if err != nil { @@ -215,7 +239,13 @@ func SendMsg2Tag(c *gin.Context) { } reqPb.SendID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.SendMsg2Tag(context.Background(), &reqPb) if err != nil { @@ -259,7 +289,13 @@ func GetTagSendLogs(c *gin.Context) { PageNumber: req.PageNumber, ShowNumber: req.ShowNumber, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) maxSizeOption := grpc.MaxCallRecvMsgSize(1024 * 1024 * 20) respPb, err := client.GetTagSendLogs(context.Background(), &reqPb, maxSizeOption) @@ -308,7 +344,13 @@ func GetUserTagByID(c *gin.Context) { reqPb.UserID = userID reqPb.OperationID = req.OperationID reqPb.TagID = req.TagID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserTagByID(context.Background(), &reqPb) if err != nil { diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go index 82716a4f8..ae4863b75 100644 --- a/internal/api/office/work_moments.go +++ b/internal/api/office/work_moments.go @@ -44,7 +44,14 @@ func CreateOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.WorkMoment.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.CreateOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -89,7 +96,14 @@ func DeleteOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.DeleteOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -133,7 +147,13 @@ func LikeOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.LikeOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -177,7 +197,13 @@ func CommentOneWorkMoment(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.CommentOneWorkMoment(context.Background(), &reqPb) if err != nil { @@ -219,7 +245,13 @@ func DeleteComment(c *gin.Context) { return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.DeleteComment(context.Background(), &reqPb) if err != nil { @@ -262,7 +294,13 @@ func GetWorkMomentByID(c *gin.Context) { reqPb.OperationID = req.OperationID reqPb.OpUserID = userID reqPb.WorkMomentID = req.WorkMomentID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetWorkMomentByID(context.Background(), &reqPb) if err != nil { @@ -314,7 +352,13 @@ func GetUserWorkMoments(c *gin.Context) { } reqPb.OpUserID = opUserID reqPb.UserID = req.UserID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb) if err != nil { @@ -411,7 +455,13 @@ func GetUserFriendWorkMoments(c *gin.Context) { ShowNumber: req.ShowNumber, } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.GetUserFriendWorkMoments(context.Background(), &reqPb) if err != nil { @@ -506,7 +556,13 @@ func SetUserWorkMomentsLevel(c *gin.Context) { log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) } reqPb.UserID = userID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbOffice.NewOfficeServiceClient(etcdConn) respPb, err := client.SetUserWorkMomentsLevel(context.Background(), &reqPb) if err != nil { diff --git a/internal/api/organization/organization.go b/internal/api/organization/organization.go index 9d134a253..5998fb0dd 100644 --- a/internal/api/organization/organization.go +++ b/internal/api/organization/organization.go @@ -36,7 +36,14 @@ func CreateDepartment(c *gin.Context) { } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.CreateDepartment(context.Background(), req) if err != nil { @@ -72,7 +79,14 @@ func UpdateDepartment(c *gin.Context) { } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.UpdateDepartment(context.Background(), req) if err != nil { @@ -106,7 +120,13 @@ func GetSubDepartment(c *gin.Context) { } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.GetSubDepartment(context.Background(), req) if err != nil { @@ -144,7 +164,13 @@ func DeleteDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.DeleteDepartment(context.Background(), req) if err != nil { @@ -180,7 +206,13 @@ func CreateOrganizationUser(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.CreateOrganizationUser(context.Background(), req) if err != nil { @@ -215,7 +247,13 @@ func UpdateOrganizationUser(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.UpdateOrganizationUser(context.Background(), req) if err != nil { @@ -251,7 +289,13 @@ func CreateDepartmentMember(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.CreateDepartmentMember(context.Background(), req) if err != nil { @@ -286,7 +330,13 @@ func GetUserInDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.GetUserInDepartment(context.Background(), req) if err != nil { @@ -322,7 +372,13 @@ func UpdateUserInDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.UpdateUserInDepartment(context.Background(), req) if err != nil { @@ -357,7 +413,13 @@ func DeleteOrganizationUser(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.DeleteOrganizationUser(context.Background(), req) if err != nil { @@ -392,7 +454,13 @@ func GetDepartmentMember(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.GetDepartmentMember(context.Background(), req) if err != nil { @@ -427,7 +495,13 @@ func DeleteUserInDepartment(c *gin.Context) { return } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewOrganizationClient(etcdConn) RpcResp, err := client.DeleteUserInDepartment(context.Background(), req) if err != nil { diff --git a/internal/api/third/minio_storage_credential.go b/internal/api/third/minio_storage_credential.go index f294d6ba3..542c99ba7 100644 --- a/internal/api/third/minio_storage_credential.go +++ b/internal/api/third/minio_storage_credential.go @@ -87,7 +87,7 @@ func MinioUploadFile(c *gin.Context) { log.Debug(req.OperationID, utils.GetSelfFuncName(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, newType, MinioClient.EndpointURL()) _, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType}) if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "upload file error") + log.NewError(req.OperationID, utils.GetSelfFuncName(), "upload file error", err.Error()) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "upload file error" + err.Error()}) return } diff --git a/internal/api/user/user.go b/internal/api/user/user.go index 6be7ed710..ac40059d3 100644 --- a/internal/api/user/user.go +++ b/internal/api/user/user.go @@ -38,7 +38,13 @@ func GetUsersInfoFromCache(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { @@ -80,7 +86,13 @@ func GetFriendIDListFromCache(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := cacheRpc.NewCacheClient(etcdConn) respPb, err := client.GetFriendIDListFromCache(context.Background(), &reqPb) if err != nil { @@ -116,7 +128,13 @@ func GetBlackIDListFromCache(c *gin.Context) { c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) return } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := cacheRpc.NewCacheClient(etcdConn) respPb, err := client.GetBlackIDListFromCache(context.Background(), &reqPb) if err != nil { @@ -151,7 +169,13 @@ func GetUsersInfo(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { @@ -191,8 +215,13 @@ func UpdateUserInfo(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.UpdateUserInfo(context.Background(), req) if err != nil { @@ -204,6 +233,44 @@ func UpdateUserInfo(c *gin.Context) { log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp) c.JSON(http.StatusOK, resp) } +func SetGlobalRecvMessageOpt(c *gin.Context) { + params := api.SetGlobalRecvMessageOptReq{} + 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.SetGlobalRecvMessageOptReq{} + utils.CopyStructFields(req, ¶ms) + req.OperationID = params.OperationID + var ok bool + var errInfo string + ok, req.UserID, errInfo = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + errMsg := req.OperationID + " " + "GetUserIDFromToken failed " + errInfo + " token:" + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(params.OperationID, "SetGlobalRecvMessageOpt args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.SetGlobalRecvMessageOpt(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "SetGlobalRecvMessageOpt 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, "SetGlobalRecvMessageOpt api return ", resp) + c.JSON(http.StatusOK, resp) +} func GetSelfUserInfo(c *gin.Context) { params := api.GetSelfUserInfoReq{} @@ -229,7 +296,13 @@ func GetSelfUserInfo(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := rpc.NewUserClient(etcdConn) RpcResp, err := client.GetUserInfo(context.Background(), req) if err != nil { diff --git a/internal/cms_api/admin/admin.go b/internal/cms_api/admin/admin.go index ff8882369..a741c8016 100644 --- a/internal/cms_api/admin/admin.go +++ b/internal/cms_api/admin/admin.go @@ -12,6 +12,7 @@ import ( "context" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" + "net/http" "strings" "github.com/gin-gonic/gin" @@ -68,7 +69,14 @@ func AdminLogin(c *gin.Context) { } 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) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAdminCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbAdmin.NewAdminCMSClient(etcdConn) respPb, err := client.AdminLogin(context.Background(), &reqPb) if err != nil { diff --git a/internal/cms_api/group/group.go b/internal/cms_api/group/group.go index 69b9e32fc..8eb53a8bf 100644 --- a/internal/cms_api/group/group.go +++ b/internal/cms_api/group/group.go @@ -10,6 +10,7 @@ import ( commonPb "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "net/http" "strings" pbGroup "Open_IM/pkg/proto/group" @@ -28,9 +29,16 @@ func GetGroupById(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroupById(context.Background(), &reqPb) if err != nil { @@ -60,10 +68,17 @@ func GetGroups(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroups(context.Background(), &reqPb) if err != nil { @@ -101,11 +116,18 @@ func GetGroupByName(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroup(context.Background(), &reqPb) if err != nil { @@ -143,7 +165,8 @@ func CreateGroup(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupInfo = &commonPb.GroupInfo{} reqPb.GroupInfo.GroupName = req.GroupName reqPb.GroupInfo.CreatorUserID = req.GroupMasterId @@ -155,7 +178,13 @@ func CreateGroup(c *gin.Context) { RoleLevel: 1, }) } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.CreateGroup(context.Background(), &reqPb) if err != nil { @@ -176,10 +205,18 @@ func BanGroupChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -201,10 +238,17 @@ func BanPrivateChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -225,10 +269,17 @@ func OpenGroupChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -249,10 +300,18 @@ func OpenPrivateChat(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateGroupStatus(context.Background(), &reqPb) if err != nil { @@ -274,14 +333,21 @@ func GetGroupMembers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.GetGroupMembersCMS(context.Background(), &reqPb) if err != nil { @@ -317,10 +383,17 @@ func AddGroupMembers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } + reqPb.OperationId = utils.OperationIDGenerator() log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationId) + if etcdConn == nil { + errMsg := reqPb.OperationId + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationId, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.AddGroupMembersCMS(context.Background(), &reqPb) if err != nil { @@ -345,10 +418,17 @@ func RemoveGroupMembers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) respPb, err := client.RemoveGroupMembersCMS(context.Background(), &reqPb) if err != nil { @@ -373,9 +453,16 @@ func DeleteGroup(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.GroupId = req.GroupId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.DeleteGroup(context.Background(), &reqPb) if err != nil { @@ -397,11 +484,18 @@ func SetGroupMaster(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateUserRole(context.Background(), &reqPb) if err != nil { @@ -423,11 +517,18 @@ func SetGroupOrdinaryUsers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.OperateUserRole(context.Background(), &reqPb) if err != nil { @@ -444,7 +545,8 @@ func AlterGroupInfo(c *gin.Context) { _ cms_api_struct.SetGroupMasterResponse reqPb pbGroup.SetGroupInfoReq ) - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) if err := c.BindJSON(&req); err != nil { log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) openIMHttp.RespHttp200(c, constant.ErrArgs, nil) @@ -459,7 +561,13 @@ func AlterGroupInfo(c *gin.Context) { FaceURL: req.ProfilePhoto, GroupType: int32(req.GroupType), } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbGroup.NewGroupClient(etcdConn) _, err := client.SetGroupInfo(context.Background(), &reqPb) if err != nil { diff --git a/internal/cms_api/message_cms/message.go b/internal/cms_api/message_cms/message.go index 0a56bb99a..bd5949771 100644 --- a/internal/cms_api/message_cms/message.go +++ b/internal/cms_api/message_cms/message.go @@ -10,6 +10,7 @@ import ( pbCommon "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "net/http" "strings" "Open_IM/pkg/common/constant" @@ -21,7 +22,14 @@ 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) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) _, err := client.BoradcastMessage(context.Background(), &reqPb) if err != nil { @@ -36,7 +44,14 @@ 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) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) _, err := client.MassSendMessage(context.Background(), &reqPb) if err != nil { @@ -51,7 +66,14 @@ 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) + reqPb.OperationID = utils.OperationIDGenerator() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) _, err := client.WithdrawMessage(context.Background(), &reqPb) if err != nil { @@ -78,8 +100,14 @@ func GetChatLogs(c *gin.Context) { ShowNumber: int32(req.ShowNumber), } utils.CopyStructFields(&reqPb, &req) - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pbMessage.NewMessageCMSClient(etcdConn) respPb, err := client.GetChatLogs(context.Background(), &reqPb) if err != nil { @@ -106,6 +134,6 @@ func GetChatLogs(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.ChatLogsNum = int(respPb.ChatLogsNum) - log.NewInfo("", utils.GetSelfFuncName(), "resp", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } diff --git a/internal/cms_api/statistics/statistics.go b/internal/cms_api/statistics/statistics.go index 89fb6056b..b33bdee12 100644 --- a/internal/cms_api/statistics/statistics.go +++ b/internal/cms_api/statistics/statistics.go @@ -10,6 +10,7 @@ import ( pb "Open_IM/pkg/proto/statistics" "Open_IM/pkg/utils" "context" + "net/http" "strings" "github.com/gin-gonic/gin" @@ -27,9 +28,16 @@ func GetMessagesStatistics(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetMessageStatistics(context.Background(), &reqPb) if err != nil { @@ -58,7 +66,7 @@ func GetMessagesStatistics(c *gin.Context) { MessageNum: int(v.Num), }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -74,13 +82,20 @@ func GetUserStatistics(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetUserStatistics(context.Background(), &reqPb) if err != nil { - log.NewError("0", utils.GetSelfFuncName(), "GetUserStatistics failed", err.Error()) + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetUserStatistics failed", err.Error()) openIMHttp.RespHttp200(c, err, nil) return } @@ -115,7 +130,7 @@ func GetUserStatistics(c *gin.Context) { TotalUserNum: int(v.Num), }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -131,9 +146,16 @@ func GetGroupStatistics(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetGroupStatistics(context.Background(), &reqPb) if err != nil { @@ -165,7 +187,7 @@ func GetGroupStatistics(c *gin.Context) { }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -181,9 +203,16 @@ func GetActiveUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetActiveUser(context.Background(), &reqPb) if err != nil { @@ -192,7 +221,7 @@ func GetActiveUser(c *gin.Context) { return } utils.CopyStructFields(&resp.ActiveUserList, respPb.Users) - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -208,13 +237,20 @@ func GetActiveGroup(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.StatisticsReq, req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetActiveGroup(context.Background(), &reqPb) if err != nil { - log.NewError("0", utils.GetSelfFuncName(), "GetActiveGroup failed ", err.Error()) + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetActiveGroup failed ", err.Error()) openIMHttp.RespHttp200(c, err, nil) return } @@ -229,6 +265,6 @@ func GetActiveGroup(c *gin.Context) { MessageNum: int(group.MessageNum), }) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } diff --git a/internal/cms_api/user/user.go b/internal/cms_api/user/user.go index f8d96e35e..09513a98e 100644 --- a/internal/cms_api/user/user.go +++ b/internal/cms_api/user/user.go @@ -29,9 +29,17 @@ func GetUserById(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + client := pb.NewUserClient(etcdConn) respPb, err := client.GetUserById(context.Background(), &reqPb) if err != nil { @@ -44,7 +52,7 @@ func GetUserById(c *gin.Context) { return } utils.CopyStructFields(&resp, respPb.User) - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -54,7 +62,8 @@ func GetUsersByName(c *gin.Context) { resp cms_api_struct.GetUsersByNameResponse reqPb pb.GetUsersByNameReq ) - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) if err := c.ShouldBindQuery(&req); err != nil { log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed", err.Error()) openIMHttp.RespHttp200(c, constant.ErrArgs, nil) @@ -65,7 +74,13 @@ func GetUsersByName(c *gin.Context) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetUsersByName(context.Background(), &reqPb) if err != nil { @@ -77,7 +92,7 @@ func GetUsersByName(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.UserNums = respPb.UserNums - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -93,9 +108,16 @@ func GetUsers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb.Pagination, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetUsers(context.Background(), &reqPb) if err != nil { @@ -106,7 +128,7 @@ func GetUsers(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.UserNums = respPb.UserNums - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -122,15 +144,22 @@ func ResignUser(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.ResignUser(context.Background(), &reqPb) if err != nil { openIMHttp.RespHttp200(c, err, resp) } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -145,13 +174,20 @@ func AlterUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.AlterUser(context.Background(), &reqPb) if err != nil { - log.NewError("0", "microserver failed ", err.Error()) + log.NewError(reqPb.OperationID, "microserver failed ", err.Error()) openIMHttp.RespHttp200(c, err, nil) } openIMHttp.RespHttp200(c, constant.OK, nil) @@ -167,9 +203,16 @@ func AddUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.AddUser(context.Background(), &reqPb) if err != nil { @@ -191,9 +234,16 @@ func BlockUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) fmt.Println(reqPb) _, err := client.BlockUser(context.Background(), &reqPb) @@ -215,16 +265,23 @@ func UnblockUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) utils.CopyStructFields(&reqPb, &req) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.UnBlockUser(context.Background(), &reqPb) if err != nil { openIMHttp.RespHttp200(c, err, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -241,10 +298,17 @@ func GetBlockUsers(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, resp) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetBlockUsers(context.Background(), &reqPb) if err != nil { @@ -268,7 +332,7 @@ func GetBlockUsers(c *gin.Context) { resp.ShowNumber = int(respPb.Pagination.ShowNumber) resp.CurrentPage = int(respPb.Pagination.CurrentPage) resp.UserNums = respPb.UserNums - log.NewInfo("", utils.GetSelfFuncName(), "req: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -283,20 +347,27 @@ func GetBlockUserById(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.UserId = req.UserId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) respPb, err := client.GetBlockUserById(context.Background(), &reqPb) if err != nil { - log.NewError("0", "GetBlockUserById rpc failed ", err.Error()) + log.NewError(reqPb.OperationID, "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) - log.NewInfo("", utils.GetSelfFuncName(), "resp: ", resp) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "resp: ", resp) openIMHttp.RespHttp200(c, constant.OK, resp) } @@ -310,13 +381,20 @@ func DeleteUser(c *gin.Context) { openIMHttp.RespHttp200(c, constant.ErrArgs, nil) return } - log.NewInfo("", utils.GetSelfFuncName(), "req: ", req) + reqPb.OperationID = utils.OperationIDGenerator() + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req) reqPb.UserId = req.UserId - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, reqPb.OperationID) + if etcdConn == nil { + errMsg := reqPb.OperationID + "getcdv3.GetConn == nil" + log.NewError(reqPb.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } client := pb.NewUserClient(etcdConn) _, err := client.DeleteUser(context.Background(), &reqPb) if err != nil { - log.NewError("0", "DeleteUser rpc failed ", err.Error()) + log.NewError(reqPb.OperationID, "DeleteUser rpc failed ", err.Error()) openIMHttp.RespHttp200(c, err, nil) return } diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go index b5d587844..4f0ea5cbd 100644 --- a/internal/demo/register/login.go +++ b/internal/demo/register/login.go @@ -46,12 +46,18 @@ func Login(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) return } + var userID string + if r.UserID != "" { + userID = r.UserID + } else { + userID = r.Account + } url := fmt.Sprintf("http://%s:%d/auth/user_token", utils.ServerIP, config.Config.Api.GinPort[0]) openIMGetUserToken := api.UserTokenReq{} openIMGetUserToken.OperationID = params.OperationID openIMGetUserToken.Platform = params.Platform openIMGetUserToken.Secret = config.Config.Secret - openIMGetUserToken.UserID = account + openIMGetUserToken.UserID = userID openIMGetUserTokenResp := api.UserTokenResp{} bMsg, err := http2.Post(url, openIMGetUserToken, 2) if err != nil { diff --git a/internal/demo/register/onboarding_process.go b/internal/demo/register/onboarding_process.go index 8c43bc221..647fbe3c5 100644 --- a/internal/demo/register/onboarding_process.go +++ b/internal/demo/register/onboarding_process.go @@ -1,9 +1,11 @@ package register import ( + "Open_IM/internal/api/manage" "Open_IM/internal/rpc/msg" "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/grpc-etcdv3/getcdv3" groupRpc "Open_IM/pkg/proto/group" @@ -23,23 +25,37 @@ func onboardingProcess(operationID, userID, userName string) { if err := createOrganizationUser(operationID, userID, userName); err != nil { log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error()) } - departmentID := config.Config.Demo.TestDepartMentID + departmentID, err := imdb.GetRandomDepartmentID() + if err := joinTestDepartment(operationID, userID, departmentID); err != nil { log.NewError(operationID, utils.GetSelfFuncName(), "joinTestDepartment failed", err.Error()) } + log.NewInfo(operationID, utils.GetSelfFuncName(), "random departmentID", departmentID) + if err != nil { + log.NewError(utils.GetSelfFuncName(), "GetRandomDepartmentID failed", err.Error()) + return + } groupIDList, err := GetDepartmentGroupIDList(operationID, departmentID) if err != nil { log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) } + log.NewInfo(operationID, utils.GetSelfFuncName(), groupIDList) joinGroups(operationID, userID, userName, groupIDList) log.NewInfo(operationID, utils.GetSelfFuncName(), "fineshed") + oaNotification(operationID, userID) } func createOrganizationUser(operationID, userID, userName string) error { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID) }() - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + log.NewInfo(operationID, utils.GetSelfFuncName(), "start createOrganizationUser") + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return errors.New(errMsg) + } client := organizationRpc.NewOrganizationClient(etcdConn) req := &organizationRpc.CreateOrganizationUserReq{ OrganizationUser: &commonPb.OrganizationUser{ @@ -50,7 +66,8 @@ func createOrganizationUser(operationID, userID, userName string) error { CreateTime: uint32(time.Now().Unix()), }, OperationID: operationID, - OpUserID: userID, + OpUserID: config.Config.Manager.AppManagerUid[0], + IsRegister: false, } if strings.Contains("@", userID) { req.OrganizationUser.Email = userID @@ -73,7 +90,12 @@ func joinTestDepartment(operationID, userID, departmentID string) error { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID) }() - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return errors.New(errMsg) + } client := organizationRpc.NewOrganizationClient(etcdConn) req := &organizationRpc.CreateDepartmentMemberReq{ DepartmentMember: &commonPb.DepartmentMember{ @@ -97,7 +119,15 @@ func joinTestDepartment(operationID, userID, departmentID string) error { } func GetDepartmentGroupIDList(operationID, departmentID string) ([]string, error) { - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + defer func() { + log.NewInfo(operationID, utils.GetSelfFuncName(), departmentID) + }() + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return nil, errors.New(errMsg) + } client := organizationRpc.NewOrganizationClient(etcdConn) req := organizationRpc.GetDepartmentParentIDListReq{ DepartmentID: departmentID, @@ -131,7 +161,12 @@ func joinGroups(operationID, userID, userName string, groupIDList []string) { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID, groupIDList) }() - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, operationID) + if etcdConn == nil { + errMsg := operationID + "getcdv3.GetConn == nil" + log.NewError(operationID, errMsg) + return + } client := groupRpc.NewGroupClient(etcdConn) for _, groupID := range groupIDList { req := &groupRpc.InviteUserToGroupReq{ @@ -139,7 +174,7 @@ func joinGroups(operationID, userID, userName string, groupIDList []string) { GroupID: groupID, Reason: "register auto join", InvitedUserIDList: []string{userID}, - OpUserID: userID, + OpUserID: config.Config.Manager.AppManagerUid[1], } resp, err := client.InviteUserToGroup(context.Background(), req) if err != nil { @@ -150,34 +185,71 @@ func joinGroups(operationID, userID, userName string, groupIDList []string) { log.NewError(req.OperationID, utils.GetSelfFuncName(), resp) continue } - onboardingProcessNotification(operationID, userID, groupID) + onboardingProcessNotification(operationID, userID, groupID, userName) } } // welcome user join department notification -func onboardingProcessNotification(operationID, userID, groupID string) { +func onboardingProcessNotification(operationID, userID, groupID, userName string) { defer func() { log.NewInfo(operationID, utils.GetSelfFuncName(), userID, groupID) }() - var tips commonPb.TipsComm - tips.DefaultTips = config.Config.Notification.JoinDepartmentNotification.DefaultTips.Tips - tips.JsonDetail = "" - content, err := proto.Marshal(&tips) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), "proto marshal failed") - return - } + //var tips commonPb.TipsComm + //tips.DefaultTips = config.Config.Notification.JoinDepartmentNotification.DefaultTips.Tips + //tips.JsonDetail = "" + //content, err := proto.Marshal(&tips) + //if err != nil { + // log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), "proto marshal failed") + // return + //} + welcomeString := fmt.Sprintf("欢迎%s加入部门", userName) notification := &msg.NotificationMsg{ SendID: userID, RecvID: groupID, - Content: content, + Content: []byte(welcomeString), MsgFrom: constant.UserMsgType, ContentType: constant.Text, - SessionType: constant.SingleChatType, + SessionType: constant.GroupChatType, OperationID: operationID, } + // notification user join group msg.Notification(notification) + +} + +func oaNotification(operationID, userID string) { + var err error + elem := manage.OANotificationElem{ + NotificationName: "入职通知", + NotificationFaceURL: "", + NotificationType: 1, + Text: "欢迎你入职公司", + Url: "", + MixType: 0, + PictureElem: manage.PictureElem{}, + SoundElem: manage.SoundElem{}, + VideoElem: manage.VideoElem{}, + FileElem: manage.FileElem{}, + Ex: "", + } + sysNotification := &msg.NotificationMsg{ + SendID: config.Config.Manager.AppManagerUid[0], + RecvID: userID, + MsgFrom: constant.SysMsgType, + ContentType: constant.OANotification, + SessionType: constant.NotificationChatType, + OperationID: operationID, + } + var tips commonPb.TipsComm + tips.JsonDetail = utils.StructToJsonString(elem) + sysNotification.Content, err = proto.Marshal(&tips) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "elem: ", elem, err.Error()) + return + } + + msg.Notification(sysNotification) } func randomEnglishName() string { @@ -185,14 +257,12 @@ func randomEnglishName() string { "feudal", "adverse", "exploit", "occupy", "solve", "amazing", "fantasy", "orchid", "spiky", "approve", "flap"} rand.Seed(time.Now().UnixNano()) index := rand.Intn(len(l) - 1) - fmt.Println(index) return l[index] } func randomPosition() string { - l := []string{"Golang工程师", "前端工程师", "后端工程师", "产品经理", "测试开发工程师", "运维开发工程师"} + l := []string{"后端工程师", "前端工程师", "设计师"} rand.Seed(time.Now().UnixNano()) index := rand.Intn(len(l) - 1) - fmt.Println(index) return l[index] } diff --git a/internal/demo/register/reset_password.go b/internal/demo/register/reset_password.go index b668f4f62..aee1a7cf5 100644 --- a/internal/demo/register/reset_password.go +++ b/internal/demo/register/reset_password.go @@ -15,8 +15,8 @@ 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"` + NewPassword string `json:"newPassword" binding:"required"` + OperationID string `json:"operationID"` } func ResetPassword(c *gin.Context) { @@ -44,12 +44,14 @@ func ResetPassword(c *gin.Context) { } user, err := im_mysql_model.GetRegister(account) if err != nil || user.Account == "" { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "get register error", err.Error()) + if err != nil { + 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()}) + 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/set_password.go b/internal/demo/register/set_password.go index 7a0578264..545a489d3 100644 --- a/internal/demo/register/set_password.go +++ b/internal/demo/register/set_password.go @@ -11,17 +11,21 @@ import ( "Open_IM/pkg/utils" "encoding/json" "github.com/gin-gonic/gin" + "math/big" "net/http" + "strconv" + "time" ) type ParamsSetPassword struct { Email string `json:"email"` - Name string `json:"name"` + Nickname string `json:"nickname"` PhoneNumber string `json:"phoneNumber"` - Password string `json:"password"` + Password string `json:"password" binding:"required"` VerificationCode string `json:"verificationCode"` Platform int32 `json:"platform" binding:"required,min=1,max=7"` Ex string `json:"ex"` + FaceURL string `json:"faceURL"` OperationID string `json:"operationID" binding:"required"` } @@ -38,8 +42,8 @@ func SetPassword(c *gin.Context) { } else { account = params.PhoneNumber } - if params.Name == "" { - params.Name = account + if params.Nickname == "" { + params.Nickname = account } if params.VerificationCode != config.Config.Demo.SuperCode { accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix @@ -52,13 +56,21 @@ func SetPassword(c *gin.Context) { return } } + //userID := utils.Base64Encode(account) + + userID := utils.Md5(params.OperationID + strconv.FormatInt(time.Now().UnixNano(), 10)) + bi := big.NewInt(0) + bi.SetString(userID[0:8], 16) + userID = bi.String() + url := config.Config.Demo.ImAPIURL + "/auth/user_register" openIMRegisterReq := api.UserRegisterReq{} openIMRegisterReq.OperationID = params.OperationID openIMRegisterReq.Platform = params.Platform - openIMRegisterReq.UserID = account - openIMRegisterReq.Nickname = params.Name + openIMRegisterReq.UserID = userID + openIMRegisterReq.Nickname = params.Nickname openIMRegisterReq.Secret = config.Config.Secret + openIMRegisterReq.FaceURL = params.FaceURL openIMRegisterResp := api.UserRegisterResp{} bMsg, err := http2.Post(url, openIMRegisterReq, 2) if err != nil { @@ -76,7 +88,7 @@ func SetPassword(c *gin.Context) { return } log.Info(params.OperationID, "begin store mysql", account, params.Password) - err = im_mysql_model.SetPassword(account, params.Password, params.Ex) + err = im_mysql_model.SetPassword(account, params.Password, params.Ex, userID) 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()}) @@ -84,7 +96,7 @@ func SetPassword(c *gin.Context) { } log.Info(params.OperationID, "end setPassword", account, params.Password) // demo onboarding - onboardingProcess(params.OperationID, account, params.Name) + onboardingProcess(params.OperationID, userID, params.Nickname) c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken}) return } diff --git a/internal/msg_gateway/gate/batch_push.go b/internal/msg_gateway/gate/batch_push.go new file mode 100644 index 000000000..76055d23b --- /dev/null +++ b/internal/msg_gateway/gate/batch_push.go @@ -0,0 +1,117 @@ +package gate + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + sdk_ws "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" +) + +var MaxPullMsgNum = 100 + +func (r *RPCServer) GenPullSeqList(currentSeq uint32, operationID string, userID string) ([]uint32, error) { + maxSeq, err := db.DB.GetUserMaxSeq(userID) + if err != nil { + log.Error(operationID, "GetUserMaxSeq failed ", userID, err.Error()) + return nil, utils.Wrap(err, "") + } + + var seqList []uint32 + num := 0 + for i := currentSeq + 1; i < uint32(maxSeq); i++ { + seqList = append(seqList, i) + num++ + if num == MaxPullMsgNum { + break + } + } + log.Info(operationID, "GenPullSeqList ", seqList, "current seq", currentSeq) + return seqList, nil +} + +func (r *RPCServer) GetSingleUserMsgForPushPlatforms(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformIDList []int) map[int]*sdk_ws.MsgDataList { + user2PushMsg := make(map[int]*sdk_ws.MsgDataList, 0) + for _, v := range platformIDList { + user2PushMsg[v] = r.GetSingleUserMsgForPush(operationID, msgData, pushToUserID, v) + //log.Info(operationID, "GetSingleUserMsgForPush", msgData.Seq, pushToUserID, v, "len:", len(user2PushMsg[v])) + } + return user2PushMsg +} + +func (r *RPCServer) GetSingleUserMsgForPush(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformID int) *sdk_ws.MsgDataList { + //msgData.MsgDataList = nil + return &sdk_ws.MsgDataList{MsgDataList: []*sdk_ws.MsgData{msgData}} + + //userConn := ws.getUserConn(pushToUserID, platformID) + //if userConn == nil { + // log.Debug(operationID, "userConn == nil") + // return []*sdk_ws.MsgData{msgData} + //} + // + //if msgData.Seq <= userConn.PushedMaxSeq { + // log.Debug(operationID, "msgData.Seq <= userConn.PushedMaxSeq", msgData.Seq, userConn.PushedMaxSeq) + // return nil + //} + // + //msgList := r.GetSingleUserMsg(operationID, msgData.Seq, pushToUserID) + //if msgList == nil { + // log.Debug(operationID, "GetSingleUserMsg msgList == nil", msgData.Seq, userConn.PushedMaxSeq) + // userConn.PushedMaxSeq = msgData.Seq + // return []*sdk_ws.MsgData{msgData} + //} + //msgList = append(msgList, msgData) + // + //for _, v := range msgList { + // if v.Seq > userConn.PushedMaxSeq { + // userConn.PushedMaxSeq = v.Seq + // } + //} + //log.Debug(operationID, "GetSingleUserMsg msgList len ", len(msgList), userConn.PushedMaxSeq) + //return msgList +} + +func (r *RPCServer) GetSingleUserMsg(operationID string, currentMsgSeq uint32, userID string) []*sdk_ws.MsgData { + seqList, err := r.GenPullSeqList(currentMsgSeq, operationID, userID) + if err != nil { + log.Error(operationID, "GenPullSeqList failed ", err.Error(), currentMsgSeq, userID) + return nil + } + if len(seqList) == 0 { + log.Error(operationID, "GenPullSeqList len == 0 ", currentMsgSeq, userID) + return nil + } + rpcReq := sdk_ws.PullMessageBySeqListReq{} + rpcReq.SeqList = seqList + rpcReq.UserID = userID + rpcReq.OperationID = operationID + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, rpcReq.OperationID) + if grpcConn == nil { + errMsg := "getcdv3.GetConn == nil" + log.NewError(rpcReq.OperationID, errMsg) + return nil + } + + msgClient := pbChat.NewChatClient(grpcConn) + reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq) + if err != nil { + log.Error(operationID, "PullMessageBySeqList failed ", err.Error(), rpcReq.String()) + return nil + } + if len(reply.List) == 0 { + return nil + } + return reply.List +} + +//func (r *RPCServer) GetBatchUserMsgForPush(operationID string, msgData *sdk_ws.MsgData, pushToUserIDList []string, platformID int) map[string][]*sdk_ws.MsgData { +// user2PushMsg := make(map[string][]*sdk_ws.MsgData, 0) +// for _, v := range pushToUserIDList { +// user2PushMsg[v] = r.GetSingleUserMsgForPush(operationID, msgData, v, platformID) +// } +// return user2PushMsg +//} diff --git a/internal/msg_gateway/gate/callback.go b/internal/msg_gateway/gate/callback.go index 5f472c9f3..9840e3513 100644 --- a/internal/msg_gateway/gate/callback.go +++ b/internal/msg_gateway/gate/callback.go @@ -9,7 +9,7 @@ import ( "time" ) -func callbackUserOnline(operationID, userID string, platformID int32, token string) cbApi.CommonCallbackResp { +func callbackUserOnline(operationID, userID string, platformID int, token string) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackUserOnline.Enable { return callbackResp @@ -20,7 +20,7 @@ func callbackUserOnline(operationID, userID string, platformID int32, token stri CallbackCommand: constant.CallbackUserOnlineCommand, OperationID: operationID, UserID: userID, - PlatformID: platformID, + PlatformID: int32(platformID), Platform: constant.PlatformIDToName(platformID), }, Seq: time.Now().Nanosecond() / 1e6, @@ -33,7 +33,7 @@ func callbackUserOnline(operationID, userID string, platformID int32, token stri return callbackResp } -func callbackUserOffline(operationID, userID string, platform string) cbApi.CommonCallbackResp { +func callbackUserOffline(operationID, userID string, platformID int) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackUserOffline.Enable { return callbackResp @@ -43,8 +43,8 @@ func callbackUserOffline(operationID, userID string, platform string) cbApi.Comm CallbackCommand: constant.CallbackUserOfflineCommand, OperationID: operationID, UserID: userID, - PlatformID: constant.PlatformNameToID(platform), - Platform: platform, + PlatformID: int32(platformID), + Platform: constant.PlatformIDToName(platformID), }, Seq: time.Now().Nanosecond() / 1e6, } diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index ac9f6e1e6..2ece3bd94 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -19,19 +19,12 @@ import ( ) func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { - //ws online debug data - //{"ReqIdentifier":1001,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b","Time":"123","OperationID":"123","MsgIncr":0} - //{"ReqIdentifier":1002,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b","Time":"123","OperationID":"123","MsgIncr":0,"SeqBegin":1,"SeqEnd":6} - //{"ReqIdentifier":1003,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b", - //"RecvID":"a87ff679a2f3e71d9181a67b7542122c","ClientMsgID":"2343","Time":"147878787","OperationID": - //"123","MsgIncr":0,"SubMsgType":101,"MsgType":100,"MsgFrom":1,"Content":"sdfsdf"} b := bytes.NewBuffer(binaryMsg) m := Req{} dec := gob.NewDecoder(b) err := dec.Decode(&m) if err != nil { log.NewError("", "ws Decode err", err.Error()) - ws.sendErrMsg(conn, 200, err.Error(), constant.WSDataError, "", "") err = conn.Close() if err != nil { log.NewError("", "ws close err", err.Error()) @@ -43,49 +36,69 @@ func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { ws.sendErrMsg(conn, 201, err.Error(), m.ReqIdentifier, m.MsgIncr, m.OperationID) return } - //if !utils.VerifyToken(m.Token, m.SendID) { - // ws.sendErrMsg(conn, 202, "token validate err", m.ReqIdentifier, m.MsgIncr,m.OperationID) - // return - //} - log.NewInfo(m.OperationID, "Basic Info Authentication Success", m) + log.NewInfo(m.OperationID, "Basic Info Authentication Success", m.SendID, m.MsgIncr, m.ReqIdentifier) switch m.ReqIdentifier { case constant.WSGetNewestSeq: + log.NewInfo(m.OperationID, "getSeqReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.getSeqReq(conn, &m) case constant.WSSendMsg: + log.NewInfo(m.OperationID, "sendMsgReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.sendMsgReq(conn, &m) case constant.WSSendSignalMsg: + log.NewInfo(m.OperationID, "sendSignalMsgReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.sendSignalMsgReq(conn, &m) case constant.WSPullMsgBySeqList: + log.NewInfo(m.OperationID, "pullMsgBySeqListReq ", m.SendID, m.MsgIncr, m.ReqIdentifier) ws.pullMsgBySeqListReq(conn, &m) default: + log.Error(m.OperationID, "ReqIdentifier failed ", m.SendID, m.MsgIncr, m.ReqIdentifier) } log.NewInfo(m.OperationID, "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, m.Data) - rpcReq := pbChat.GetMaxAndMinSeqReq{} - nReply := new(pbChat.GetMaxAndMinSeqResp) - 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) - rpcReply, err := msgClient.GetMaxAndMinSeq(context.Background(), &rpcReq) - if err != nil { - log.Error(rpcReq.OperationID, "rpc call failed to getSeqReq", err, rpcReq.String()) - nReply.ErrCode = 500 - nReply.ErrMsg = err.Error() - ws.getSeqResp(conn, m, nReply) + log.NewInfo(m.OperationID, "Ws call success to getNewSeq", m.MsgIncr, m.SendID, m.ReqIdentifier) + nReply := new(sdk_ws.GetMaxAndMinSeqResp) + isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSGetNewestSeq, m.OperationID) + log.Info(m.OperationID, "argsValidate ", isPass, errCode, errMsg) + if isPass { + rpcReq := sdk_ws.GetMaxAndMinSeqReq{} + rpcReq.GroupIDList = data.(sdk_ws.GetMaxAndMinSeqReq).GroupIDList + rpcReq.UserID = m.SendID + rpcReq.OperationID = m.OperationID + log.Debug(m.OperationID, "Ws call success to getMaxAndMinSeq", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(sdk_ws.GetMaxAndMinSeqReq).GroupIDList) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, rpcReq.OperationID) + if grpcConn == nil { + errMsg := rpcReq.OperationID + "getcdv3.GetConn == nil" + nReply.ErrCode = 500 + nReply.ErrMsg = errMsg + log.NewError(rpcReq.OperationID, errMsg) + ws.getSeqResp(conn, m, nReply) + return + } + msgClient := pbChat.NewChatClient(grpcConn) + rpcReply, err := msgClient.GetMaxAndMinSeq(context.Background(), &rpcReq) + if err != nil { + nReply.ErrCode = 500 + nReply.ErrMsg = err.Error() + log.Error(rpcReq.OperationID, "rpc call failed to GetMaxAndMinSeq ", nReply.String()) + ws.getSeqResp(conn, m, nReply) + } else { + log.NewInfo(rpcReq.OperationID, "rpc call success to getSeqReq", rpcReply.String()) + ws.getSeqResp(conn, m, rpcReply) + } } else { - log.NewInfo(rpcReq.OperationID, "rpc call success to getSeqReq", rpcReply.String()) - ws.getSeqResp(conn, m, rpcReply) + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + log.Error(m.OperationID, "argsValidate failed send resp: ", nReply.String()) + ws.getSeqResp(conn, m, nReply) } } -func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeqResp) { - var mReplyData sdk_ws.GetMaxAndMinSeqResp - mReplyData.MaxSeq = pb.GetMaxSeq() - mReplyData.MinSeq = pb.GetMinSeq() - b, _ := proto.Marshal(&mReplyData) + +func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *sdk_ws.GetMaxAndMinSeqResp) { + + b, _ := proto.Marshal(pb) mReply := Resp{ ReqIdentifier: m.ReqIdentifier, MsgIncr: m.MsgIncr, @@ -94,20 +107,31 @@ func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeq OperationID: m.OperationID, Data: b, } + log.Debug(m.OperationID, "getSeqResp come here req: ", pb.String(), "send resp: ", + mReply.ReqIdentifier, mReply.MsgIncr, mReply.ErrCode, mReply.ErrMsg) 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, m.Data) + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq start", m.SendID, m.ReqIdentifier, m.MsgIncr, string(m.Data)) nReply := new(sdk_ws.PullMessageBySeqListResp) - isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList) + isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList, m.OperationID) if isPass { rpcReq := sdk_ws.PullMessageBySeqListReq{} rpcReq.SeqList = data.(sdk_ws.PullMessageBySeqListReq).SeqList rpcReq.UserID = m.SendID rpcReq.OperationID = m.OperationID + rpcReq.GroupSeqList = data.(sdk_ws.PullMessageBySeqListReq).GroupSeqList log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq middle", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(sdk_ws.PullMessageBySeqListReq).SeqList) - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, m.OperationID) + if grpcConn == nil { + errMsg := rpcReq.OperationID + "getcdv3.GetConn == nil" + nReply.ErrCode = 500 + nReply.ErrMsg = errMsg + log.NewError(rpcReq.OperationID, errMsg) + ws.pullMsgBySeqListResp(conn, m, nReply) + return + } msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq) if err != nil { @@ -149,7 +173,7 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, m.Data) nReply := new(pbChat.SendMsgResp) - isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg) + isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg, m.OperationID) if isPass { data := pData.(sdk_ws.MsgData) pbData := pbChat.SendMsgReq{ @@ -158,7 +182,15 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, m.OperationID) + if etcdConn == nil { + errMsg := m.OperationID + "getcdv3.GetConn == nil" + nReply.ErrCode = 500 + nReply.ErrMsg = errMsg + log.NewError(m.OperationID, errMsg) + ws.sendMsgResp(conn, m, nReply) + return + } client := pbChat.NewChatClient(etcdConn) reply, err := client.SendMsg(context.Background(), &pbData) if err != nil { @@ -179,8 +211,6 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { } func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.SendMsgResp) { - // := make(map[string]interface{}) - var mReplyData sdk_ws.UserSendMsgResp mReplyData.ClientMsgID = pb.GetClientMsgID() mReplyData.ServerMsgID = pb.GetServerMsgID() @@ -198,12 +228,18 @@ func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.SendMsgResp) { } func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { - log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, string(m.Data), m.Token) + log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, string(m.Data)) nReply := new(pbChat.SendMsgResp) - isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendSignalMsg) + isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendSignalMsg, m.OperationID) if isPass { signalResp := pbRtc.SignalResp{} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRealTimeCommName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImRealTimeCommName, m.OperationID) + if etcdConn == nil { + errMsg := m.OperationID + "getcdv3.GetConn == nil" + log.NewError(m.OperationID, errMsg) + ws.sendSignalMsgResp(conn, 204, errMsg, m, &signalResp) + return + } rtcClient := pbRtc.NewRtcServiceClient(etcdConn) req := &pbRtc.SignalMessageAssembleReq{ SignalReq: pData.(*pbRtc.SignalReq), @@ -226,8 +262,14 @@ func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { MsgData: &msgData, } log.NewInfo(m.OperationID, utils.GetSelfFuncName(), "pbData: ", pbData) - log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, "session Type", msgData.SessionType) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, msgData) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, m.OperationID) + if etcdConn == nil { + errMsg := m.OperationID + "getcdv3.GetConn == nil" + log.NewError(m.OperationID, errMsg) + ws.sendSignalMsgResp(conn, 200, errMsg, m, &signalResp) + return + } client := pbChat.NewChatClient(etcdConn) reply, err := client.SendMsg(context.Background(), &pbData) if err != nil { @@ -250,7 +292,7 @@ func (ws *WServer) sendSignalMsgReq(conn *UserConn, m *Req) { } func (ws *WServer) sendSignalMsgResp(conn *UserConn, errCode int32, errMsg string, m *Req, pb *pbRtc.SignalResp) { // := make(map[string]interface{}) - log.Debug(m.OperationID, "SignalMsgResp is", pb.String()) + log.Debug(m.OperationID, "sendSignalMsgResp is", pb.String()) b, _ := proto.Marshal(pb) mReply := Resp{ ReqIdentifier: m.ReqIdentifier, @@ -267,14 +309,16 @@ func (ws *WServer) sendMsg(conn *UserConn, mReply interface{}) { enc := gob.NewEncoder(&b) err := enc.Encode(mReply) if err != nil { - 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()) + // 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(), err.Error()) return } err = ws.writeMsg(conn, websocket.BinaryMessage, b.Bytes()) if err != nil { - 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()) + // 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(), err.Error()) + } else { + log.Debug(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "ws write response success") } } 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 555015bb7..6b851b8f0 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -7,6 +7,7 @@ import ( "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbRelay "Open_IM/pkg/proto/relay" + sdk_ws "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "bytes" "context" @@ -25,6 +26,8 @@ type RPCServer struct { rpcRegisterName string etcdSchema string etcdAddr []string + platformList []int + pushTerminal []int } func (r *RPCServer) onInit(rpcPort int) { @@ -32,6 +35,8 @@ func (r *RPCServer) onInit(rpcPort int) { r.rpcRegisterName = config.Config.RpcRegisterName.OpenImOnlineMessageRelayName r.etcdSchema = config.Config.Etcd.EtcdSchema r.etcdAddr = config.Config.Etcd.EtcdAddr + r.platformList = genPlatformArray() + r.pushTerminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID} } func (r *RPCServer) run() { listenIP := "" @@ -69,7 +74,7 @@ func (r *RPCServer) run() { } func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgReq) (*pbRelay.OnlinePushMsgResp, error) { log.NewInfo(in.OperationID, "PushMsgToUser is arriving", in.String()) - var resp []*pbRelay.SingleMsgToUser + var resp []*pbRelay.SingleMsgToUserPlatform msgBytes, _ := proto.Marshal(in.MsgData) mReply := Resp{ ReqIdentifier: constant.WSPushMsg, @@ -84,22 +89,21 @@ func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgRe } var tag bool recvID := in.PushToUserID - platformList := genPlatformArray() - for _, v := range platformList { + for _, v := range r.platformList { if conn := ws.getUserConn(recvID, v); conn != nil { tag = true resultCode := sendMsgToUser(conn, replyBytes.Bytes(), in, v, recvID) - temp := &pbRelay.SingleMsgToUser{ + temp := &pbRelay.SingleMsgToUserPlatform{ ResultCode: resultCode, RecvID: recvID, - RecvPlatFormID: constant.PlatformNameToID(v), + RecvPlatFormID: int32(v), } resp = append(resp, temp) } else { - temp := &pbRelay.SingleMsgToUser{ + temp := &pbRelay.SingleMsgToUserPlatform{ ResultCode: -1, RecvID: recvID, - RecvPlatFormID: constant.PlatformNameToID(v), + RecvPlatFormID: int32(v), } resp = append(resp, temp) } @@ -119,19 +123,19 @@ func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUser } 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 { + userConnMap := ws.getUserAllCons(userID) + for platform, userConn := range userConnMap { + if userConn != nil { ps := new(pbRelay.GetUsersOnlineStatusResp_SuccessDetail) - ps.Platform = platform + ps.Platform = constant.PlatformIDToName(platform) ps.Status = constant.OnlineStatus temp.Status = constant.OnlineStatus temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, ps) - } } + if temp.Status == constant.OnlineStatus { resp.SuccessResult = append(resp.SuccessResult, temp) } @@ -139,11 +143,165 @@ func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUser 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) { + +func (r *RPCServer) SuperGroupOnlineBatchPushOneMsg(_ context.Context, req *pbRelay.OnlineBatchPushOneMsgReq) (*pbRelay.OnlineBatchPushOneMsgResp, error) { + log.NewInfo(req.OperationID, "BatchPushMsgToUser is arriving", req.String()) + var singleUserResult []*pbRelay.SingelMsgToUserResultList + //r.GetBatchMsgForPush(req.OperationID,req.MsgData,req.PushToUserIDList,) + msgBytes, _ := proto.Marshal(req.MsgData) + mReply := Resp{ + ReqIdentifier: constant.WSPushMsg, + OperationID: req.OperationID, + Data: msgBytes, + } + var replyBytes bytes.Buffer + enc := gob.NewEncoder(&replyBytes) + err := enc.Encode(mReply) + if err != nil { + log.NewError(req.OperationID, "data encode err", err.Error()) + } + for _, v := range req.PushToUserIDList { + var resp []*pbRelay.SingleMsgToUserPlatform + tempT := &pbRelay.SingelMsgToUserResultList{ + UserID: v, + } + userConnMap := ws.getUserAllCons(v) + for platform, userConn := range userConnMap { + if userConn != nil { + resultCode := sendMsgBatchToUser(userConn, replyBytes.Bytes(), req, platform, v) + if resultCode == 0 && utils.IsContainInt(platform, r.pushTerminal) { + tempT.OnlinePush = true + log.Info(req.OperationID, "PushSuperMsgToUser is success By Ws", "args", req.String(), "recvPlatForm", constant.PlatformIDToName(platform), "recvID", v) + temp := &pbRelay.SingleMsgToUserPlatform{ + ResultCode: resultCode, + RecvID: v, + RecvPlatFormID: int32(platform), + } + resp = append(resp, temp) + } + + } + } + tempT.Resp = resp + singleUserResult = append(singleUserResult, tempT) + + } + + return &pbRelay.OnlineBatchPushOneMsgResp{ + SinglePushResult: singleUserResult, + }, nil +} +func (r *RPCServer) OnlineBatchPushOneMsg(_ context.Context, req *pbRelay.OnlineBatchPushOneMsgReq) (*pbRelay.OnlineBatchPushOneMsgResp, error) { + log.NewInfo(req.OperationID, "BatchPushMsgToUser is arriving", req.String()) + var singleUserResult []*pbRelay.SingelMsgToUserResultList + + for _, v := range req.PushToUserIDList { + var resp []*pbRelay.SingleMsgToUserPlatform + tempT := &pbRelay.SingelMsgToUserResultList{ + UserID: v, + } + userConnMap := ws.getUserAllCons(v) + var platformList []int + for k, _ := range userConnMap { + platformList = append(platformList, k) + } + log.Debug(req.OperationID, "GetSingleUserMsgForPushPlatforms begin", req.MsgData.Seq, v, platformList, req.MsgData.String()) + needPushMapList := r.GetSingleUserMsgForPushPlatforms(req.OperationID, req.MsgData, v, platformList) + log.Debug(req.OperationID, "GetSingleUserMsgForPushPlatforms end", req.MsgData.Seq, v, platformList, len(needPushMapList)) + for platform, list := range needPushMapList { + if list != nil { + log.Debug(req.OperationID, "needPushMapList ", "userID: ", v, "platform: ", platform, "push msg num:") + //for _, v := range list { + // log.Debug(req.OperationID, "req.MsgData.MsgDataList begin", "len: ", len(req.MsgData.MsgDataList), v.String()) + // req.MsgData.MsgDataList = append(req.MsgData.MsgDataList, v) + // log.Debug(req.OperationID, "req.MsgData.MsgDataList end", "len: ", len(req.MsgData.MsgDataList)) + //} + msgBytes, err := proto.Marshal(list) + if err != nil { + log.Error(req.OperationID, "proto marshal err", err.Error()) + continue + } + req.MsgData.MsgDataList = msgBytes + //req.MsgData.MsgDataList = append(req.MsgData.MsgDataList, v) + log.Debug(req.OperationID, "r.encodeWsData no string") + //log.Debug(req.OperationID, "r.encodeWsData data0 list ", req.MsgData.MsgDataList[0].String()) + + log.Debug(req.OperationID, "r.encodeWsData ", req.MsgData.String()) + replyBytes, err := r.encodeWsData(req.MsgData, req.OperationID) + if err != nil { + log.Error(req.OperationID, "encodeWsData failed ", req.MsgData.String()) + continue + } + log.Debug(req.OperationID, "encodeWsData", "len: ", replyBytes.Len()) + resultCode := sendMsgBatchToUser(userConnMap[platform], replyBytes.Bytes(), req, platform, v) + if resultCode == 0 && utils.IsContainInt(platform, r.pushTerminal) { + tempT.OnlinePush = true + log.Info(req.OperationID, "PushSuperMsgToUser is success By Ws", "args", req.String(), "recv PlatForm", constant.PlatformIDToName(platform), "recvID", v) + temp := &pbRelay.SingleMsgToUserPlatform{ + ResultCode: resultCode, + RecvID: v, + RecvPlatFormID: int32(platform), + } + resp = append(resp, temp) + } + } else { + if utils.IsContainInt(platform, r.pushTerminal) { + tempT.OnlinePush = true + temp := &pbRelay.SingleMsgToUserPlatform{ + ResultCode: 0, + RecvID: v, + RecvPlatFormID: int32(platform), + } + resp = append(resp, temp) + } + } + } + tempT.Resp = resp + singleUserResult = append(singleUserResult, tempT) + } + return &pbRelay.OnlineBatchPushOneMsgResp{ + SinglePushResult: singleUserResult, + }, nil +} +func (r *RPCServer) encodeWsData(wsData *sdk_ws.MsgData, operationID string) (bytes.Buffer, error) { + log.Debug(operationID, "encodeWsData begin", wsData.String()) + msgBytes, err := proto.Marshal(wsData) + if err != nil { + log.NewError(operationID, "Marshal", err.Error()) + return bytes.Buffer{}, utils.Wrap(err, "") + } + log.Debug(operationID, "encodeWsData begin", wsData.String()) + mReply := Resp{ + ReqIdentifier: constant.WSPushMsg, + OperationID: operationID, + Data: msgBytes, + } + var replyBytes bytes.Buffer + enc := gob.NewEncoder(&replyBytes) + err = enc.Encode(mReply) + if err != nil { + log.NewError(operationID, "data encode err", err.Error()) + return bytes.Buffer{}, utils.Wrap(err, "") + } + return replyBytes, nil +} + +func (r *RPCServer) KickUserOffline(_ context.Context, req *pbRelay.KickUserOfflineReq) (*pbRelay.KickUserOfflineResp, error) { + log.NewInfo(req.OperationID, "KickUserOffline is arriving", req.String()) + for _, v := range req.KickUserIDList { + oldConnMap := ws.getUserAllCons(v) + if conn, ok := oldConnMap[int(req.PlatformID)]; ok { // user->map[platform->conn] + ws.sendKickMsg(conn, &UserConn{}) + } + } + return &pbRelay.KickUserOfflineResp{}, nil + +} +func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, RecvPlatForm int, RecvID string) (ResultCode int64) { err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) if err != nil { log.NewError(in.OperationID, "PushMsgToUser is failed By Ws", "Addr", conn.RemoteAddr().String(), - "error", err, "senderPlatform", constant.PlatformIDToName(in.MsgData.SenderPlatformID), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) + "error", err, "senderPlatform", constant.PlatformIDToName(int(in.MsgData.SenderPlatformID)), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) ResultCode = -2 return ResultCode } else { @@ -153,9 +311,23 @@ func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, Re } } -func genPlatformArray() (array []string) { +func sendMsgBatchToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlineBatchPushOneMsgReq, RecvPlatForm int, RecvID string) (ResultCode int64) { + err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) + if err != nil { + log.NewError(in.OperationID, "PushMsgToUser is failed By Ws", "Addr", conn.RemoteAddr().String(), + "error", err, "senderPlatform", constant.PlatformIDToName(int(in.MsgData.SenderPlatformID)), "recv Platform", RecvPlatForm, "args", in.String(), "recvID", RecvID) + ResultCode = -2 + return ResultCode + } else { + log.NewDebug(in.OperationID, "PushMsgToUser is success By Ws", "args", in.String(), "recv PlatForm", RecvPlatForm, "recvID", RecvID) + ResultCode = 0 + return ResultCode + } + +} +func genPlatformArray() (array []int) { for i := 1; i <= constant.LinuxPlatformID; i++ { - array = append(array, constant.PlatformIDToName(int32(i))) + array = append(array, i) } return array } diff --git a/internal/msg_gateway/gate/validate.go b/internal/msg_gateway/gate/validate.go index 31198a918..9a5558528 100644 --- a/internal/msg_gateway/gate/validate.go +++ b/internal/msg_gateway/gate/validate.go @@ -57,16 +57,28 @@ type SeqListData struct { SeqList []int64 `mapstructure:"seqList" validate:"required"` } -func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, errMsg string, returnData interface{}) { +func (ws *WServer) argsValidate(m *Req, r int32, operationID string) (isPass bool, errCode int32, errMsg string, returnData interface{}) { switch r { - case constant.WSSendMsg: - data := open_im_sdk.MsgData{} + case constant.WSGetNewestSeq: + data := open_im_sdk.GetMaxAndMinSeqReq{} if err := proto.Unmarshal(m.Data, &data); err != nil { - log.Error("", "Decode Data struct err", err.Error(), r) + log.Error(operationID, "Decode Data struct err", err.Error(), r) return false, 203, err.Error(), nil } if err := validate.Struct(data); err != nil { - log.Error("", "data args validate err", err.Error(), r) + log.Error(operationID, "data args validate err", err.Error(), r) + return false, 204, err.Error(), nil + + } + return true, 0, "", data + case constant.WSSendMsg: + data := open_im_sdk.MsgData{} + if err := proto.Unmarshal(m.Data, &data); err != nil { + log.Error(operationID, "Decode Data struct err", err.Error(), r) + return false, 203, err.Error(), nil + } + if err := validate.Struct(data); err != nil { + log.Error(operationID, "data args validate err", err.Error(), r) return false, 204, err.Error(), nil } @@ -74,11 +86,11 @@ func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, er case constant.WSSendSignalMsg: data := pbRtc.SignalReq{} if err := proto.Unmarshal(m.Data, &data); err != nil { - log.Error("", "Decode Data struct err", err.Error(), r) + log.Error(operationID, "Decode Data struct err", err.Error(), r) return false, 203, err.Error(), nil } if err := validate.Struct(data); err != nil { - log.Error("", "data args validate err", err.Error(), r) + log.Error(operationID, "data args validate err", err.Error(), r) return false, 204, err.Error(), nil } @@ -86,31 +98,16 @@ func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, er case constant.WSPullMsgBySeqList: data := open_im_sdk.PullMessageBySeqListReq{} if err := proto.Unmarshal(m.Data, &data); err != nil { - log.Error("", "Decode Data struct err", err.Error(), r) + log.Error(operationID, "Decode Data struct err", err.Error(), r) return false, 203, err.Error(), nil } if err := validate.Struct(data); err != nil { - log.Error("", "data args validate err", err.Error(), r) + log.Error(operationID, "data args validate err", err.Error(), r) return false, 204, err.Error(), nil } return true, 0, "", data - default: } - return false, 204, "args err", nil - - //b := bytes.NewBuffer(m.Data) - //dec := gob.NewDecoder(b) - //err := dec.Decode(&data) - //if err != nil { - // log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r) - // return false, 203, err.Error(), nil - //} - //if err := mapstructure.WeakDecode(m.Data, &data); err != nil { - // log.ErrorByKv("map to Data struct err", "", "err", err.Error(), "reqIdentifier", r) - // return false, 203, err.Error(), nil - //} else - } diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index ab801fd4f..223270197 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -9,7 +9,7 @@ import ( "Open_IM/pkg/utils" "bytes" "encoding/gob" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" "net/http" "sync" "time" @@ -19,21 +19,22 @@ import ( type UserConn struct { *websocket.Conn - w *sync.Mutex + w *sync.Mutex + PushedMaxSeq uint32 } type WServer struct { wsAddr string wsMaxConnNum int wsUpGrader *websocket.Upgrader - wsConnToUser map[*UserConn]map[string]string - wsUserToConn map[string]map[string]*UserConn + wsConnToUser map[*UserConn]map[int]string + wsUserToConn map[string]map[int]*UserConn } func (ws *WServer) onInit(wsPort int) { ws.wsAddr = ":" + utils.IntToString(wsPort) ws.wsMaxConnNum = config.Config.LongConnSvr.WebsocketMaxConnNum - ws.wsConnToUser = make(map[*UserConn]map[string]string) - ws.wsUserToConn = make(map[string]map[string]*UserConn) + ws.wsConnToUser = make(map[*UserConn]map[int]string) + ws.wsUserToConn = make(map[string]map[int]*UserConn) ws.wsUpGrader = &websocket.Upgrader{ HandshakeTimeout: time.Duration(config.Config.LongConnSvr.WebsocketTimeOut) * time.Second, ReadBufferSize: config.Config.LongConnSvr.WebsocketMaxMsgLen, @@ -50,21 +51,27 @@ func (ws *WServer) run() { } func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { - if ws.headerCheck(w, r) { - query := r.URL.Query() + query := r.URL.Query() + operationID := "" + if len(query["operationID"]) != 0 { + operationID = query["operationID"][0] + } else { + operationID = utils.OperationIDGenerator() + } + log.Debug(operationID, utils.GetSelfFuncName(), " args: ", query) + if ws.headerCheck(w, r, operationID) { conn, err := ws.wsUpGrader.Upgrade(w, r, nil) //Conn is obtained through the upgraded escalator if err != nil { - log.Error("", "upgrade http conn err", err, query) + log.Error(operationID, "upgrade http conn err", err.Error(), query) return } else { - //Connection mapping relationship, - //userID+" "+platformID->conn - //Initialize a lock for each user - newConn := &UserConn{conn, new(sync.Mutex)} + newConn := &UserConn{conn, new(sync.Mutex), 0} userCount++ - ws.addUserConn(query["sendID"][0], int32(utils.StringToInt64(query["platformID"][0])), newConn, query["token"][0]) + ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], operationID) go ws.readMsg(newConn) } + } else { + log.Error(operationID, "headerCheck failed ") } } @@ -75,18 +82,13 @@ func (ws *WServer) readMsg(conn *UserConn) { log.NewInfo("", "this is a pingMessage") } if err != nil { - uid, platform := ws.getUserUid(conn) - log.Error("", "WS ReadMsg error", "userIP", conn.RemoteAddr().String(), "userUid", uid, "platform", platform, "error", err.Error()) + log.Error("", "WS ReadMsg error ", " userIP", conn.RemoteAddr().String(), "userUid", "platform", "error", err.Error()) userCount-- ws.delUserConn(conn) return - } else { - //log.ErrorByKv("test", "", "msgType", msgType, "userIP", conn.RemoteAddr().String(), "userUid", ws.getUserUid(conn)) } ws.msgParse(conn, msg) - //ws.writeMsg(conn, 1, chat) } - } func (ws *WServer) SetWriteTimeout(conn *UserConn, timeout int) { @@ -108,37 +110,37 @@ func (ws *WServer) SetWriteTimeoutWriteMsg(conn *UserConn, a int, msg []byte, ti conn.SetWriteDeadline(time.Now().Add(time.Duration(timeout) * time.Second)) return conn.WriteMessage(a, msg) } - -func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int32, newConn *UserConn, token string, operationID string) { +func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn *UserConn, token string, operationID string) { switch config.Config.MultiLoginPolicy { case constant.AllLoginButSameTermKick: if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn] - if oldConn, ok := oldConnMap[constant.PlatformIDToName(platformID)]; ok { - log.NewWarn(operationID, uid, platformID, "kick old conn begin") + if oldConn, ok := oldConnMap[platformID]; ok { + log.NewDebug(operationID, uid, platformID, "kick old conn") // ws.sendKickMsg(oldConn, newConn) - log.NewWarn(operationID, uid, platformID, "kick old conn end") m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID)) - if err != nil && err != redis.ErrNil { - log.NewError(operationID, "get token from redis err", err.Error(), uid) + if err != nil && err != go_redis.Nil { + log.NewError(operationID, "get token from redis err", err.Error(), uid, constant.PlatformIDToName(platformID)) return } if m == nil { - log.NewError(operationID, "get token from redis err", "m is nil") + log.NewError(operationID, "get token from redis err", "m is nil", uid, constant.PlatformIDToName(platformID)) return } + log.NewDebug(operationID, "get token map is ", m, uid, constant.PlatformIDToName(platformID)) + for k, _ := range m { if k != token { m[k] = constant.KickedToken } } - log.NewDebug(operationID, "get map is ", m) + log.NewDebug(operationID, "set token map is ", m, uid, constant.PlatformIDToName(platformID)) err = db.DB.SetTokenMapByUidPid(uid, platformID, m) if err != nil { - log.NewError(operationID, "SetTokenMapByUidPid err", err.Error()) + log.NewError(operationID, "SetTokenMapByUidPid err", err.Error(), uid, platformID, m) return } err = oldConn.Close() - delete(oldConnMap, constant.PlatformIDToName(platformID)) + delete(oldConnMap, platformID) ws.wsUserToConn[uid] = oldConnMap if len(oldConnMap) == 0 { delete(ws.wsUserToConn, uid) @@ -147,9 +149,8 @@ func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int32, newCo if err != nil { log.NewError(operationID, "conn close err", err.Error(), uid, platformID) } - } else { - log.NewWarn(operationID, "abnormal uid-conn ", uid, platformID, oldConnMap[constant.PlatformIDToName(platformID)]) + log.NewWarn(operationID, "abnormal uid-conn ", uid, platformID, oldConnMap[platformID]) } } else { @@ -173,37 +174,37 @@ func (ws *WServer) sendKickMsg(oldConn, newConn *UserConn) { log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "Encode Msg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) return } - // ws.SetWriteTimeout(oldConn, 5) err = ws.writeMsg(oldConn, websocket.BinaryMessage, b.Bytes()) if err != nil { log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "sendKickMsg WS WriteMsg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) } } -func (ws *WServer) addUserConn(uid string, platformID int32, conn *UserConn, token string) { + +func (ws *WServer) addUserConn(uid string, platformID int, conn *UserConn, token string, operationID string) { rwLock.Lock() defer rwLock.Unlock() - operationID := utils.OperationIDGenerator() + log.Info(operationID, utils.GetSelfFuncName(), " args: ", uid, platformID, conn, token) callbackResp := callbackUserOnline(operationID, uid, platformID, token) if callbackResp.ErrCode != 0 { log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOnline resp:", callbackResp) } ws.MultiTerminalLoginChecker(uid, platformID, conn, token, operationID) if oldConnMap, ok := ws.wsUserToConn[uid]; ok { - oldConnMap[constant.PlatformIDToName(platformID)] = conn + oldConnMap[platformID] = conn ws.wsUserToConn[uid] = oldConnMap log.Debug(operationID, "user not first come in, add conn ", uid, platformID, conn, oldConnMap) } else { - i := make(map[string]*UserConn) - i[constant.PlatformIDToName(platformID)] = conn + i := make(map[int]*UserConn) + i[platformID] = conn ws.wsUserToConn[uid] = i log.Debug(operationID, "user first come in, new user, conn", uid, platformID, conn, ws.wsUserToConn[uid]) } if oldStringMap, ok := ws.wsConnToUser[conn]; ok { - oldStringMap[constant.PlatformIDToName(platformID)] = uid + oldStringMap[platformID] = uid ws.wsConnToUser[conn] = oldStringMap } else { - i := make(map[string]string) - i[constant.PlatformIDToName(platformID)] = uid + i := make(map[int]string) + i[platformID] = uid ws.wsConnToUser[conn] = i } count := 0 @@ -217,7 +218,8 @@ func (ws *WServer) delUserConn(conn *UserConn) { rwLock.Lock() defer rwLock.Unlock() operationID := utils.OperationIDGenerator() - var platform, uid string + var uid string + var platform int if oldStringMap, ok := ws.wsConnToUser[conn]; ok { for k, v := range oldStringMap { platform = k @@ -250,7 +252,7 @@ func (ws *WServer) delUserConn(conn *UserConn) { } } -func (ws *WServer) getUserConn(uid string, platform string) *UserConn { +func (ws *WServer) getUserConn(uid string, platform int) *UserConn { rwLock.RLock() defer rwLock.RUnlock() if connMap, ok := ws.wsUserToConn[uid]; ok { @@ -260,7 +262,7 @@ func (ws *WServer) getUserConn(uid string, platform string) *UserConn { } return nil } -func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn { +func (ws *WServer) getUserAllCons(uid string) map[int]*UserConn { rwLock.RLock() defer rwLock.RUnlock() if connMap, ok := ws.wsUserToConn[uid]; ok { @@ -268,46 +270,40 @@ func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn { } return nil } -func (ws *WServer) getUserUid(conn *UserConn) (uid, platform string) { - rwLock.RLock() - defer rwLock.RUnlock() - if stringMap, ok := ws.wsConnToUser[conn]; ok { - for k, v := range stringMap { - platform = k - uid = v - } - return uid, platform - } - return "", "" -} -func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { +//func (ws *WServer) getUserUid(conn *UserConn) (uid string, platform int) { +// rwLock.RLock() +// defer rwLock.RUnlock() +// +// if stringMap, ok := ws.wsConnToUser[conn]; ok { +// for k, v := range stringMap { +// platform = k +// uid = v +// } +// return uid, platform +// } +// return "", 0 +//} +func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request, operationID string) bool { status := http.StatusUnauthorized query := r.URL.Query() - operationID := "" - if len(query["operationID"]) != 0 { - operationID = query["operationID"][0] - } if len(query["token"]) != 0 && len(query["sendID"]) != 0 && len(query["platformID"]) != 0 { if ok, err, msg := token_verify.WsVerifyToken(query["token"][0], query["sendID"][0], query["platformID"][0], operationID); !ok { - // e := err.(*constant.ErrInfo) log.Error(operationID, "Token verify failed ", "query ", query, msg, err.Error()) w.Header().Set("Sec-Websocket-Version", "13") w.Header().Set("ws_err_msg", err.Error()) http.Error(w, err.Error(), status) return false } else { - log.Info(operationID, "Connection Authentication Success", "", "token", query["token"][0], "userID", query["sendID"][0]) + log.Info(operationID, "Connection Authentication Success", "", "token ", query["token"][0], "userID ", query["sendID"][0], "platformID ", query["platformID"][0]) return true } } else { - log.Error(operationID, "Args err", "query", query) + log.Error(operationID, "Args err ", "query ", query) w.Header().Set("Sec-Websocket-Version", "13") - w.Header().Set("ws_err_msg", "args err, need token, sendID, platformID") - http.Error(w, http.StatusText(status), status) + errMsg := "args err, need token, sendID, platformID" + w.Header().Set("ws_err_msg", errMsg) + http.Error(w, errMsg, status) return false } } -func genMapKey(uid string, platformID int32) string { - return uid + " " + constant.PlatformIDToName(platformID) -} diff --git a/internal/msg_transfer/logic/init.go b/internal/msg_transfer/logic/init.go index f8c424dcc..38d0e5b66 100644 --- a/internal/msg_transfer/logic/init.go +++ b/internal/msg_transfer/logic/init.go @@ -4,7 +4,6 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/kafka" - "Open_IM/pkg/common/log" "Open_IM/pkg/statistics" "fmt" "sync" @@ -14,15 +13,16 @@ const OnlineTopicBusy = 1 const OnlineTopicVacancy = 0 const Msg = 2 const ConsumerMsgs = 3 -const UserMessages = 4 +const AggregationMessages = 4 const MongoMessages = 5 const ChannelNum = 100 var ( persistentCH PersistentConsumerHandler - historyCH OnlineHistoryConsumerHandler - offlineHistoryCH OfflineHistoryConsumerHandler + historyCH OnlineHistoryRedisConsumerHandler + historyMongoCH OnlineHistoryMongoConsumerHandler producer *kafka.Producer + producerToMongo *kafka.Producer cmdCh chan Cmd2Value onlineTopicStatus int w *sync.Mutex @@ -38,12 +38,13 @@ func Init() { w = new(sync.Mutex) persistentCH.Init() historyCH.Init(cmdCh) + historyMongoCH.Init() onlineTopicStatus = OnlineTopicVacancy - log.Debug("come msg transfer ts", config.Config.Kafka.ConsumerGroupID.MsgToMongoOffline, config.Config.Kafka.Ws2mschatOffline.Topic) //offlineHistoryCH.Init(cmdCh) statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) statistics.NewStatistics(&groupMsgCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second groupMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic) + producerToMongo = kafka.NewKafkaProducer(config.Config.Kafka.MsgToMongo.Addr, config.Config.Kafka.MsgToMongo.Topic) } func Run() { //register mysqlConsumerHandler to @@ -53,6 +54,7 @@ func Run() { fmt.Println("not start mysql consumer") } go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH) + go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH) //go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH) } func SetOnlineTopicStatus(status int) { diff --git a/internal/msg_transfer/logic/offline_history_msg_handler.go b/internal/msg_transfer/logic/offline_history_msg_handler.go deleted file mode 100644 index b7ee3b2e3..000000000 --- a/internal/msg_transfer/logic/offline_history_msg_handler.go +++ /dev/null @@ -1,313 +0,0 @@ -package logic - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - "Open_IM/pkg/common/db" - kfk "Open_IM/pkg/common/kafka" - "Open_IM/pkg/common/log" - pbMsg "Open_IM/pkg/proto/chat" - "Open_IM/pkg/utils" - "github.com/Shopify/sarama" - "github.com/golang/protobuf/proto" - "time" -) - -type OfflineHistoryConsumerHandler struct { - msgHandle map[string]fcb - historyConsumerGroup *kfk.MConsumerGroup - cmdCh chan Cmd2Value - msgCh chan Cmd2Value - chArrays [ChannelNum]chan Cmd2Value - msgDistributionCh chan Cmd2Value -} - -func (mc *OfflineHistoryConsumerHandler) Init(cmdCh chan Cmd2Value) { - mc.msgHandle = make(map[string]fcb) - mc.msgDistributionCh = make(chan Cmd2Value) //no buffer channel - go mc.MessagesDistributionHandle() - mc.cmdCh = cmdCh - mc.msgCh = make(chan Cmd2Value, 1000) - for i := 0; i < ChannelNum; i++ { - mc.chArrays[i] = make(chan Cmd2Value, 1000) - go mc.Run(i) - } - if config.Config.ReliableStorage { - mc.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = mc.handleChatWs2Mongo - } else { - mc.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = mc.handleChatWs2MongoLowReliability - - } - mc.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, - OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschatOffline.Topic}, - config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMongoOffline) - -} -func (och *OfflineHistoryConsumerHandler) Run(channelID int) { - for { - select { - case cmd := <-och.chArrays[channelID]: - switch cmd.Cmd { - case UserMessages: - msgChannelValue := cmd.Value.(MsgChannelValue) - msgList := msgChannelValue.msgList - triggerID := msgChannelValue.triggerID - storageMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) - pushMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) - log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.userID, len(msgList)) - for _, v := range msgList { - log.Debug(triggerID, "msg come to storage center", v.String()) - isHistory := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsHistory) - isSenderSync := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsSenderSync) - if isHistory { - storageMsgList = append(storageMsgList, v) - } - if !(!isSenderSync && msgChannelValue.userID == v.MsgData.SendID) { - pushMsgList = append(pushMsgList, v) - } - } - - //switch msgChannelValue.msg.MsgData.SessionType { - //case constant.SingleChatType: - //case constant.GroupChatType: - //case constant.NotificationChatType: - //default: - // log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) - // return - //} - - err, _ := saveUserChatList(msgChannelValue.userID, storageMsgList, triggerID) - if err != nil { - singleMsgFailedCount += uint64(len(storageMsgList)) - log.NewError(triggerID, "single data insert to mongo err", err.Error(), storageMsgList) - } else { - singleMsgSuccessCountMutex.Lock() - singleMsgSuccessCount += uint64(len(storageMsgList)) - singleMsgSuccessCountMutex.Unlock() - for _, v := range pushMsgList { - sendMessageToPush(v, msgChannelValue.userID) - } - - } - } - } - } -} -func (och *OfflineHistoryConsumerHandler) MessagesDistributionHandle() { - UserAggregationMsgs := make(map[string][]*pbMsg.MsgDataToMQ, ChannelNum) - for { - select { - case cmd := <-och.msgDistributionCh: - switch cmd.Cmd { - case ConsumerMsgs: - triggerChannelValue := cmd.Value.(TriggerChannelValue) - triggerID := triggerChannelValue.triggerID - consumerMessages := triggerChannelValue.cmsgList - //Aggregation map[userid]message list - log.Debug(triggerID, "batch messages come to distribution center", len(consumerMessages)) - for i := 0; i < len(consumerMessages); i++ { - msgFromMQ := pbMsg.MsgDataToMQ{} - err := proto.Unmarshal(consumerMessages[i].Value, &msgFromMQ) - if err != nil { - log.Error(triggerID, "msg_transfer Unmarshal msg err", "msg", string(consumerMessages[i].Value), "err", err.Error()) - return - } - log.Debug(triggerID, "single msg come to distribution center", msgFromMQ.String()) - if oldM, ok := UserAggregationMsgs[string(consumerMessages[i].Key)]; ok { - oldM = append(oldM, &msgFromMQ) - UserAggregationMsgs[string(consumerMessages[i].Key)] = oldM - } else { - m := make([]*pbMsg.MsgDataToMQ, 0, 100) - m = append(m, &msgFromMQ) - UserAggregationMsgs[string(consumerMessages[i].Key)] = m - } - } - log.Debug(triggerID, "generate map list users len", len(UserAggregationMsgs)) - for userID, v := range UserAggregationMsgs { - if len(v) >= 0 { - channelID := getHashCode(userID) % ChannelNum - go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { - och.chArrays[cID] <- Cmd2Value{Cmd: UserMessages, Value: MsgChannelValue{userID: userID, msgList: messages, triggerID: triggerID}} - }(channelID, userID, v) - } - } - } - } - } - -} -func (mc *OfflineHistoryConsumerHandler) handleChatWs2Mongo(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { - msg := cMsg.Value - now := time.Now() - msgFromMQ := pbMsg.MsgDataToMQ{} - err := proto.Unmarshal(msg, &msgFromMQ) - if err != nil { - log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) - return - } - operationID := msgFromMQ.OperationID - log.NewInfo(operationID, "msg come mongo!!!", "", "msg", string(msg)) - //Control whether to store offline messages (mongo) - isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory) - //Control whether to store history messages (mysql) - 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(msgFromMQ.OperationID, "msg_transfer msg type = SingleChatType", isHistory, isPersist) - if isHistory { - err := saveUserChat(msgKey, &msgFromMQ) - if err != nil { - singleMsgFailedCount++ - log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) - return - } - singleMsgSuccessCountMutex.Lock() - singleMsgSuccessCount++ - singleMsgSuccessCountMutex.Unlock() - log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) - } - if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { - } else { - go sendMessageToPush(&msgFromMQ, msgKey) - } - log.NewDebug(operationID, "saveSingleMsg cost time ", time.Since(now)) - 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 - } - groupMsgCount++ - } - go sendMessageToPush(&msgFromMQ, msgFromMQ.MsgData.RecvID) - log.NewDebug(operationID, "saveGroupMsg cost time ", time.Since(now)) - - case constant.NotificationChatType: - log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = NotificationChatType", isHistory, isPersist) - if isHistory { - err := saveUserChat(msgKey, &msgFromMQ) - if err != nil { - log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) - return - } - log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) - } - if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { - } else { - go sendMessageToPush(&msgFromMQ, msgKey) - } - log.NewDebug(operationID, "saveUserChat cost time ", time.Since(now)) - default: - log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) - return - } - sess.MarkMessage(cMsg, "") - log.NewDebug(msgFromMQ.OperationID, "msg_transfer handle topic data to database success...", msgFromMQ.String()) -} -func (mc *OfflineHistoryConsumerHandler) handleChatWs2MongoLowReliability(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { - msg := cMsg.Value - msgFromMQ := pbMsg.MsgDataToMQ{} - err := proto.Unmarshal(msg, &msgFromMQ) - if err != nil { - log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) - return - } - operationID := msgFromMQ.OperationID - log.NewInfo(operationID, "msg come mongo!!!", "", "msg", string(msg)) - //Control whether to store offline messages (mongo) - isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory) - isSenderSync := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsSenderSync) - if isHistory { - seq, err := db.DB.IncrUserSeq(msgKey) - if err != nil { - log.NewError(operationID, "data insert to redis err", err.Error(), string(msg)) - return - } - sess.MarkMessage(cMsg, "") - msgFromMQ.MsgData.Seq = uint32(seq) - log.Debug(operationID, "send ch msg is ", msgFromMQ.String()) - //mc.msgCh <- Cmd2Value{Cmd: Msg, Value: MsgChannelValue{msgKey, msgFromMQ}} - //err := saveUserChat(msgKey, &msgFromMQ) - //if err != nil { - // singleMsgFailedCount++ - // log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) - // return - //} - //singleMsgSuccessCountMutex.Lock() - //singleMsgSuccessCount++ - //singleMsgSuccessCountMutex.Unlock() - //log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", time.Since(now)) - } else { - if !(!isSenderSync && msgKey == msgFromMQ.MsgData.SendID) { - go sendMessageToPush(&msgFromMQ, msgKey) - } - } -} - -func (OfflineHistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } -func (OfflineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } - -//func (mc *OfflineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, -// claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group -// //log.NewDebug("", "offline new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) -// //for msg := range claim.Messages() { -// // log.NewDebug("", "kafka get info to delay mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "offline") -// // //mc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) -// //} -// for msg := range claim.Messages() { -// if GetOnlineTopicStatus() == OnlineTopicVacancy { -// log.NewDebug("", "vacancy offline kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) -// mc.msgHandle[msg.Topic](msg, string(msg.Key), sess) -// } else { -// select { -// case <-mc.cmdCh: -// log.NewDebug("", "cmd offline kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) -// case <-time.After(time.Millisecond * time.Duration(100)): -// log.NewDebug("", "timeout offline kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) -// } -// mc.msgHandle[msg.Topic](msg, string(msg.Key), sess) -// } -// } -// -// return nil -//} -func (och *OfflineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, - claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group - log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) - cMsg := make([]*sarama.ConsumerMessage, 0, 500) - t := time.NewTicker(time.Duration(500) * time.Millisecond) - var triggerID string - for msg := range claim.Messages() { - //och.TriggerCmd(OnlineTopicBusy) - cMsg = append(cMsg, msg) - select { - case <-t.C: - if len(cMsg) >= 0 { - triggerID = utils.OperationIDGenerator() - log.Debug(triggerID, "timer trigger msg consumer start", len(cMsg)) - och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ - triggerID: triggerID, cmsgList: cMsg}} - sess.MarkMessage(msg, "") - cMsg = cMsg[0:0] - log.Debug(triggerID, "timer trigger msg consumer end", len(cMsg)) - } - default: - if len(cMsg) >= 500 { - triggerID = utils.OperationIDGenerator() - log.Debug(triggerID, "length trigger msg consumer start", len(cMsg)) - och.msgDistributionCh <- Cmd2Value{Cmd: ConsumerMsgs, Value: TriggerChannelValue{ - triggerID: triggerID, cmsgList: cMsg}} - sess.MarkMessage(msg, "") - cMsg = cMsg[0:0] - log.Debug(triggerID, "length trigger msg consumer end", len(cMsg)) - } - - } - log.NewDebug("", "online kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "online", msg.Offset, claim.HighWaterMarkOffset()) - - } - return nil -} diff --git a/internal/msg_transfer/logic/online_history_msg_handler.go b/internal/msg_transfer/logic/online_history_msg_handler.go index 84b33cb4f..908d28b27 100644 --- a/internal/msg_transfer/logic/online_history_msg_handler.go +++ b/internal/msg_transfer/logic/online_history_msg_handler.go @@ -9,10 +9,8 @@ import ( "Open_IM/pkg/grpc-etcdv3/getcdv3" pbMsg "Open_IM/pkg/proto/chat" pbPush "Open_IM/pkg/proto/push" - server_api_params "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" - "errors" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" "hash/crc32" @@ -22,10 +20,10 @@ import ( ) type MsgChannelValue struct { - userID string - triggerID string - msgList []*pbMsg.MsgDataToMQ - lastSeq uint64 + aggregationID string //maybe userID or super groupID + triggerID string + msgList []*pbMsg.MsgDataToMQ + lastSeq uint64 } type TriggerChannelValue struct { triggerID string @@ -36,28 +34,21 @@ type Cmd2Value struct { Cmd int Value interface{} } -type OnlineHistoryConsumerHandler struct { +type OnlineHistoryRedisConsumerHandler struct { msgHandle map[string]fcb historyConsumerGroup *kfk.MConsumerGroup - cmdCh chan Cmd2Value chArrays [ChannelNum]chan Cmd2Value - chMongoArrays [ChannelNum]chan Cmd2Value msgDistributionCh chan Cmd2Value } -func (och *OnlineHistoryConsumerHandler) Init(cmdCh chan Cmd2Value) { +func (och *OnlineHistoryRedisConsumerHandler) Init(cmdCh chan Cmd2Value) { och.msgHandle = make(map[string]fcb) och.msgDistributionCh = make(chan Cmd2Value) //no buffer channel go och.MessagesDistributionHandle() - och.cmdCh = cmdCh for i := 0; i < ChannelNum; i++ { och.chArrays[i] = make(chan Cmd2Value, 50) go och.Run(i) } - for i := 0; i < ChannelNum; i++ { - och.chMongoArrays[i] = make(chan Cmd2Value, 10000) - go och.MongoMessageRun(i) - } if config.Config.ReliableStorage { och.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = och.handleChatWs2Mongo } else { @@ -66,60 +57,33 @@ func (och *OnlineHistoryConsumerHandler) Init(cmdCh chan Cmd2Value) { } och.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschat.Topic}, - config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMongo) + config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToRedis) } -func (och *OnlineHistoryConsumerHandler) TriggerCmd(status int) { - operationID := utils.OperationIDGenerator() - err := sendCmd(och.cmdCh, Cmd2Value{Cmd: status, Value: ""}, 1) - if err != nil { - log.Error(operationID, "TriggerCmd failed ", err.Error(), status) - return - } - log.Debug(operationID, "TriggerCmd success", status) - -} -func sendCmd(ch chan Cmd2Value, value Cmd2Value, timeout int64) error { - var flag = 0 - select { - case ch <- value: - flag = 1 - case <-time.After(time.Second * time.Duration(timeout)): - flag = 2 - } - if flag == 1 { - return nil - } else { - return errors.New("send cmd timeout") - } -} -func (och *OnlineHistoryConsumerHandler) Run(channelID int) { +func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) { for { select { case cmd := <-och.chArrays[channelID]: switch cmd.Cmd { - case UserMessages: + case AggregationMessages: msgChannelValue := cmd.Value.(MsgChannelValue) msgList := msgChannelValue.msgList triggerID := msgChannelValue.triggerID storageMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) - notStoragepushMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) - log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.userID, len(msgList)) + notStoragePushMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) + log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.aggregationID, len(msgList)) for _, v := range msgList { log.Debug(triggerID, "msg come to storage center", v.String()) - if v.MsgData == nil { - log.NewWarn(triggerID, "msg come to storage center nil", v.String(), v.OperationID, msgChannelValue.userID) - continue - } isHistory := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsHistory) isSenderSync := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsSenderSync) if isHistory { storageMsgList = append(storageMsgList, v) //log.NewWarn(triggerID, "storageMsgList to mongodb client msgID: ", v.MsgData.ClientMsgID) } else { - if !(!isSenderSync && msgChannelValue.userID == v.MsgData.SendID) { - notStoragepushMsgList = append(notStoragepushMsgList, v) + if !(!isSenderSync && msgChannelValue.aggregationID == v.MsgData.SendID) { + notStoragePushMsgList = append(notStoragePushMsgList, v) } + } } @@ -132,8 +96,8 @@ func (och *OnlineHistoryConsumerHandler) Run(channelID int) { // log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) // return //} - log.Debug(triggerID, "msg storage length", len(storageMsgList), "push length", len(notStoragepushMsgList)) - err, lastSeq := saveUserChatList(msgChannelValue.userID, storageMsgList, triggerID) + log.Debug(triggerID, "msg storage length", len(storageMsgList), "push length", len(notStoragePushMsgList)) + err, lastSeq := saveUserChatList(msgChannelValue.aggregationID, storageMsgList, triggerID) if err != nil { singleMsgFailedCount += uint64(len(storageMsgList)) log.NewError(triggerID, "single data insert to redis err", err.Error(), storageMsgList) @@ -141,72 +105,79 @@ func (och *OnlineHistoryConsumerHandler) Run(channelID int) { singleMsgSuccessCountMutex.Lock() singleMsgSuccessCount += uint64(len(storageMsgList)) singleMsgSuccessCountMutex.Unlock() - och.SendMessageToMongoCH(msgChannelValue.userID, triggerID, storageMsgList, lastSeq) + och.SendMessageToMongoCH(msgChannelValue.aggregationID, triggerID, storageMsgList, lastSeq) go func(push, storage []*pbMsg.MsgDataToMQ) { for _, v := range storage { - sendMessageToPush(v, msgChannelValue.userID) + sendMessageToPush(v, msgChannelValue.aggregationID) } for _, x := range push { - sendMessageToPush(x, msgChannelValue.userID) + sendMessageToPush(x, msgChannelValue.aggregationID) } - }(notStoragepushMsgList, storageMsgList) + }(notStoragePushMsgList, storageMsgList) } } } } } -func (och *OnlineHistoryConsumerHandler) SendMessageToMongoCH(userID string, triggerID string, messages []*pbMsg.MsgDataToMQ, lastSeq uint64) { - hashCode := getHashCode(userID) - channelID := hashCode % ChannelNum - log.Debug(triggerID, "generate channelID", hashCode, channelID, userID) - //go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { - och.chMongoArrays[channelID] <- Cmd2Value{Cmd: MongoMessages, Value: MsgChannelValue{userID: userID, msgList: messages, triggerID: triggerID, lastSeq: lastSeq}} -} -func (och *OnlineHistoryConsumerHandler) MongoMessageRun(channelID int) { - for { - select { - case cmd := <-och.chMongoArrays[channelID]: - switch cmd.Cmd { - case MongoMessages: - msgChannelValue := cmd.Value.(MsgChannelValue) - msgList := msgChannelValue.msgList - triggerID := msgChannelValue.triggerID - userID := msgChannelValue.userID - lastSeq := msgChannelValue.lastSeq - err := db.DB.BatchInsertChat2DB(userID, msgList, triggerID, lastSeq) - if err != nil { - log.NewError(triggerID, "single data insert to mongo err", err.Error(), msgList) - } - for _, v := range msgList { - if v.MsgData.ContentType == constant.DeleteMessageNotification { - tips := server_api_params.TipsComm{} - DeleteMessageTips := server_api_params.DeleteMessageTips{} - err := proto.Unmarshal(v.MsgData.Content, &tips) - if err != nil { - log.NewError(triggerID, "tips unmarshal err:", err.Error(), v.String()) - continue - } - err = proto.Unmarshal(tips.Detail, &DeleteMessageTips) - if err != nil { - log.NewError(triggerID, "deleteMessageTips unmarshal err:", err.Error(), v.String()) - continue - } - if unexistSeqList, err := db.DB.DelMsgBySeqList(DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID); err != nil { - log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList) - } - - } - } - } - } +func (och *OnlineHistoryRedisConsumerHandler) SendMessageToMongoCH(aggregationID string, triggerID string, messages []*pbMsg.MsgDataToMQ, lastSeq uint64) { + pid, offset, err := producerToMongo.SendMessage(&pbMsg.MsgDataToMongoByMQ{LastSeq: lastSeq, AggregationID: aggregationID, MessageList: messages, TriggerID: triggerID}, aggregationID, triggerID) + if err != nil { + log.Error(triggerID, "kafka send failed", "send data", len(messages), "pid", pid, "offset", offset, "err", err.Error(), "key", aggregationID) + } else { + // log.NewWarn(m.OperationID, "sendMsgToKafka client msgID ", m.MsgData.ClientMsgID) } + //hashCode := getHashCode(aggregationID) + //channelID := hashCode % ChannelNum + //log.Debug(triggerID, "generate channelID", hashCode, channelID, aggregationID) + ////go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { + //och.chMongoArrays[channelID] <- Cmd2Value{Cmd: MongoMessages, Value: MsgChannelValue{aggregationID: aggregationID, msgList: messages, triggerID: triggerID, lastSeq: lastSeq}} } -func (och *OnlineHistoryConsumerHandler) MessagesDistributionHandle() { +//func (och *OnlineHistoryRedisConsumerHandler) MongoMessageRun(channelID int) { +// for { +// select { +// case cmd := <-och.chMongoArrays[channelID]: +// switch cmd.Cmd { +// case MongoMessages: +// msgChannelValue := cmd.Value.(MsgChannelValue) +// msgList := msgChannelValue.msgList +// triggerID := msgChannelValue.triggerID +// aggregationID := msgChannelValue.aggregationID +// lastSeq := msgChannelValue.lastSeq +// err := db.DB.BatchInsertChat2DB(aggregationID, msgList, triggerID, lastSeq) +// if err != nil { +// log.NewError(triggerID, "single data insert to mongo err", err.Error(), msgList) +// } +// for _, v := range msgList { +// if v.MsgData.ContentType == constant.DeleteMessageNotification { +// tips := server_api_params.TipsComm{} +// DeleteMessageTips := server_api_params.DeleteMessageTips{} +// err := proto.Unmarshal(v.MsgData.Content, &tips) +// if err != nil { +// log.NewError(triggerID, "tips unmarshal err:", err.Error(), v.String()) +// continue +// } +// err = proto.Unmarshal(tips.Detail, &DeleteMessageTips) +// if err != nil { +// log.NewError(triggerID, "deleteMessageTips unmarshal err:", err.Error(), v.String()) +// continue +// } +// if unexistSeqList, err := db.DB.DelMsgBySeqList(DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID); err != nil { +// log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList) +// } +// +// } +// } +// } +// } +// } +//} + +func (och *OnlineHistoryRedisConsumerHandler) MessagesDistributionHandle() { for { - UserAggregationMsgs := make(map[string][]*pbMsg.MsgDataToMQ, ChannelNum) + aggregationMsgs := make(map[string][]*pbMsg.MsgDataToMQ, ChannelNum) select { case cmd := <-och.msgDistributionCh: switch cmd.Cmd { @@ -223,27 +194,24 @@ func (och *OnlineHistoryConsumerHandler) MessagesDistributionHandle() { log.Error(triggerID, "msg_transfer Unmarshal msg err", "msg", string(consumerMessages[i].Value), "err", err.Error()) return } - log.Debug(triggerID, "single msg come to distribution center", string(consumerMessages[i].Key)) - if oldM, ok := UserAggregationMsgs[string(consumerMessages[i].Key)]; ok { + log.Debug(triggerID, "single msg come to distribution center", msgFromMQ.String(), string(consumerMessages[i].Key)) + if oldM, ok := aggregationMsgs[string(consumerMessages[i].Key)]; ok { oldM = append(oldM, &msgFromMQ) - UserAggregationMsgs[string(consumerMessages[i].Key)] = oldM + aggregationMsgs[string(consumerMessages[i].Key)] = oldM } else { m := make([]*pbMsg.MsgDataToMQ, 0, 100) m = append(m, &msgFromMQ) - UserAggregationMsgs[string(consumerMessages[i].Key)] = m + aggregationMsgs[string(consumerMessages[i].Key)] = m } } - log.Debug(triggerID, "generate map list users len", len(UserAggregationMsgs), UserAggregationMsgs) - for userID, v := range UserAggregationMsgs { + log.Debug(triggerID, "generate map list users len", len(aggregationMsgs)) + for aggregationID, v := range aggregationMsgs { if len(v) >= 0 { - hashCode := getHashCode(userID) + hashCode := getHashCode(aggregationID) channelID := hashCode % ChannelNum - log.Debug(triggerID, "generate channelID", hashCode, channelID, userID, len(v)) - for _, y := range v { - log.Debug(triggerID, "single user slice is ", y.String()) - } + log.Debug(triggerID, "generate channelID", hashCode, channelID, aggregationID) //go func(cID uint32, userID string, messages []*pbMsg.MsgDataToMQ) { - och.chArrays[channelID] <- Cmd2Value{Cmd: UserMessages, Value: MsgChannelValue{userID: userID, msgList: v, triggerID: triggerID}} + och.chArrays[channelID] <- Cmd2Value{Cmd: AggregationMessages, Value: MsgChannelValue{aggregationID: aggregationID, msgList: v, triggerID: triggerID}} //}(channelID, userID, v) } } @@ -253,7 +221,7 @@ func (och *OnlineHistoryConsumerHandler) MessagesDistributionHandle() { } } -func (mc *OnlineHistoryConsumerHandler) handleChatWs2Mongo(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { +func (mc *OnlineHistoryRedisConsumerHandler) handleChatWs2Mongo(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { msg := cMsg.Value now := time.Now() msgFromMQ := pbMsg.MsgDataToMQ{} @@ -325,7 +293,7 @@ func (mc *OnlineHistoryConsumerHandler) handleChatWs2Mongo(cMsg *sarama.Consumer log.NewDebug(msgFromMQ.OperationID, "msg_transfer handle topic data to database success...", msgFromMQ.String()) } -func (och *OnlineHistoryConsumerHandler) handleChatWs2MongoLowReliability(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { +func (och *OnlineHistoryRedisConsumerHandler) handleChatWs2MongoLowReliability(cMsg *sarama.ConsumerMessage, msgKey string, sess sarama.ConsumerGroupSession) { msg := cMsg.Value msgFromMQ := pbMsg.MsgDataToMQ{} err := proto.Unmarshal(msg, &msgFromMQ) @@ -365,10 +333,10 @@ func (och *OnlineHistoryConsumerHandler) handleChatWs2MongoLowReliability(cMsg * } } -func (OnlineHistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } -func (OnlineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } +func (OnlineHistoryRedisConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (OnlineHistoryRedisConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } -//func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, +//func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, // claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group // log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) // for msg := range claim.Messages() { @@ -385,7 +353,7 @@ func (OnlineHistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error // return nil //} -func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, +func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group for { @@ -480,7 +448,7 @@ func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupS return nil } -//func (och *OnlineHistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, +//func (och *OnlineHistoryRedisConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, // claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group // // for { @@ -544,7 +512,7 @@ func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { log.Info(message.OperationID, "msg_transfer send message to push", "message", message.String()) 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) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName, message.OperationID) if grpcConn == nil { log.Error(rpcPushMsg.OperationID, "rpc dial failed", "push data", rpcPushMsg.String()) pid, offset, err := producer.SendMessage(&mqPushMsg, mqPushMsg.PushToUserID, rpcPushMsg.OperationID) diff --git a/internal/msg_transfer/logic/online_msg_to_mongo_handler.go b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go new file mode 100644 index 000000000..dae6571f8 --- /dev/null +++ b/internal/msg_transfer/logic/online_msg_to_mongo_handler.go @@ -0,0 +1,79 @@ +package logic + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + server_api_params "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/Shopify/sarama" + "github.com/golang/protobuf/proto" +) + +type OnlineHistoryMongoConsumerHandler struct { + msgHandle map[string]fcb + historyConsumerGroup *kfk.MConsumerGroup +} + +func (och *OnlineHistoryMongoConsumerHandler) Init() { + och.msgHandle = make(map[string]fcb) + och.msgHandle[config.Config.Kafka.MsgToMongo.Topic] = och.handleChatWs2Mongo + och.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0, + OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.MsgToMongo.Topic}, + config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMongo) + +} +func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(cMsg *sarama.ConsumerMessage, msgKey string, _ sarama.ConsumerGroupSession) { + msg := cMsg.Value + msgFromMQ := pbMsg.MsgDataToMongoByMQ{} + err := proto.Unmarshal(msg, &msgFromMQ) + if err != nil { + log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) + return + } + err = db.DB.BatchInsertChat2DB(msgFromMQ.AggregationID, msgFromMQ.MessageList, msgFromMQ.TriggerID, msgFromMQ.LastSeq) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "single data insert to mongo err", err.Error(), msgFromMQ.MessageList) + } + for _, v := range msgFromMQ.MessageList { + if v.MsgData.ContentType == constant.DeleteMessageNotification { + tips := server_api_params.TipsComm{} + DeleteMessageTips := server_api_params.DeleteMessageTips{} + err := proto.Unmarshal(v.MsgData.Content, &tips) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "tips unmarshal err:", err.Error(), v.String()) + continue + } + err = proto.Unmarshal(tips.Detail, &DeleteMessageTips) + if err != nil { + log.NewError(msgFromMQ.TriggerID, "deleteMessageTips unmarshal err:", err.Error(), v.String()) + continue + } + if unexistSeqList, err := db.DB.DelMsgBySeqList(DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID); err != nil { + log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList) + } + + } + } +} + +func (OnlineHistoryMongoConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (OnlineHistoryMongoConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } + +func (och *OnlineHistoryMongoConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, + claim sarama.ConsumerGroupClaim) error { // a instance in the consumer group + log.NewDebug("", "online new session msg come", claim.HighWaterMarkOffset(), claim.Topic(), claim.Partition()) + for msg := range claim.Messages() { + log.NewDebug("", "kafka get info to mongo", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key)) + if len(msg.Value) != 0 { + och.msgHandle[msg.Topic](msg, string(msg.Key), sess) + } else { + log.Error("", "mongo msg get from kafka but is nil", msg.Key) + } + sess.MarkMessage(msg, "") + } + return nil +} diff --git a/internal/msg_transfer/logic/persistent_msg_handler.go b/internal/msg_transfer/logic/persistent_msg_handler.go index 338cc2606..4a313d1ad 100644 --- a/internal/msg_transfer/logic/persistent_msg_handler.go +++ b/internal/msg_transfer/logic/persistent_msg_handler.go @@ -56,6 +56,8 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(cMsg *sarama.ConsumerMes if msgKey == msgFromMQ.MsgData.SendID { tag = true } + case constant.SuperGroupChatType: + tag = true } if tag { log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg)) diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index 8e269e1dd..e8fd576a5 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -20,7 +20,7 @@ func callbackOfflinePush(operationID, userID string, msg *commonPb.MsgData) cbAp OperationID: operationID, UserID: userID, PlatformID: msg.SenderPlatformID, - Platform: constant.PlatformIDToName(msg.SenderPlatformID), + Platform: constant.PlatformIDToName(int(msg.SenderPlatformID)), }, OfflinePushInfo: msg.OfflinePushInfo, SendID: msg.SendID, diff --git a/internal/push/logic/push_rpc_server.go b/internal/push/logic/push_rpc_server.go index ba656a7d0..8fbf4e7d1 100644 --- a/internal/push/logic/push_rpc_server.go +++ b/internal/push/logic/push_rpc_server.go @@ -2,6 +2,7 @@ package logic import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/push" @@ -63,7 +64,12 @@ func (r *RPCServer) run() { } func (r *RPCServer) PushMsg(_ context.Context, pbData *pbPush.PushMsgReq) (*pbPush.PushMsgResp, error) { //Call push module to send message to the user - MsgToUser(pbData) + switch pbData.MsgData.SessionType { + case constant.SuperGroupChatType: + MsgToSuperGroupUser(pbData) + default: + 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 e0dedb9c6..d83556c3b 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -39,7 +39,7 @@ type AtContent struct { var grpcCons []*grpc.ClientConn func MsgToUser(pushMsg *pbPush.PushMsgReq) { - var wsResult []*pbRelay.SingleMsgToUser + var wsResult []*pbRelay.SingelMsgToUserResultList isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) log.Debug(pushMsg.OperationID, "Get msg from msg_transfer And push msg", pushMsg.String()) if len(grpcCons) == 0 { @@ -47,107 +47,215 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) { grpcCons = getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) } //Online push message + log.Debug(pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) + for _, v := range grpcCons { + msgClient := pbRelay.NewOnlineMessageRelayServiceClient(v) + reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: []string{pushMsg.PushToUserID}}) + if err != nil { + log.NewError("SuperGroupOnlineBatchPushOneMsg push data to client rpc err", pushMsg.OperationID, "err", err) + continue + } + if reply != nil && reply.SinglePushResult != nil { + wsResult = append(wsResult, reply.SinglePushResult...) + } + } + log.NewInfo(pushMsg.OperationID, "push_result", wsResult, "sendData", pushMsg.MsgData) + successCount++ + if isOfflinePush && pushMsg.PushToUserID != pushMsg.MsgData.SendID { + // save invitation info for offline push + for _, v := range wsResult { + if v.OnlinePush { + return + } + } + if pushMsg.MsgData.ContentType == constant.SignalingNotification { + if err := db.DB.HandleSignalInfo(pushMsg.OperationID, pushMsg.MsgData); err != nil { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), err.Error(), pushMsg.MsgData) + return + } + } + //Use offline push messaging + var UIDList []string + UIDList = append(UIDList, pushMsg.PushToUserID) + 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: + content = constant.ContentType2PushContent[constant.Picture] + case constant.Voice: + content = constant.ContentType2PushContent[constant.Voice] + case constant.Video: + content = constant.ContentType2PushContent[constant.Video] + case constant.File: + content = constant.ContentType2PushContent[constant.File] + case constant.AtText: + a := AtContent{} + _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) + if utils.IsContain(pushMsg.PushToUserID, a.AtUserList) { + content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] + } else { + content = constant.ContentType2PushContent[constant.GroupMsg] + } + case constant.SignalingNotification: + content = constant.ContentType2PushContent[constant.SignalMsg] + default: + content = constant.ContentType2PushContent[constant.Common] + + } + } + + callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList[0], pushMsg.MsgData) + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") + if callbackResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offlinePush stop") + return + } + if offlinePusher == nil { + return + } + opts, err := GetOfflinePushOpts(pushMsg) + if err != nil { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error()) + } + log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), UIDList, content, jsonCustomContent, "opts:", opts) + pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID, opts) + if err != nil { + log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) + } else { + log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) + } + } +} + +func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) { + var wsResult []*pbRelay.SingelMsgToUserResultList + isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) + log.Debug(pushMsg.OperationID, "Get super group msg from msg_transfer And push msg", pushMsg.String()) + getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pushMsg.OperationID, GroupID: pushMsg.MsgData.GroupID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, pushMsg.OperationID) + if etcdConn == nil { + errMsg := pushMsg.OperationID + "getcdv3.GetConn == nil" + log.NewError(pushMsg.OperationID, errMsg) + return + } + client := pbCache.NewCacheClient(etcdConn) + cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) + if err != nil { + log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) + return + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) + return + } + if len(grpcCons) == 0 { + log.NewWarn(pushMsg.OperationID, "first GetConn4Unique ") + grpcCons = getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + } + //Online push message log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) for _, v := range grpcCons { msgClient := pbRelay.NewOnlineMessageRelayServiceClient(v) - reply, err := msgClient.OnlinePushMsg(context.Background(), &pbRelay.OnlinePushMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserID: pushMsg.PushToUserID}) + reply, err := msgClient.SuperGroupOnlineBatchPushOneMsg(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserIDList: cacheResp.UserIDList}) if err != nil { log.NewError("push data to client rpc err", pushMsg.OperationID, "err", err) continue } - if reply != nil && reply.Resp != nil { - wsResult = append(wsResult, reply.Resp...) + if reply != nil && reply.SinglePushResult != nil { + wsResult = append(wsResult, reply.SinglePushResult...) } } - log.NewInfo(pushMsg.OperationID, "push_result", wsResult, "sendData", pushMsg.MsgData) + log.Debug(pushMsg.OperationID, "push_result", wsResult, "sendData", pushMsg.MsgData) successCount++ - if isOfflinePush && pushMsg.PushToUserID != pushMsg.MsgData.SendID { - // save invitation info for offline push - if pushMsg.MsgData.ContentType == constant.SignalingNotification { - if err := db.DB.HandleSignalInfo(pushMsg.OperationID, pushMsg.MsgData); err != nil { - log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), err.Error(), pushMsg.MsgData) - return - } - } + if isOfflinePush { + var onlineSuccessUserIDList []string + onlineSuccessUserIDList = append(onlineSuccessUserIDList, pushMsg.MsgData.SendID) for _, v := range wsResult { - if v.ResultCode == 0 { - if utils.IsContainInt32(v.RecvPlatFormID, pushTerminal) { - break - } - continue + if v.OnlinePush && v.UserID != pushMsg.MsgData.SendID { + onlineSuccessUserIDList = append(onlineSuccessUserIDList, v.UserID) } - if utils.IsContainInt32(v.RecvPlatFormID, pushTerminal) { - //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 - log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "xxxx OfflinePushInfo", content) - } else { - switch pushMsg.MsgData.ContentType { - case constant.Text: - content = constant.ContentType2PushContent[constant.Text] - case constant.Picture: - content = constant.ContentType2PushContent[constant.Picture] - case constant.Voice: - content = constant.ContentType2PushContent[constant.Voice] - case constant.Video: - content = constant.ContentType2PushContent[constant.Video] - case constant.File: - content = constant.ContentType2PushContent[constant.File] - case constant.AtText: - a := AtContent{} - _ = 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] - } - case constant.SignalingNotification: - content = constant.ContentType2PushContent[constant.SignalMsg] - default: - content = constant.ContentType2PushContent[constant.Common] - } - } - callbackResp := callbackOfflinePush(pushMsg.OperationID, UIDList[0], pushMsg.MsgData) - log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") - if callbackResp.ErrCode != 0 { - log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) - } - if callbackResp.ActionCode != constant.ActionAllow { - log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offlinePush stop") - break - } - if offlinePusher == nil { - break - } + } + onlineFailedUserIDList := utils.DifferenceString(onlineSuccessUserIDList, cacheResp.UserIDList) + //Use offline push messaging + 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 - opts, err := GetOfflinePushOpts(pushMsg) - if err != nil { - log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error()) - } - log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), UIDList, content, jsonCustomContent, "opts:", opts) - pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID, opts) - log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline pushResult: ", pushResult) - if err != nil { - log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) + } else { + switch pushMsg.MsgData.ContentType { + case constant.Text: + content = constant.ContentType2PushContent[constant.Text] + case constant.Picture: + content = constant.ContentType2PushContent[constant.Picture] + case constant.Voice: + content = constant.ContentType2PushContent[constant.Voice] + case constant.Video: + content = constant.ContentType2PushContent[constant.Video] + case constant.File: + content = constant.ContentType2PushContent[constant.File] + case constant.AtText: + a := AtContent{} + _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) + if utils.IsContain(pushMsg.PushToUserID, a.AtUserList) { + content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] } else { - log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) + content = constant.ContentType2PushContent[constant.GroupMsg] } - break + case constant.SignalingNotification: + content = constant.ContentType2PushContent[constant.SignalMsg] + default: + content = constant.ContentType2PushContent[constant.Common] + } - } + callbackResp := callbackOfflinePush(pushMsg.OperationID, onlineFailedUserIDList[0], pushMsg.MsgData) + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline callback Resp") + if callbackResp.ErrCode != 0 { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offlinePush stop") + return + } + if offlinePusher == nil { + return + } + opts, err := GetOfflinePushOpts(pushMsg) + if err != nil { + log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error()) + } + log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), onlineFailedUserIDList, content, jsonCustomContent, "opts:", opts) + pushResult, err := offlinePusher.Push(onlineFailedUserIDList, content, jsonCustomContent, pushMsg.OperationID, opts) + if err != nil { + log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) + } else { + log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) + } } } diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index 44c7ab82d..38a27dfcf 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -8,8 +8,10 @@ import ( "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbAuth "Open_IM/pkg/proto/auth" + pbRelay "Open_IM/pkg/proto/relay" "Open_IM/pkg/utils" "context" + "errors" "net" "strconv" "strings" @@ -47,7 +49,7 @@ func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbA return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil } - tokens, expTime, err := token_verify.CreateToken(req.FromUserID, req.Platform) + tokens, expTime, err := token_verify.CreateToken(req.FromUserID, int(req.Platform)) if err != nil { errMsg := req.OperationID + " token_verify.CreateToken failed " + err.Error() + req.FromUserID + utils.Int32ToString(req.Platform) log.NewError(req.OperationID, errMsg) @@ -58,6 +60,41 @@ func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbA return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}, nil } +func (rpc *rpcAuth) ForceLogout(_ context.Context, req *pbAuth.ForceLogoutReq) (*pbAuth.ForceLogoutResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + " IsManagerUserID false " + req.OpUserID + log.NewError(req.OperationID, errMsg) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if err := token_verify.DeleteToken(req.FromUserID, int(req.Platform)); err != nil { + errMsg := req.OperationID + " DeleteToken failed " + err.Error() + req.FromUserID + utils.Int32ToString(req.Platform) + log.NewError(req.OperationID, errMsg) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil + } + if err := rpc.forceKickOff(req.FromUserID, req.Platform, req.OperationID); err != nil { + errMsg := req.OperationID + " forceKickOff failed " + err.Error() + req.FromUserID + utils.Int32ToString(req.Platform) + log.NewError(req.OperationID, errMsg) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}}, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}}) + return &pbAuth.ForceLogoutResp{CommonResp: &pbAuth.CommonResp{}}, nil +} + +func (rpc *rpcAuth) forceKickOff(userID string, platformID int32, operationID string) error { + + 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) + kickReq := &pbRelay.KickUserOfflineReq{OperationID: operationID, KickUserIDList: []string{userID}, PlatformID: platformID} + log.NewInfo(operationID, "KickUserOffline ", client, kickReq.String()) + _, err := client.KickUserOffline(context.Background(), kickReq) + return utils.Wrap(err, "") + } + + return errors.New("no rpc node ") +} + type rpcAuth struct { rpcPort int rpcRegisterName string diff --git a/internal/rpc/friend/firend.go b/internal/rpc/friend/firend.go index 313b2becf..5c2c2a359 100644 --- a/internal/rpc/friend/firend.go +++ b/internal/rpc/friend/firend.go @@ -63,7 +63,7 @@ func (s *friendServer) Run() { defer srv.GracefulStop() //User friend related services register to etcd pbFriend.RegisterFriendServer(srv, s) - rpcRegisterIP := "" + rpcRegisterIP := config.Config.RpcRegisterIP if config.Config.RpcRegisterIP == "" { rpcRegisterIP, err = utils.GetLocalIP() if err != nil { @@ -99,7 +99,12 @@ func (s *friendServer) AddBlacklist(ctx context.Context, req *pbFriend.AddBlackl } log.NewInfo(req.CommID.OperationID, "AddBlacklist rpc ok ", req.CommID.FromUserID, req.CommID.ToUserID) reqAddBlackUserToCache := &pbCache.AddBlackUserToCacheReq{UserID: req.CommID.FromUserID, BlackUserID: req.CommID.ToUserID, OperationID: req.CommID.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddBlackUserToCache(context.Background(), reqAddBlackUserToCache) if err != nil { @@ -263,7 +268,12 @@ func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddF } // cache rpc addFriendToCacheReq := &pbCache.AddFriendToCacheReq{OperationID: req.CommID.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } client := pbCache.NewCacheClient(etcdConn) addFriendToCacheReq.UserID = req.CommID.ToUserID addFriendToCacheReq.FriendID = req.CommID.FromUserID @@ -318,7 +328,12 @@ func (s *friendServer) DeleteFriend(ctx context.Context, req *pbFriend.DeleteFri } log.NewInfo(req.CommID.OperationID, "DeleteFriend rpc ok") reduceFriendFromCache := &pbCache.ReduceFriendFromCacheReq{OperationID: req.CommID.OperationID, UserID: req.CommID.FromUserID, FriendID: req.CommID.ToUserID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } client := pbCache.NewCacheClient(etcdConn) respPb, err := client.ReduceFriendFromCache(context.Background(), reduceFriendFromCache) if err != nil { @@ -399,7 +414,13 @@ func (s *friendServer) RemoveBlacklist(ctx context.Context, req *pbFriend.Remove } log.NewInfo(req.CommID.OperationID, "rpc RemoveBlacklist ok ") reqReduceBlackUserFromCache := &pbCache.ReduceBlackUserFromCacheReq{UserID: req.CommID.FromUserID, BlackUserID: req.CommID.ToUserID, OperationID: req.CommID.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.CommID.OperationID) + if etcdConn == nil { + errMsg := req.CommID.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.CommID.OperationID, errMsg) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } + cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.ReduceBlackUserFromCache(context.Background(), reqReduceBlackUserFromCache) if err != nil { diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 348efcc05..147e06b63 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -12,18 +12,18 @@ import ( cp "Open_IM/pkg/common/utils" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbCache "Open_IM/pkg/proto/cache" + pbConversation "Open_IM/pkg/proto/conversation" pbGroup "Open_IM/pkg/proto/group" open_im_sdk "Open_IM/pkg/proto/sdk_ws" pbUser "Open_IM/pkg/proto/user" "Open_IM/pkg/utils" "context" + "google.golang.org/grpc" "math/big" "net" "strconv" "strings" "time" - - "google.golang.org/grpc" ) type groupServer struct { @@ -93,12 +93,6 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR 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") - } - } groupId := req.GroupInfo.GroupID if groupId == "" { @@ -108,77 +102,83 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR groupId = bi.String() } //to group - groupInfo := db.Group{} utils.CopyStructFields(&groupInfo, req.GroupInfo) groupInfo.CreatorUserID = req.OpUserID groupInfo.GroupID = groupId - err = imdb.InsertIntoGroup(groupInfo) + 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) } + var okUserIDList []string + resp := &pbGroup.CreateGroupResp{GroupInfo: &open_im_sdk.GroupInfo{}} groupMember := db.GroupMember{} us := &db.User{} - if req.OwnerUserID == "" { - goto initMemberList - } - 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) - } - -initMemberList: - var okUserIDList []string - //to group member - for _, user := range req.InitMemberList { - us, err := imdb.GetUserByUserID(user.UserID) + if req.OwnerUserID != "" { + us, err = imdb.GetUserByUserID(req.OwnerUserID) if err != nil { - log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), user.UserID) - continue + 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) } - if user.RoleLevel == constant.GroupOwner { - log.NewError(req.OperationID, "only one owner, failed ", user) - continue - } - groupMember.RoleLevel = user.RoleLevel + //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) - continue + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) } - okUserIDList = append(okUserIDList, user.UserID) } - 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 = err.Error() - 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 = err.Error() - return resp, nil - } - if req.OwnerUserID != "" { - resp.GroupInfo.OwnerUserID = req.OwnerUserID - okUserIDList = append(okUserIDList, req.OwnerUserID) + if req.GroupInfo.GroupType != constant.SuperGroup { + //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) + } + group, err := imdb.GetGroupInfoByGroupID(groupId) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + 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 = err.Error() + return resp, nil + } + if req.OwnerUserID != "" { + resp.GroupInfo.OwnerUserID = req.OwnerUserID + okUserIDList = append(okUserIDList, req.OwnerUserID) + } + } else { + for _, v := range req.InitMemberList { + okUserIDList = append(okUserIDList, v.UserID) + } + if err := db.DB.CreateSuperGroup(groupId, okUserIDList, len(okUserIDList)); err != nil { + log.NewError(req.OperationID, "GetGroupMemberNumByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = err.Error() + ": CreateSuperGroup failed" + } } if len(okUserIDList) != 0 { @@ -187,7 +187,12 @@ initMemberList: GroupID: groupId, OperationID: req.OperationID, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -200,7 +205,12 @@ initMemberList: } log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String()) - chat.GroupCreatedNotification(req.OperationID, req.OpUserID, groupId, okUserIDList) + if req.GroupInfo.GroupType != constant.SuperGroup { + chat.GroupCreatedNotification(req.OperationID, req.OpUserID, groupId, okUserIDList) + } else { + chat.SuperGroupNotification(req.OperationID, req.OpUserID, groupId) + + } return resp, nil } else { log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String()) @@ -263,99 +273,125 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite // //from User: invite: applicant //to user: invite: invited - var resp pbGroup.InviteUserToGroupResp var okUserIDList []string - for _, v := range req.InvitedUserIDList { - var resultNode pbGroup.Id2Result - resultNode.UserID = v - resultNode.Result = 0 - toUserInfo, err := imdb.GetUserByUserID(v) - if err != nil { - log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), v) - resultNode.Result = -1 + if groupInfo.GroupType != constant.SuperGroup { + var resp pbGroup.InviteUserToGroupResp + for _, v := range req.InvitedUserIDList { + var resultNode pbGroup.Id2Result + resultNode.UserID = v + resultNode.Result = 0 + toUserInfo, err := imdb.GetUserByUserID(v) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), v) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + + if imdb.IsExistGroupMember(req.GroupID, v) { + log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + 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.NewError(req.OperationID, "InsertIntoGroupMember failed ", req.GroupID, toUserInfo.UserID, toUserInfo.Nickname, toUserInfo.FaceURL) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + okUserIDList = append(okUserIDList, v) + err = db.DB.AddGroupMember(req.GroupID, toUserInfo.UserID) + if err != nil { + log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), req.GroupID, toUserInfo.UserID) + } resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) - continue + } + var haveConUserID []string + conversations, err := imdb.GetConversationsByConversationIDMultipleOwner(okUserIDList, utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType)) + if err != nil { + log.NewError(req.OperationID, "GetConversationsByConversationIDMultipleOwner failed ", err.Error(), req.GroupID, constant.GroupChatType) + } + for _, v := range conversations { + haveConUserID = append(haveConUserID, v.OwnerUserID) + } + var reqPb pbUser.SetConversationReq + var c pbUser.Conversation + for _, v := range conversations { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v.OwnerUserID + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.RecvMsgOpt = v.RecvMsgOpt + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsPinned = v.IsPinned + c.AttachedInfo = v.AttachedInfo + c.IsPrivateChat = v.IsPrivateChat + c.GroupAtType = v.GroupAtType + c.IsNotInGroup = false + c.Ex = v.Ex + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.OwnerUserID) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.OwnerUserID) + } + } + for _, v := range utils.DifferenceString(haveConUserID, okUserIDList) { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsNotInGroup = false + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) + } + } + } else { + okUserIDList = req.InvitedUserIDList + if err := db.DB.AddUserToSuperGroup(req.GroupID, req.InvitedUserIDList); err != nil { + log.NewError(req.OperationID, "AddUserToSuperGroup failed ", req.GroupID, err) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}, nil } - if imdb.IsExistGroupMember(req.GroupID, v) { - log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v) - resultNode.Result = -1 - resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) - continue - } - 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.NewError(req.OperationID, "InsertIntoGroupMember failed ", req.GroupID, toUserInfo.UserID, toUserInfo.Nickname, toUserInfo.FaceURL) - resultNode.Result = -1 - resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) - continue - } - okUserIDList = append(okUserIDList, v) - err = db.DB.AddGroupMember(req.GroupID, toUserInfo.UserID) - if err != nil { - log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), req.GroupID, toUserInfo.UserID) - } - resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) } - var haveConUserID []string - conversations, err := imdb.GetConversationsByConversationIDMultipleOwner(okUserIDList, utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType)) - for _, v := range conversations { - haveConUserID = append(haveConUserID, v.OwnerUserID) - } - var reqPb pbUser.SetConversationReq - var c pbUser.Conversation - for _, v := range conversations { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v.OwnerUserID - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.RecvMsgOpt = v.RecvMsgOpt - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsPinned = v.IsPinned - c.AttachedInfo = v.AttachedInfo - c.IsPrivateChat = v.IsPrivateChat - c.GroupAtType = v.GroupAtType - c.IsNotInGroup = false - c.Ex = v.Ex - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.OwnerUserID) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.OwnerUserID) - } - } - for _, v := range utils.DifferenceString(haveConUserID, okUserIDList) { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsNotInGroup = false - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) - } - } - addGroupMemberToCacheReq := &pbCache.AddGroupMemberToCacheReq{ UserIDList: okUserIDList, GroupID: req.GroupID, OperationID: req.OperationID, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -367,30 +403,43 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } - 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 + if groupInfo.GroupType != constant.SuperGroup { + chat.MemberInvitedNotification(req.OperationID, req.GroupID, req.OpUserID, req.Reason, okUserIDList) + } else { + chat.SuperGroupNotification(req.OperationID, req.OpUserID, req.GroupID) + } + + log.NewInfo(req.OperationID, "InviteUserToGroup rpc return ") + return &pbGroup.InviteUserToGroupResp{}, nil } func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGroupAllMemberReq) (*pbGroup.GetGroupAllMemberResp, error) { log.NewInfo(req.OperationID, "GetGroupAllMember, args ", req.String()) var resp pbGroup.GetGroupAllMemberResp - memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) + groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), 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 } + if groupInfo.GroupType != constant.SuperGroup { + memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) + if err != nil { + 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 { - //log.Debug(req.OperationID, v) - var node open_im_sdk.GroupMemberFullInfo - cp.GroupMemberDBCopyOpenIM(&node, &v) - //log.Debug(req.OperationID, "db value:", v.MuteEndTime, "seconds: ", v.MuteEndTime.Unix()) - //log.Debug(req.OperationID, "cp value: ", node) - resp.MemberList = append(resp.MemberList, &node) + for _, v := range memberList { + //log.Debug(req.OperationID, v) + var node open_im_sdk.GroupMemberFullInfo + cp.GroupMemberDBCopyOpenIM(&node, &v) + //log.Debug(req.OperationID, "db value:", v.MuteEndTime, "seconds: ", v.MuteEndTime.Unix()) + //log.Debug(req.OperationID, "cp value: ", node) + resp.MemberList = append(resp.MemberList, &node) + } } log.NewInfo(req.OperationID, "GetGroupAllMember rpc return ", resp.String()) return &resp, nil @@ -424,90 +473,126 @@ func (s *groupServer) GetGroupMemberList(ctx context.Context, req *pbGroup.GetGr return &resp, nil } +func (s *groupServer) getGroupUserLevel(groupID, userID string) (int, error) { + opFlag := 0 + if !token_verify.IsManagerUserID(userID) { + opInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID) + if err != nil { + return opFlag, utils.Wrap(err, "") + } + if opInfo.RoleLevel == constant.GroupOrdinaryUsers { + opFlag = 0 + } else if opInfo.RoleLevel == constant.GroupOwner { + opFlag = 2 //owner + } else { + opFlag = 3 //admin + } + } else { + opFlag = 1 //app manager + } + return opFlag, nil +} + func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGroupMemberReq) (*pbGroup.KickGroupMemberResp, error) { - log.NewInfo(req.OperationID, "KickGroupMember args ", req.String()) - ownerList, err := imdb.GetOwnerManagerByGroupID(req.GroupID) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { - log.NewError(req.OperationID, "GetOwnerManagerByGroupId failed ", err.Error(), req.GroupID) + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupInfoByGroupID", req.GroupID, err.Error()) 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.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 token_verify.IsManagerUserID(req.OpUserID) { - flag = 1 - log.NewDebug(req.OperationID, "is app manager ", req.OpUserID) - } - } - - if flag != 1 { - 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.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.KickedUserIDList { - //owner can‘t kicked - 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) - if err != nil { - log.NewError(req.OperationID, "RemoveGroupMember failed ", err.Error(), req.GroupID, v) - resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + if groupInfo.GroupType != constant.SuperGroup { + opFlag := 0 + if !token_verify.IsManagerUserID(req.OpUserID) { + opInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + err.Error() + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + if opInfo.RoleLevel == constant.GroupOrdinaryUsers { + errMsg := req.OperationID + " opInfo.RoleLevel == constant.GroupOrdinaryUsers " + opInfo.UserID + opInfo.GroupID + log.Error(req.OperationID, errMsg) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } else if opInfo.RoleLevel == constant.GroupOwner { + opFlag = 2 //owner + } else { + opFlag = 3 //admin + } } else { - log.NewDebug(req.OperationID, "kicked ", v) - resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: 0}) - okUserIDList = append(okUserIDList, v) + opFlag = 1 //app manager } - //err = db.DB.DelGroupMember(req.GroupID, v) - //if err != nil { - // log.NewError(req.OperationID, "DelGroupMember failed ", err.Error(), req.GroupID, v) - //} - } - var reqPb pbUser.SetConversationReq - var c pbUser.Conversation - for _, v := range okUserIDList { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsNotInGroup = true - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) + //op is group owner? + 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 + } + + //remove + for _, v := range req.KickedUserIDList { + kickedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, v) + if err != nil { + log.NewError(req.OperationID, " GetGroupMemberInfoByGroupIDAndUserID failed ", req.GroupID, v, err.Error()) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + continue + } + + if kickedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + log.Error(req.OperationID, "is constant.GroupAdmin, can't kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + continue + } + if kickedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + log.NewDebug(req.OperationID, "is constant.GroupOwner, can't kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + continue + } + + err = imdb.RemoveGroupMember(req.GroupID, v) + if err != nil { + log.NewError(req.OperationID, "RemoveGroupMember failed ", err.Error(), req.GroupID, v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + } else { + log.NewDebug(req.OperationID, "kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: 0}) + okUserIDList = append(okUserIDList, v) + } + } + var reqPb pbUser.SetConversationReq + var c pbUser.Conversation + for _, v := range okUserIDList { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsNotInGroup = true + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + resp.ErrCode = constant.ErrInternal.ErrCode + resp.ErrMsg = errMsg + return &resp, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v) + } + } + } else { + okUserIDList = req.KickedUserIDList + if err := db.DB.RemoverUserFromSuperGroup(req.GroupID, okUserIDList); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, req.KickedUserIDList, err.Error()) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + return &resp, nil } } @@ -516,7 +601,12 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou GroupID: req.GroupID, OperationID: req.OperationID, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.ReduceGroupMemberFromCache(context.Background(), reduceGroupMemberFromCacheReq) if err != nil { @@ -527,8 +617,11 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou log.NewError(req.OperationID, "ReduceGroupMemberFromCache rpc logic call failed ", cacheResp.String()) return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil } - - chat.MemberKickedNotification(req, okUserIDList) + if groupInfo.GroupType != constant.SuperGroup { + chat.MemberKickedNotification(req, okUserIDList) + } else { + chat.SuperGroupNotification(req.OperationID, req.OpUserID, req.GroupID) + } log.NewInfo(req.OperationID, "GetGroupMemberList rpc return ", resp.String()) return &resp, nil } @@ -670,7 +763,12 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G c.Ex = conversation.Ex } reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetConversation(context.Background(), &reqPb) if err != nil { @@ -679,7 +777,12 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String()) } addGroupMemberToCacheReq := &pbCache.AddGroupMemberToCacheReq{OperationID: req.OperationID, GroupID: req.GroupID, UserIDList: []string{req.FromUserID}} - etcdCacheConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdCacheConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } cacheClient := pbCache.NewCacheClient(etcdCacheConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -773,7 +876,12 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) c.GroupID = req.GroupID c.IsNotInGroup = true reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetConversation(context.Background(), &reqPb) if err != nil { @@ -787,7 +895,12 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) GroupID: req.GroupID, OperationID: req.OperationID, } - etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } cacheClient := pbCache.NewCacheClient(etcdConnCache) cacheResp, err := cacheClient.ReduceGroupMemberFromCache(context.Background(), reduceGroupMemberFromCacheReq) if err != nil { @@ -840,17 +953,25 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf ////bitwise operators: 0001:groupName; 0010:Notification 0100:Introduction; 1000:FaceUrl; 10000:owner var changedType int32 + groupName := "" + notification := "" + introduction := "" + faceURL := "" if group.GroupName != req.GroupInfo.GroupName && req.GroupInfo.GroupName != "" { changedType = 1 + groupName = req.GroupInfo.GroupName } if group.Notification != req.GroupInfo.Notification && req.GroupInfo.Notification != "" { changedType = changedType | (1 << 1) + notification = req.GroupInfo.Notification } if group.Introduction != req.GroupInfo.Introduction && req.GroupInfo.Introduction != "" { changedType = changedType | (1 << 2) + introduction = req.GroupInfo.Introduction } if group.FaceURL != req.GroupInfo.FaceURL && req.GroupInfo.FaceURL != "" { changedType = changedType | (1 << 3) + faceURL = req.GroupInfo.FaceURL } //only administrators can set group information var groupInfo db.Group @@ -862,7 +983,53 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf } log.NewInfo(req.OperationID, "SetGroupInfo rpc return ", pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}) if changedType != 0 { - chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfo.GroupID) + chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfo.GroupID, groupName, notification, introduction, faceURL) + } + if req.GroupInfo.Notification != "" { + //get group member user id + getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: req.OperationID, GroupID: req.GroupInfo.GroupID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, http.WrapError(constant.ErrInternal) + } + client := pbCache.NewCacheClient(etcdConn) + cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberIDListFromCache rpc call failed ", err.Error()) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil + } + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(req.OperationID, "GetGroupMemberIDListFromCache rpc logic call failed ", cacheResp.String()) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil + } + var conversationReq pbConversation.ModifyConversationFieldReq + + conversation := pbConversation.Conversation{ + OwnerUserID: req.OpUserID, + ConversationID: utils.GetConversationIDBySessionType(req.GroupInfo.GroupID, constant.GroupChatType), + ConversationType: constant.GroupChatType, + GroupID: req.GroupInfo.GroupID, + } + conversationReq.Conversation = &conversation + conversationReq.OperationID = req.OperationID + conversationReq.FieldType = constant.FieldGroupAtType + conversation.GroupAtType = constant.GroupNotification + conversationReq.UserIDList = cacheResp.UserIDList + nEtcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, http.WrapError(constant.ErrInternal) + } + nClient := pbConversation.NewConversationClient(nEtcdConn) + conversationReply, err := nClient.ModifyConversationField(context.Background(), &conversationReq) + if err != nil { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), err.Error()) + } else if conversationReply.CommonResp.ErrCode != 0 { + log.NewError(conversationReq.OperationID, "ModifyConversationField rpc failed, ", conversationReq.String(), conversationReply.String()) + } } return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil } @@ -1051,7 +1218,12 @@ func (s *groupServer) OperateUserRole(_ context.Context, req *pbGroup.OperateUse 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } client := pbGroup.NewGroupClient(etcdConn) var reqPb pbGroup.TransferGroupOwnerReq reqPb.OperationID = req.OperationID @@ -1132,7 +1304,12 @@ func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.Remo c.GroupID = req.GroupId c.IsNotInGroup = true reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } client := pbUser.NewUserClient(etcdConn) respPb, err := client.SetConversation(context.Background(), &reqPb) if err != nil { @@ -1147,7 +1324,12 @@ func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.Remo GroupID: req.GroupId, OperationID: req.OperationID, } - etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConnCache := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConnCache == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } cacheClient := pbCache.NewCacheClient(etcdConnCache) cacheResp, err := cacheClient.ReduceGroupMemberFromCache(context.Background(), reduceGroupMemberFromCacheReq) if err != nil { @@ -1203,7 +1385,12 @@ func (s *groupServer) AddGroupMembersCMS(_ context.Context, req *pbGroup.AddGrou GroupID: req.GroupId, OperationID: req.OperationId, } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationId) + if etcdConn == nil { + errMsg := req.OperationId + "getcdv3.GetConn == nil" + log.NewError(req.OperationId, errMsg) + return resp, http.WrapError(constant.ErrInternal) + } cacheClient := pbCache.NewCacheClient(etcdConn) cacheResp, err := cacheClient.AddGroupMemberToCache(context.Background(), addGroupMemberToCacheReq) if err != nil { @@ -1267,38 +1454,55 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou log.NewError(req.OperationID, "OperateGroupStatus failed ", req.GroupID, constant.GroupStatusDismissed) return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) + groupInfo, err := imdb.GetGroupInfoByGroupID(req.GroupID) if err != nil { - log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil } - //modify quitter conversation info - var reqPb pbUser.SetConversationReq - var c pbUser.Conversation - for _, v := range memberList { - reqPb.OperationID = req.OperationID - c.OwnerUserID = v.UserID - c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) - c.ConversationType = constant.GroupChatType - c.GroupID = req.GroupID - c.IsNotInGroup = true - reqPb.Conversation = &c - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) - client := pbUser.NewUserClient(etcdConn) - respPb, err := client.SetConversation(context.Background(), &reqPb) + if groupInfo.GroupType != constant.SuperGroup { + memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.UserID) - } else { - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.UserID) + log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) + } + //modify quitter conversation info + var reqPb pbUser.SetConversationReq + var c pbUser.Conversation + for _, v := range memberList { + reqPb.OperationID = req.OperationID + c.OwnerUserID = v.UserID + c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType) + c.ConversationType = constant.GroupChatType + c.GroupID = req.GroupID + c.IsNotInGroup = true + reqPb.Conversation = &c + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error(), v.UserID) + } else { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "SetConversation success", respPb.String(), v.UserID) + } + } + err = imdb.DeleteGroupMemberByGroupID(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupID failed ", req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupDismissedNotification(req) + } else { + err = db.DB.DeleteSuperGroup(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupID failed ", req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } } - chat.GroupDismissedNotification(req) - err = imdb.DeleteGroupMemberByGroupID(req.GroupID) - if err != nil { - log.NewError(req.OperationID, "DeleteGroupMemberByGroupID failed ", req.GroupID) - return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil - - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil } @@ -1310,14 +1514,36 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGroupMemberReq) (*pbGroup.MuteGroupMemberResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.GroupID, req.UserID) - return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + + mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.UserID) + if err != nil { + errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.UserID + err.Error() + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.UserID + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.UserID + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID} groupMemberInfo.MuteEndTime = time.Unix(int64(time.Now().Second())+int64(req.MutedSeconds), time.Now().UnixNano()) - err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + err = imdb.UpdateGroupMemberInfo(groupMemberInfo) if err != nil { log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo) return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1329,13 +1555,36 @@ func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGrou func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.CancelMuteGroupMemberReq) (*pbGroup.CancelMuteGroupMemberResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID) - return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + + mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.UserID) + if err != nil { + errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.UserID + err.Error() + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.UserID + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.UserID + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID} groupMemberInfo.MuteEndTime = time.Unix(0, 0) - err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + err = imdb.UpdateGroupMemberInfo(groupMemberInfo) if err != nil { log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo) return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1347,11 +1596,34 @@ func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.Ca func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq) (*pbGroup.MuteGroupResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.GroupID, req.GroupID) - return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } - err := imdb.OperateGroupStatus(req.GroupID, constant.GroupStatusMuted) + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + + //mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.UserID) + //if err != nil { + // errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + + err = imdb.OperateGroupStatus(req.GroupID, constant.GroupStatusMuted) if err != nil { log.Error(req.OperationID, "OperateGroupStatus failed ", err.Error(), req.GroupID, constant.GroupStatusMuted) return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1363,12 +1635,34 @@ func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq) func (s *groupServer) CancelMuteGroup(ctx context.Context, req *pbGroup.CancelMuteGroupReq) (*pbGroup.CancelMuteGroupResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) - if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { - log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID) - return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + opFlag, err := s.getGroupUserLevel(req.GroupID, req.OpUserID) + if err != nil { + errMsg := req.OperationID + " getGroupUserLevel failed " + req.GroupID + req.OpUserID + err.Error() + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + } + if opFlag == 0 { + errMsg := req.OperationID + "opFlag == 0 " + req.GroupID + req.OpUserID + log.Error(req.OperationID, errMsg) + return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil } - err := imdb.UpdateGroupInfoDefaultZero(req.GroupID, map[string]interface{}{"status": constant.GroupOk}) + //mutedInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.) + //if err != nil { + // errMsg := req.OperationID + " GetGroupMemberInfoByGroupIDAndUserID failed " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupOwner && opFlag != 1 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupOwner " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + //if mutedInfo.RoleLevel == constant.GroupAdmin && opFlag == 3 { + // errMsg := req.OperationID + " mutedInfo.RoleLevel == constant.GroupAdmin " + req.GroupID + req.OpUserID + err.Error() + // return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}}, nil + //} + log.Debug(req.OperationID, "UpdateGroupInfoDefaultZero ", req.GroupID, map[string]interface{}{"status": constant.GroupOk}) + err = imdb.UpdateGroupInfoDefaultZero(req.GroupID, map[string]interface{}{"status": constant.GroupOk}) if err != nil { log.Error(req.OperationID, "UpdateGroupInfoDefaultZero failed ", err.Error(), req.GroupID) return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil @@ -1438,7 +1732,18 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGr resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + ":" + err.Error() return resp, nil } - chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + if req.RoleLevel != nil { + switch req.RoleLevel.Value { + case constant.GroupOrdinaryUsers: + //chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToOrdinaryUserNotification) + chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + case constant.GroupAdmin, constant.GroupOwner: + //chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToAdminNotification) + chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + } + } else { + chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } diff --git a/internal/rpc/group/super_group.go b/internal/rpc/group/super_group.go new file mode 100644 index 000000000..ca57bbb4f --- /dev/null +++ b/internal/rpc/group/super_group.go @@ -0,0 +1,64 @@ +package group + +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" + cp "Open_IM/pkg/common/utils" + pbGroup "Open_IM/pkg/proto/group" + commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" +) + +func (s *groupServer) GetJoinedSuperGroupList(ctx context.Context, req *pbGroup.GetJoinedSuperGroupListReq) (*pbGroup.GetJoinedSuperGroupListResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetJoinedSuperGroupListResp{CommonResp: &pbGroup.CommonResp{}} + userToSuperGroup, err := db.DB.GetSuperGroupByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroupByUserID failed", err.Error()) + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + for _, groupID := range userToSuperGroup.GroupIDList { + groupInfoDB, err := imdb.GetGroupInfoByGroupID(groupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupInfoByGroupID failed", groupID, err.Error()) + continue + } + groupInfo := &commonPb.GroupInfo{} + if err := utils.CopyStructFields(groupInfo, groupInfoDB); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + group, err := db.DB.GetSuperGroup(groupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetSuperGroup failed", groupID, err.Error()) + continue + } + groupInfo.MemberCount = uint32(len(group.MemberIDList)) + resp.GroupList = append(resp.GroupList, groupInfo) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *groupServer) GetSuperGroupsInfo(_ context.Context, req *pbGroup.GetSuperGroupsInfoReq) (resp *pbGroup.GetSuperGroupsInfoResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbGroup.GetSuperGroupsInfoResp{CommonResp: &pbGroup.CommonResp{}} + groupsInfoList := make([]*commonPb.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 commonPb.GroupInfo + cp.GroupDBCopyOpenIM(&groupInfo, groupInfoFromMysql) + groupsInfoList = append(groupsInfoList, &groupInfo) + } + resp.GroupInfoList = groupsInfoList + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} diff --git a/internal/rpc/msg/chat.go b/internal/rpc/msg/chat.go new file mode 100644 index 000000000..bb83dc055 --- /dev/null +++ b/internal/rpc/msg/chat.go @@ -0,0 +1,38 @@ +package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" + "context" +) + +func (rpc *rpcChat) ClearMsg(_ context.Context, req *pbChat.ClearMsgReq) (*pbChat.ClearMsgResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc req: ", req.String()) + if req.OpUserID != req.UserID && !token_verify.IsManagerUserID(req.UserID) { + errMsg := "No permission" + req.OpUserID + req.UserID + log.Error(req.OperationID, errMsg) + return &pbChat.ClearMsgResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "CleanUpOneUserAllMsgFromRedis args", req.UserID) + err := db.DB.CleanUpOneUserAllMsgFromRedis(req.UserID, req.OperationID) + if err != nil { + errMsg := "CleanUpOneUserAllMsgFromRedis failed " + err.Error() + req.OperationID + req.UserID + log.Error(req.OperationID, errMsg) + return &pbChat.ClearMsgResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "CleanUpUserMsgFromMongo args", req.UserID) + err = db.DB.CleanUpUserMsgFromMongo(req.UserID, req.OperationID) + if err != nil { + errMsg := "CleanUpUserMsgFromMongo failed " + err.Error() + req.OperationID + req.UserID + log.Error(req.OperationID, errMsg) + return &pbChat.ClearMsgResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + + resp := pbChat.ClearMsgResp{ErrCode: 0} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return &resp, nil +} diff --git a/internal/rpc/msg/conversation_notification.go b/internal/rpc/msg/conversation_notification.go index 5c39ea06a..b43db7959 100644 --- a/internal/rpc/msg/conversation_notification.go +++ b/internal/rpc/msg/conversation_notification.go @@ -49,12 +49,6 @@ func ConversationSetPrivateNotification(operationID, sendID, recvID string, isPr } var tips open_im_sdk.TipsComm var tipsMsg string - //var senderName string - //senderName, err := im_mysql_model.GetUserNameByUserID(sendID) - //if err != nil { - // log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) - // senderName = sendID - //} if isPrivateChat == true { tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.OpenTips } else { diff --git a/internal/rpc/msg/group_notification.go b/internal/rpc/msg/group_notification.go index 5ba2400dd..258764485 100644 --- a/internal/rpc/msg/group_notification.go +++ b/internal/rpc/msg/group_notification.go @@ -36,7 +36,6 @@ func setOpUserInfo(opUserID, groupID string, groupMemberInfo *open_im_sdk.GroupM return utils.Wrap(err, "") } } - user, err := imdb.GetUserByUserID(opUserID) if err != nil { return utils.Wrap(err, "") @@ -101,7 +100,7 @@ func setPublicUserInfo(userID string, publicUserInfo *open_im_sdk.PublicUserInfo } func groupNotification(contentType int32, m proto.Message, sendID, groupID, recvUserID, operationID string) { - log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType) + log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType, sendID, groupID, recvUserID) var err error var tips open_im_sdk.TipsComm @@ -117,19 +116,19 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv } tips.JsonDetail, _ = marshaler.MarshalToString(m) + var nickname string 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) + log.NewWarn(operationID, "GetUserByUserID failed ", err.Error(), recvUserID) } toNickname := "" if to != nil { @@ -170,7 +169,10 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips case constant.GroupMemberInfoSetNotification: tips.DefaultTips = toNickname + "" + cn.GroupMemberInfoSet.DefaultTips.Tips - + case constant.GroupMemberSetToAdminNotification: + tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToAdmin.DefaultTips.Tips + case constant.GroupMemberSetToOrdinaryUserNotification: + tips.DefaultTips = toNickname + "" + cn.GroupMemberSetToOrdinary.DefaultTips.Tips default: log.Error(operationID, "contentType failed ", contentType) return @@ -225,12 +227,20 @@ func GroupCreatedNotification(operationID, opUserID, groupID string, initMemberL } //群信息改变后掉用 -func GroupInfoSetNotification(operationID, opUserID, groupID string) { +//groupName := "" +// notification := "" +// introduction := "" +// faceURL := "" +func GroupInfoSetNotification(operationID, opUserID, groupID string, groupName, notification, introduction, faceURL 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 } + GroupInfoChangedTips.Group.GroupName = groupName + GroupInfoChangedTips.Group.Notification = notification + GroupInfoChangedTips.Group.Introduction = introduction + GroupInfoChangedTips.Group.FaceURL = faceURL if err := setOpUserInfo(opUserID, groupID, GroupInfoChangedTips.OpUser); err != nil { log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) return @@ -303,6 +313,28 @@ func GroupMemberInfoSetNotification(operationID, opUserID, groupID, groupMemberU groupNotification(constant.GroupMemberInfoSetNotification, &tips, opUserID, groupID, "", operationID) } +func GroupMemberRoleLevelChangeNotification(operationID, opUserID, groupID, groupMemberUserID string, notificationType int32) { + if notificationType != constant.GroupMemberSetToAdminNotification && notificationType != constant.GroupMemberSetToOrdinaryUserNotification { + log.NewError(operationID, utils.GetSelfFuncName(), "invalid notificationType: ", notificationType) + return + } + tips := open_im_sdk.GroupMemberInfoSetTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}, ChangedUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, tips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.ChangedUser); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID) + return + } + groupNotification(notificationType, &tips, opUserID, groupID, "", operationID) +} + func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) { tips := open_im_sdk.GroupMemberCancelMutedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}} diff --git a/internal/rpc/msg/pull_message.go b/internal/rpc/msg/pull_message.go index 1811d3847..22181f09b 100644 --- a/internal/rpc/msg/pull_message.go +++ b/internal/rpc/msg/pull_message.go @@ -2,47 +2,55 @@ package msg import ( "context" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" 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) { +func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *open_im_sdk.GetMaxAndMinSeqReq) (*open_im_sdk.GetMaxAndMinSeqResp, error) { log.NewInfo(in.OperationID, "rpc getMaxAndMinSeq is arriving", in.String()) + resp := new(open_im_sdk.GetMaxAndMinSeqResp) + m := make(map[string]*open_im_sdk.MaxAndMinSeq) //seq, err := model.GetBiggestSeqFromReceive(in.UserID) maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID) - minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) - resp := new(pbMsg.GetMaxAndMinSeqResp) + //minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) if err1 == nil { resp.MaxSeq = uint32(maxSeq) - } else if err1 == redis.ErrNil { + for _, v := range in.GroupIDList { + x := new(open_im_sdk.MaxAndMinSeq) + maxSeq, _ := commonDB.DB.GetUserMaxSeq(v) + x.MaxSeq = uint32(maxSeq) + m[v] = x + } + resp.GroupMaxAndMinSeq = m + } else if err1 == go_redis.Nil { 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" - } + //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) + m := make(map[string]*open_im_sdk.MsgDataList) //msgList, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList, in.OperationID) redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(in.UserID, in.SeqList, in.OperationID) if err != nil { - if err != redis.ErrNil { + if err != go_redis.Nil { log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList) } else { log.Debug(in.OperationID, "get message from redis is nil", failedSeqList) @@ -60,6 +68,32 @@ func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *open_im_sdk.Pull } else { resp.List = redisMsgList } + for k, v := range in.GroupSeqList { + x := new(open_im_sdk.MsgDataList) + redisMsgList, failedSeqList, err := commonDB.DB.GetMessageListBySeq(k, v.SeqList, in.OperationID) + if err != nil { + if err != go_redis.Nil { + log.Error(in.OperationID, "get message from redis exception", err.Error(), failedSeqList) + } else { + log.Debug(in.OperationID, "get message from redis is nil", failedSeqList) + } + msgList, err1 := commonDB.DB.GetSuperGroupMsgBySeqListMongo(k, failedSeqList, in.OperationID) + if err1 != nil { + log.Error(in.OperationID, "PullMessageBySeqList data error", in.String(), err.Error()) + resp.ErrCode = 201 + resp.ErrMsg = err.Error() + return resp, nil + } else { + redisMsgList = append(redisMsgList, msgList...) + x.MsgDataList = redisMsgList + m[k] = x + } + } else { + x.MsgDataList = redisMsgList + m[k] = x + } + } + resp.GroupMsgDataList = m //respSingleMsgFormat = singleMsgHandleByUser(SingleMsgFormat, in.UserID) //respGroupMsgFormat = groupMsgHandleByUser(GroupMsgFormat) return resp, nil diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 5c29ce999..08d3006ca 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -15,7 +15,7 @@ import ( "Open_IM/pkg/utils" "context" "errors" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" "github.com/golang/protobuf/proto" "math/rand" "strconv" @@ -68,43 +68,62 @@ func isMessageHasReadEnabled(pb *pbChat.SendMsgReq) (bool, int32, string) { } func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) { - if data.MsgData.SessionType == constant.GroupChatType { - return true, 0, "" - } - log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) - reqGetBlackIDListFromCache := &cacheRpc.GetBlackIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) - cacheClient := cacheRpc.NewCacheClient(etcdConn) - cacheResp, err := cacheClient.GetBlackIDListFromCache(context.Background(), reqGetBlackIDListFromCache) - if err != nil { - log.NewError(data.OperationID, "GetBlackIDListFromCache rpc call failed ", err.Error()) - } else { - if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(data.OperationID, "GetBlackIDListFromCache rpc logic call failed ", cacheResp.String()) - } else { - if utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { - return false, 600, "in black list" - } + if data.MsgData.SessionType == constant.SingleChatType { + if utils.IsContain(data.MsgData.SendID, config.Config.Manager.AppManagerUid) { + return true, 0, "" } - } - log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) - if config.Config.MessageVerify.FriendVerify { - reqGetFriendIDListFromCache := &cacheRpc.GetFriendIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + if data.MsgData.ContentType <= constant.FriendApplicationNotification && data.MsgData.ContentType >= constant.FriendApplicationApprovedNotification { + return true, 0, "" + } + log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) + reqGetBlackIDListFromCache := &cacheRpc.GetBlackIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, data.OperationID) + if etcdConn == nil { + errMsg := data.OperationID + "getcdv3.GetConn == nil" + log.NewError(data.OperationID, errMsg) + return true, 0, "" + } + cacheClient := cacheRpc.NewCacheClient(etcdConn) - cacheResp, err := cacheClient.GetFriendIDListFromCache(context.Background(), reqGetFriendIDListFromCache) + cacheResp, err := cacheClient.GetBlackIDListFromCache(context.Background(), reqGetBlackIDListFromCache) if err != nil { - log.NewError(data.OperationID, "GetFriendIDListFromCache rpc call failed ", err.Error()) + log.NewError(data.OperationID, "GetBlackIDListFromCache rpc call failed ", err.Error()) } else { if cacheResp.CommonResp.ErrCode != 0 { - log.NewError(data.OperationID, "GetFriendIDListFromCache rpc logic call failed ", cacheResp.String()) + log.NewError(data.OperationID, "GetBlackIDListFromCache rpc logic call failed ", cacheResp.String()) } else { - if !utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { - return false, 601, "not friend" + if utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { + return false, 600, "in black list" } } } - return true, 0, "" + log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) + if config.Config.MessageVerify.FriendVerify { + reqGetFriendIDListFromCache := &cacheRpc.GetFriendIDListFromCacheReq{UserID: data.MsgData.RecvID, OperationID: data.OperationID} + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, data.OperationID) + if etcdConn == nil { + errMsg := data.OperationID + "getcdv3.GetConn == nil" + log.NewError(data.OperationID, errMsg) + return true, 0, "" + } + cacheClient := cacheRpc.NewCacheClient(etcdConn) + cacheResp, err := cacheClient.GetFriendIDListFromCache(context.Background(), reqGetFriendIDListFromCache) + if err != nil { + log.NewError(data.OperationID, "GetFriendIDListFromCache rpc call failed ", err.Error()) + } else { + if cacheResp.CommonResp.ErrCode != 0 { + log.NewError(data.OperationID, "GetFriendIDListFromCache rpc logic call failed ", cacheResp.String()) + } else { + if !utils.IsContain(data.MsgData.SendID, cacheResp.UserIDList) { + return false, 601, "not friend" + } + } + } + return true, 0, "" + } else { + return true, 0, "" + } + } else { return true, 0, "" } @@ -155,30 +174,29 @@ func (rpc *rpcChat) encapsulateMsgData(msg *sdk_ws.MsgData) { utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, 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{} newTime := db.GetCurrentTimestampByMill() - log.NewWarn(pb.OperationID, "rpc sendMsg come here", pb.String(), pb.MsgData.ClientMsgID) + log.Info(pb.OperationID, "rpc sendMsg come here ", pb.String()) flag, errCode, errMsg := isMessageHasReadEnabled(pb) + log.Info(pb.OperationID, "isMessageHasReadEnabled ", flag) if !flag { return returnMsg(&replay, pb, errCode, errMsg, "", 0) } - log.Debug(pb.OperationID, "flag ", flag, config.Config.SingleMessageHasReadReceiptEnable, config.Config.GroupMessageHasReadReceiptEnable) flag, errCode, errMsg = userRelationshipVerification(pb) + log.Info(pb.OperationID, "userRelationshipVerification ", flag) if !flag { return returnMsg(&replay, pb, errCode, errMsg, "", 0) } rpc.encapsulateMsgData(pb.MsgData) - log.Info("", "this is a test MsgData ", pb.MsgData) msgToMQSingle := pbChat.MsgDataToMQ{Token: pb.Token, OperationID: pb.OperationID, MsgData: pb.MsgData} - // callback callbackResp := callbackWordFilter(pb) + log.Info(pb.OperationID, "callbackWordFilter ", callbackResp) if callbackResp.ErrCode != 0 { - log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter resp: ", callbackResp) + log.Error(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter resp: ", callbackResp) } log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackResp: ", callbackResp) if callbackResp.ActionCode != constant.ActionAllow { @@ -208,7 +226,7 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle) err1 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.RecvID, constant.OnlineStatus) if err1 != nil { - log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String()) + log.NewError(msgToMQSingle.OperationID, "kafka send msg err :RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String(), err1.Error()) return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } } @@ -239,7 +257,12 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) } getGroupMemberIDListFromCacheReq := &pbCache.GetGroupMemberIDListFromCacheReq{OperationID: pb.OperationID, GroupID: pb.MsgData.GroupID} - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, msgToMQSingle.OperationID) + if etcdConn == nil { + errMsg := msgToMQSingle.OperationID + "getcdv3.GetConn == nil" + log.NewError(msgToMQSingle.OperationID, errMsg) + return returnMsg(&replay, pb, 201, errMsg, "", 0) + } client := pbCache.NewCacheClient(etcdConn) cacheResp, err := client.GetGroupMemberIDListFromCache(context.Background(), getGroupMemberIDListFromCacheReq) if err != nil { @@ -347,7 +370,12 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S conversationReq.UserIDList = pb.MsgData.AtUserIDList conversation.GroupAtType = constant.AtMe } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, pb.OperationID) + if etcdConn == nil { + errMsg := pb.OperationID + "getcdv3.GetConn == nil" + log.NewError(pb.OperationID, errMsg) + return + } client := pbConversation.NewConversationClient(etcdConn) conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) if err != nil { @@ -358,7 +386,12 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S if tag { conversationReq.UserIDList = utils.DifferenceString(atUserID, memberUserIDList) conversation.GroupAtType = constant.AtAll - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, pb.OperationID) + if etcdConn == nil { + errMsg := pb.OperationID + "getcdv3.GetConn == nil" + log.NewError(pb.OperationID, errMsg) + return + } client := pbConversation.NewConversationClient(etcdConn) conversationReply, err := client.ModifyConversationField(context.Background(), &conversationReq) if err != nil { @@ -391,6 +424,34 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S log.Debug(pb.OperationID, "send msg cost time ", db.GetCurrentTimestampByMill()-newTime, pb.MsgData.ClientMsgID) return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime) + case constant.SuperGroupChatType: + // callback + callbackResp := callbackBeforeSendSingleMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg resp: ", callbackResp) + } + if callbackResp.ActionCode != constant.ActionAllow { + if callbackResp.ErrCode == 0 { + callbackResp.ErrCode = 201 + } + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSuperGroupMsg result", "end rpc and return", callbackResp) + return returnMsg(&replay, pb, int32(callbackResp.ErrCode), callbackResp.ErrMsg, "", 0) + } + msgToMQSingle.MsgData = pb.MsgData + log.NewInfo(msgToMQSingle.OperationID, msgToMQSingle) + err1 := rpc.sendMsgToKafka(&msgToMQSingle, msgToMQSingle.MsgData.GroupID, constant.OnlineStatus) + if err1 != nil { + log.NewError(msgToMQSingle.OperationID, "kafka send msg err:RecvID", msgToMQSingle.MsgData.RecvID, msgToMQSingle.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + + // callback + callbackResp = callbackAfterSendSingleMsg(pb) + if callbackResp.ErrCode != 0 { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSuperGroupMsg resp: ", callbackResp) + } + return returnMsg(&replay, pb, 0, "", msgToMQSingle.MsgData.ServerMsgID, msgToMQSingle.MsgData.SendTime) + default: return returnMsg(&replay, pb, 203, "unknown sessionType", "", 0) } @@ -430,13 +491,29 @@ func returnMsg(replay *pbChat.SendMsgResp, pb *pbChat.SendMsgReq, errCode int32, } func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType int, pb *pbChat.SendMsgReq) bool { - conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) - opt, err := db.DB.GetSingleConversationRecvMsgOpt(userID, conversationID) - if err != nil && err != redis.ErrNil { - log.NewError(pb.OperationID, "GetSingleConversationMsgOpt from redis err", conversationID, pb.String(), err.Error()) - return true + opt, err := db.DB.GetUserGlobalMsgRecvOpt(userID) + if err != nil { + log.NewError(pb.OperationID, "GetUserGlobalMsgRecvOpt from redis err", userID, pb.String(), err.Error()) + } switch opt { + case constant.ReceiveMessage: + 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 + } + conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) + singleOpt, sErr := db.DB.GetSingleConversationRecvMsgOpt(userID, conversationID) + if sErr != nil && sErr != go_redis.Nil { + log.NewError(pb.OperationID, "GetSingleConversationMsgOpt from redis err", conversationID, pb.String(), sErr.Error()) + return true + } + switch singleOpt { case constant.ReceiveMessage: return true case constant.NotReceiveMessage: @@ -455,7 +532,7 @@ func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType i func modifyMessageByUserMessageReceiveOptoptimization(userID, sourceID string, sessionType int, operationID string, options *map[string]bool) bool { conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) opt, err := db.DB.GetSingleConversationRecvMsgOpt(userID, conversationID) - if err != nil && err != redis.ErrNil { + if err != nil && err != go_redis.Nil { log.NewError(operationID, "GetSingleConversationMsgOpt from redis err", userID, conversationID, err.Error()) return true } @@ -503,7 +580,7 @@ func Notification(n *NotificationMsg) { msg.ClientMsgID = utils.GetMsgID(n.SendID) msg.Options = make(map[string]bool, 7) switch n.SessionType { - case constant.GroupChatType: + case constant.GroupChatType, constant.SuperGroupChatType: msg.RecvID = "" msg.GroupID = n.RecvID } @@ -724,6 +801,8 @@ func Notification(n *NotificationMsg) { unReadCount = config.Config.Notification.ConversationSetPrivate.Conversation.UnreadCount case constant.DeleteMessageNotification: reliabilityLevel = constant.ReliableNotificationNoMsg + case constant.SuperGroupUpdateNotification: + reliabilityLevel = constant.UnreliableNotification } switch reliabilityLevel { case constant.UnreliableNotification: @@ -744,7 +823,13 @@ func Notification(n *NotificationMsg) { 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return + } + client := pbChat.NewChatClient(etcdConn) reply, err := client.SendMsg(context.Background(), &req) if err != nil { diff --git a/internal/rpc/msg/super_group_notification.go b/internal/rpc/msg/super_group_notification.go new file mode 100644 index 000000000..52e2e17a2 --- /dev/null +++ b/internal/rpc/msg/super_group_notification.go @@ -0,0 +1,37 @@ +package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + //sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + //"github.com/golang/protobuf/jsonpb" + //"github.com/golang/protobuf/proto" +) + +func SuperGroupNotification(operationID, sendID, groupID string) { + + //var tips sdk.TipsComm + //var err error + //marshaler := jsonpb.Marshaler{ + // OrigName: true, + // EnumsAsInts: false, + // EmitDefaults: false, + //} + //tips.JsonDetail, _ = marshaler.MarshalToString(m) + n := &NotificationMsg{ + SendID: sendID, + RecvID: groupID, + MsgFrom: constant.SysMsgType, + ContentType: constant.SuperGroupUpdateNotification, + SessionType: constant.SuperGroupChatType, + OperationID: operationID, + } + //n.Content, err = proto.Marshal(&tips) + //if err != nil { + // log.NewError(operationID, utils.GetSelfFuncName(), "proto.Marshal failed") + // return + //} + log.NewInfo(operationID, utils.GetSelfFuncName(), string(n.Content)) + Notification(n) +} diff --git a/internal/rpc/msg/tag_send_msg.go b/internal/rpc/msg/tag_send_msg.go index a79a90ec6..7354961db 100644 --- a/internal/rpc/msg/tag_send_msg.go +++ b/internal/rpc/msg/tag_send_msg.go @@ -33,7 +33,13 @@ func TagSendMessage(operationID string, user *db.User, recvID, content string, s msgData.SenderPlatformID = senderPlatformID req.MsgData = &msgData req.OperationID = operationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, operationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return + } + client := pbChat.NewChatClient(etcdConn) respPb, err := client.SendMsg(context.Background(), &req) if err != nil { diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index b75c97edd..71a6db68b 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -205,7 +205,15 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR } var groupUserIDList []string for _, groupID := range req.GroupList { - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImCacheName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + resp.CommonResp.ErrCode = constant.ErrInternal.ErrCode + resp.CommonResp.ErrMsg = errMsg + return resp, nil + } + cacheClient := pbCache.NewCacheClient(etcdConn) req := pbCache.GetGroupMemberIDListFromCacheReq{ OperationID: req.OperationID, diff --git a/internal/rpc/organization/organization.go b/internal/rpc/organization/organization.go index 02523c35e..81659ef60 100644 --- a/internal/rpc/organization/organization.go +++ b/internal/rpc/organization/organization.go @@ -102,7 +102,7 @@ func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.Crea log.Error(req.OperationID, errMsg) return &rpc.CreateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil } - err, createdDepartment := imdb.GetDepartment(department.DepartmentID) + createdDepartment, err := imdb.GetDepartment(department.DepartmentID) if err != nil { errMsg := req.OperationID + " " + "GetDepartment failed " + err.Error() + department.DepartmentID log.Error(req.OperationID, errMsg) @@ -114,19 +114,29 @@ func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.Crea log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + resp.ErrCode = constant.ErrInternal.ErrCode + resp.ErrMsg = errMsg + return resp, nil + } client := groupRpc.NewGroupClient(etcdConn) createGroupReq := &groupRpc.CreateGroupReq{ - InitMemberList: nil, + InitMemberList: []*groupRpc.GroupAddMemberInfo{}, GroupInfo: &open_im_sdk.GroupInfo{ + Introduction: req.DepartmentInfo.Name, GroupName: req.DepartmentInfo.Name, FaceURL: req.DepartmentInfo.FaceURL, CreateTime: uint32(time.Now().Unix()), CreatorUserID: req.OpUserID, - GroupType: constant.DepartmentGroup, + GroupType: constant.NormalGroup, + OwnerUserID: req.OpUserID, }, OperationID: req.OperationID, OpUserID: req.OpUserID, + OwnerUserID: req.OpUserID, } createGroupResp, err := client.CreateGroup(context.Background(), createGroupReq) if err != nil { @@ -141,6 +151,9 @@ func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.Crea resp.ErrMsg = constant.ErrDB.ErrMsg + " createGroup failed " + createGroupResp.ErrMsg return resp, nil } + if err := imdb.SetDepartmentRelatedGroupID(createGroupResp.GroupInfo.GroupID, department.DepartmentID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetDepartmentRelatedGroupID failed", err.Error()) + } return resp, nil } @@ -221,21 +234,26 @@ func (s *organizationServer) CreateOrganizationUser(ctx context.Context, req *rp authReq := &pbAuth.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} utils.CopyStructFields(authReq.UserInfo, req.OrganizationUser) authReq.OperationID = req.OperationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) - client := pbAuth.NewAuthClient(etcdConn) - - reply, err := client.UserRegister(context.Background(), authReq) - if err != nil { - errMsg := "UserRegister failed " + err.Error() - log.NewError(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + if req.IsRegister { + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } + client := pbAuth.NewAuthClient(etcdConn) + reply, err := client.UserRegister(context.Background(), authReq) + if err != nil { + errMsg := "UserRegister failed " + err.Error() + log.NewError(req.OperationID, errMsg) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + if reply.CommonResp.ErrCode != 0 { + errMsg := "UserRegister failed " + reply.CommonResp.ErrMsg + log.NewError(req.OperationID, errMsg) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } } - if reply.CommonResp.ErrCode != 0 { - errMsg := "UserRegister failed " + reply.CommonResp.ErrMsg - log.NewError(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) if !token_verify.IsManagerUserID(req.OpUserID) { errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" @@ -246,7 +264,7 @@ func (s *organizationServer) CreateOrganizationUser(ctx context.Context, req *rp utils.CopyStructFields(&organizationUser, req.OrganizationUser) organizationUser.Birth = utils.UnixSecondToTime(int64(req.OrganizationUser.Birth)) log.Debug(req.OperationID, "src ", *req.OrganizationUser, "dst ", organizationUser) - err = imdb.CreateOrganizationUser(&organizationUser) + err := imdb.CreateOrganizationUser(&organizationUser) if err != nil { errMsg := req.OperationID + " " + "CreateOrganizationUser failed " + err.Error() log.Error(req.OperationID, errMsg, organizationUser) @@ -263,7 +281,12 @@ func (s *organizationServer) UpdateOrganizationUser(ctx context.Context, req *rp authReq := &pbAuth.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} utils.CopyStructFields(authReq.UserInfo, req.OrganizationUser) authReq.OperationID = req.OperationID - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil + } client := pbAuth.NewAuthClient(etcdConn) reply, err := client.UserRegister(context.Background(), authReq) @@ -340,13 +363,14 @@ func (s *organizationServer) CreateDepartmentMember(ctx context.Context, req *rp func (s *organizationServer) GetDepartmentParentIDList(_ context.Context, req *rpc.GetDepartmentParentIDListReq) (resp *rpc.GetDepartmentParentIDListResp, err error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) resp = &rpc.GetDepartmentParentIDListResp{} - resp.ParentIDList, err = imdb.GetDepartmentParentIDList(req.DepartmentID) + parentIDList, err := imdb.GetDepartmentParentIDList(req.DepartmentID) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetDepartmentParentIDList failed", err.Error()) resp.ErrMsg = constant.ErrDB.ErrMsg + ": " + err.Error() resp.ErrCode = constant.ErrDB.ErrCode return resp, nil } + resp.ParentIDList = parentIDList log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp.String()) return resp, nil } diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index bacd88c9c..fa733cbe4 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -383,12 +383,19 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI 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) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName, req.OperationID) + if etcdConn == nil { + errMsg := req.OperationID + "getcdv3.GetConn == nil" + log.NewError(req.OperationID, errMsg) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}}, nil + } + client := pbFriend.NewFriendClient(etcdConn) newReq := &pbFriend.GetFriendListReq{ CommID: &pbFriend.CommID{OperationID: req.OperationID, FromUserID: req.UserInfo.UserID, OpUserID: req.OpUserID}, @@ -426,7 +433,28 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI //} return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil } +func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbUser.SetGlobalRecvMessageOptReq) (*pbUser.SetGlobalRecvMessageOptResp, error) { + log.NewInfo(req.OperationID, "SetGlobalRecvMessageOpt args ", req.String()) + var user db.User + user.UserID = req.UserID + m := make(map[string]interface{}, 1) + + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), req.GlobalRecvMsgOpt, "set GlobalRecvMsgOpt") + m["global_recv_msg_opt"] = req.GlobalRecvMsgOpt + err := db.DB.SetUserGlobalMsgRecvOpt(user.UserID, req.GlobalRecvMsgOpt) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetGlobalRecvMessageOpt failed ", err.Error(), user) + return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + err = imdb.UpdateUserInfoByMap(user, m) + if err != nil { + log.NewError(req.OperationID, "SetGlobalRecvMessageOpt failed ", err.Error(), user) + return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.UserInfoUpdatedNotification(req.OperationID, req.UserID, req.UserID) + return &pbUser.SetGlobalRecvMessageOptResp{CommonResp: &pbUser.CommonResp{}}, nil +} func (s *userServer) SyncJoinedGroupMemberFaceURL(userID string, faceURL string, operationID string, opUserID string) { joinedGroupIDList, err := imdb.GetJoinedGroupIDListByUserID(userID) if err != nil { diff --git a/pkg/base_info/auth_api_struct.go b/pkg/base_info/auth_api_struct.go index 431a00c2c..70f0f86c9 100644 --- a/pkg/base_info/auth_api_struct.go +++ b/pkg/base_info/auth_api_struct.go @@ -38,6 +38,16 @@ type UserTokenResp struct { UserToken UserTokenInfo `json:"data"` } +type ForceLogoutReq struct { + Platform int32 `json:"platform" binding:"required,min=1,max=8"` + FromUserID string `json:"fromUserID" binding:"required,min=1,max=64"` + OperationID string `json:"operationID" binding:"required"` +} + +type ForceLogoutResp struct { + CommResp +} + type ParseTokenReq struct { OperationID string `json:"operationID" binding:"required"` } diff --git a/pkg/base_info/msg.go b/pkg/base_info/msg.go index bc80cf304..15941f340 100644 --- a/pkg/base_info/msg.go +++ b/pkg/base_info/msg.go @@ -10,3 +10,12 @@ type DelMsgReq struct { type DelMsgResp struct { CommResp } + +type CleanUpMsgReq struct { + UserID string `json:"userID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type CleanUpMsgResp struct { + CommResp +} diff --git a/pkg/base_info/super_group.go b/pkg/base_info/super_group.go new file mode 100644 index 000000000..8ea24e014 --- /dev/null +++ b/pkg/base_info/super_group.go @@ -0,0 +1,17 @@ +package base_info + +type GetJoinedSuperGroupListReq struct { + GetJoinedGroupListReq +} + +type GetJoinedSuperGroupListResp struct { + GetJoinedGroupListResp +} + +type GetSuperGroupsInfoReq struct { + GetGroupInfoReq +} + +type GetSuperGroupsInfoResp struct { + GetGroupInfoResp +} diff --git a/pkg/base_info/user_api_struct.go b/pkg/base_info/user_api_struct.go index b517f24de..45c8cb22d 100644 --- a/pkg/base_info/user_api_struct.go +++ b/pkg/base_info/user_api_struct.go @@ -18,7 +18,13 @@ type UpdateSelfUserInfoReq struct { ApiUserInfo OperationID string `json:"operationID" binding:"required"` } - +type SetGlobalRecvMessageOptReq struct { + OperationID string `json:"operationID" binding:"required"` + GlobalRecvMsgOpt *int32 `json:"globalRecvMsgOpt" binding:"omitempty,oneof=0 1 2"` +} +type SetGlobalRecvMessageOptResp struct { + CommResp +} type UpdateUserInfoResp struct { CommResp } diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 9da3fdf29..2163e7619 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -85,23 +85,24 @@ type config struct { DBMaxLifeTime int `yaml:"dbMaxLifeTime"` } Mongo struct { - DBUri string `yaml:"dbUri"` - DBAddress []string `yaml:"dbAddress"` - DBDirect bool `yaml:"dbDirect"` - DBTimeout int `yaml:"dbTimeout"` - DBDatabase string `yaml:"dbDatabase"` - DBSource string `yaml:"dbSource"` - DBUserName string `yaml:"dbUserName"` - DBPassword string `yaml:"dbPassword"` - DBMaxPoolSize int `yaml:"dbMaxPoolSize"` - DBRetainChatRecords int `yaml:"dbRetainChatRecords"` + DBUri string `yaml:"dbUri"` + DBAddress string `yaml:"dbAddress"` + DBDirect bool `yaml:"dbDirect"` + DBTimeout int `yaml:"dbTimeout"` + DBDatabase string `yaml:"dbDatabase"` + DBSource string `yaml:"dbSource"` + DBUserName string `yaml:"dbUserName"` + DBPassword string `yaml:"dbPassword"` + DBMaxPoolSize int `yaml:"dbMaxPoolSize"` + DBRetainChatRecords int `yaml:"dbRetainChatRecords"` } Redis struct { - DBAddress string `yaml:"dbAddress"` - DBMaxIdle int `yaml:"dbMaxIdle"` - DBMaxActive int `yaml:"dbMaxActive"` - DBIdleTimeout int `yaml:"dbIdleTimeout"` - DBPassWord string `yaml:"dbPassWord"` + DBAddress []string `yaml:"dbAddress"` + DBMaxIdle int `yaml:"dbMaxIdle"` + DBMaxActive int `yaml:"dbMaxActive"` + DBIdleTimeout int `yaml:"dbIdleTimeout"` + DBPassWord string `yaml:"dbPassWord"` + EnableCluster bool `yaml:"enableCluster"` } RpcPort struct { OpenImUserPort []int `yaml:"openImUserPort"` @@ -190,8 +191,9 @@ type config struct { } } Manager struct { - AppManagerUid []string `yaml:"appManagerUid"` - Secrets []string `yaml:"secrets"` + AppManagerUid []string `yaml:"appManagerUid"` + Secrets []string `yaml:"secrets"` + AppSysNotificationName string `yaml:"appSysNotificationName"` } Kafka struct { @@ -203,15 +205,19 @@ type config struct { Addr []string `yaml:"addr"` Topic string `yaml:"topic"` } + MsgToMongo struct { + Addr []string `yaml:"addr"` + Topic string `yaml:"topic"` + } Ms2pschat struct { Addr []string `yaml:"addr"` Topic string `yaml:"topic"` } ConsumerGroupID struct { - MsgToMongo string `yaml:"msgToMongo"` - MsgToMongoOffline string `yaml:"msgToMongoOffline"` - MsgToMySql string `yaml:"msgToMySql"` - MsgToPush string `yaml:"msgToPush"` + MsgToRedis string `yaml:"msgToTransfer"` + MsgToMongo string `yaml:"msgToMongo"` + MsgToMySql string `yaml:"msgToMySql"` + MsgToPush string `yaml:"msgToPush"` } } Secret string `yaml:"secret"` @@ -221,7 +227,8 @@ type config struct { MsgCacheTimeout int `yaml:"msgCacheTimeout"` GroupMessageHasReadReceiptEnable bool `yaml:"groupMessageHasReadReceiptEnable"` SingleMessageHasReadReceiptEnable bool `yaml:"singleMessageHasReadReceiptEnable"` - TokenPolicy struct { + + TokenPolicy struct { AccessSecret string `yaml:"accessSecret"` AccessExpire int64 `yaml:"accessExpire"` } @@ -340,6 +347,16 @@ type config struct { OfflinePush POfflinePush `yaml:"offlinePush"` DefaultTips PDefaultTips `yaml:"defaultTips"` } `yaml:"groupMemberInfoSet"` + GroupMemberSetToAdmin struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupMemberSetToAdmin"` + GroupMemberSetToOrdinary struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupMemberSetToOrdinaryUser"` OrganizationChanged struct { Conversation PConversation `yaml:"conversation"` OfflinePush POfflinePush `yaml:"offlinePush"` diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 7728efda9..324e4e8bc 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -68,26 +68,32 @@ const ( GroupNotificationBegin = 1500 - GroupCreatedNotification = 1501 - GroupInfoSetNotification = 1502 - JoinGroupApplicationNotification = 1503 - MemberQuitNotification = 1504 - GroupApplicationAcceptedNotification = 1505 - GroupApplicationRejectedNotification = 1506 - GroupOwnerTransferredNotification = 1507 - MemberKickedNotification = 1508 - MemberInvitedNotification = 1509 - MemberEnterNotification = 1510 - GroupDismissedNotification = 1511 - GroupMemberMutedNotification = 1512 - GroupMemberCancelMutedNotification = 1513 - GroupMutedNotification = 1514 - GroupCancelMutedNotification = 1515 - GroupMemberInfoSetNotification = 1516 + GroupCreatedNotification = 1501 + GroupInfoSetNotification = 1502 + JoinGroupApplicationNotification = 1503 + MemberQuitNotification = 1504 + GroupApplicationAcceptedNotification = 1505 + GroupApplicationRejectedNotification = 1506 + GroupOwnerTransferredNotification = 1507 + MemberKickedNotification = 1508 + MemberInvitedNotification = 1509 + MemberEnterNotification = 1510 + GroupDismissedNotification = 1511 + GroupMemberMutedNotification = 1512 + GroupMemberCancelMutedNotification = 1513 + GroupMutedNotification = 1514 + GroupCancelMutedNotification = 1515 + GroupMemberInfoSetNotification = 1516 + GroupMemberSetToAdminNotification = 1517 + GroupMemberSetToOrdinaryUserNotification = 1518 SignalingNotificationBegin = 1600 SignalingNotification = 1601 - SignalingNotificationEnd = 1699 + SignalingNotificationEnd = 1649 + + SuperGroupNotificationBegin = 1650 + SuperGroupUpdateNotification = 1651 + SuperGroupNotificationEnd = 1699 ConversationPrivateChatNotification = 1701 @@ -96,7 +102,7 @@ const ( WorkMomentNotificationBegin = 1900 WorkMomentNotification = 1901 - NotificationEnd = 2000 + NotificationEnd = 3000 //status MsgNormal = 1 @@ -107,9 +113,9 @@ const ( SysMsgType = 200 //SessionType - SingleChatType = 1 - GroupChatType = 2 - + SingleChatType = 1 + GroupChatType = 2 + SuperGroupChatType = 3 NotificationChatType = 4 //token NormalToken = 0 @@ -156,7 +162,8 @@ const ( //GroupType NormalGroup = 0 - DepartmentGroup = 1 + SuperGroup = 1 + DepartmentGroup = 2 GroupBaned = 3 GroupBanPrivateChat = 4 @@ -206,11 +213,12 @@ const ( WorkMomentAtUserNotification = 2 ) const ( - AtAllString = "AtAllTag" - AtNormal = 0 - AtMe = 1 - AtAll = 2 - AtAllAtMe = 3 + AtAllString = "AtAllTag" + AtNormal = 0 + AtMe = 1 + AtAll = 2 + AtAllAtMe = 3 + GroupNotification = 4 ) var ContentType2PushContent = map[int64]string{ @@ -275,7 +283,7 @@ func GroupIsBanPrivateChat(status int32) bool { return true } -const BigVersion = "v3" +const BigVersion = "v2" const LogFileName = "OpenIM.log" diff --git a/pkg/common/constant/error.go b/pkg/common/constant/error.go index 52c1253e1..08a3c23f8 100644 --- a/pkg/common/constant/error.go +++ b/pkg/common/constant/error.go @@ -56,6 +56,7 @@ var ( ErrCallback = ErrInfo{ErrCode: 809, ErrMsg: CallBackMsg.Error()} ErrSendLimit = ErrInfo{ErrCode: 810, ErrMsg: "send msg limit, to many request, try again later"} ErrMessageHasReadDisable = ErrInfo{ErrCode: 811, ErrMsg: "message has read disable"} + ErrInternal = ErrInfo{ErrCode: 812, ErrMsg: "internal error"} ) var ( diff --git a/pkg/common/constant/platform_number_id_to_name.go b/pkg/common/constant/platform_number_id_to_name.go index c3a970b69..cac93dea8 100644 --- a/pkg/common/constant/platform_number_id_to_name.go +++ b/pkg/common/constant/platform_number_id_to_name.go @@ -27,7 +27,7 @@ const ( TerminalMobile = "Mobile" ) -var PlatformID2Name = map[int32]string{ +var PlatformID2Name = map[int]string{ IOSPlatformID: IOSPlatformStr, AndroidPlatformID: AndroidPlatformStr, WindowsPlatformID: WindowsPlatformStr, @@ -36,7 +36,7 @@ var PlatformID2Name = map[int32]string{ MiniWebPlatformID: MiniWebPlatformStr, LinuxPlatformID: LinuxPlatformStr, } -var PlatformName2ID = map[string]int32{ +var PlatformName2ID = map[string]int{ IOSPlatformStr: IOSPlatformID, AndroidPlatformStr: AndroidPlatformID, WindowsPlatformStr: WindowsPlatformID, @@ -55,10 +55,10 @@ var Platform2class = map[string]string{ LinuxPlatformStr: TerminalPC, } -func PlatformIDToName(num int32) string { +func PlatformIDToName(num int) string { return PlatformID2Name[num] } -func PlatformNameToID(name string) int32 { +func PlatformNameToID(name string) int { return PlatformName2ID[name] } func PlatformNameToClass(name string) string { diff --git a/pkg/common/db/batch_insert_chat.go b/pkg/common/db/batch_insert_chat.go index fd037998c..c6b57201f 100644 --- a/pkg/common/db/batch_insert_chat.go +++ b/pkg/common/db/batch_insert_chat.go @@ -7,7 +7,7 @@ import ( "Open_IM/pkg/utils" "context" "errors" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" "github.com/golang/protobuf/proto" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" @@ -112,7 +112,7 @@ func (d *DataBases) BatchInsertChat2Cache(userID string, msgList []*pbMsg.MsgDat currentMaxSeq, err := d.GetUserMaxSeq(userID) if err == nil { - } else if err == redis.ErrNil { + } else if err == go_redis.Nil { currentMaxSeq = 0 } else { return utils.Wrap(err, ""), 0 @@ -161,7 +161,7 @@ func (d *DataBases) BatchInsertChat(userID string, msgList []*pbMsg.MsgDataToMQ, currentMaxSeq, err := d.GetUserMaxSeq(userID) if err == nil { - } else if err == redis.ErrNil { + } else if err == go_redis.Nil { isInit = true currentMaxSeq = 0 } else { diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index e7282e596..61912b670 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -11,9 +11,6 @@ import ( go_redis "github.com/go-redis/redis/v8" "go.mongodb.org/mongo-driver/mongo/options" - // "context" - // "fmt" - "github.com/garyburd/redigo/redis" "gopkg.in/mgo.v2" "time" @@ -27,11 +24,18 @@ import ( var DB DataBases type DataBases struct { - MysqlDB mysqlDB - mgoSession *mgo.Session - redisPool *redis.Pool + MysqlDB mysqlDB + mgoSession *mgo.Session + //redisPool *redis.Pool mongoClient *mongo.Client - rdb *go_redis.Client + rdb go_redis.UniversalClient +} + +type RedisClient struct { + client *go_redis.Client + cluster *go_redis.ClusterClient + go_redis.UniversalClient + enableCluster bool } func key(dbAddress, dbName string) string { @@ -52,11 +56,11 @@ func init() { uri = config.Config.Mongo.DBUri } else { if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" { - uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress[0], + uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } else { uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", - config.Config.Mongo.DBAddress[0], config.Config.Mongo.DBDatabase, + config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } } @@ -99,28 +103,45 @@ func init() { DB.mongoClient = mongoClient // redis pool init - DB.redisPool = &redis.Pool{ - MaxIdle: config.Config.Redis.DBMaxIdle, - MaxActive: config.Config.Redis.DBMaxActive, - IdleTimeout: time.Duration(config.Config.Redis.DBIdleTimeout) * time.Second, - Dial: func() (redis.Conn, error) { - return redis.Dial( - "tcp", - config.Config.Redis.DBAddress, - redis.DialReadTimeout(time.Duration(1000)*time.Millisecond), - redis.DialWriteTimeout(time.Duration(1000)*time.Millisecond), - redis.DialConnectTimeout(time.Duration(1000)*time.Millisecond), - redis.DialDatabase(0), - redis.DialPassword(config.Config.Redis.DBPassWord), - ) - }, + //DB.redisPool = &redis.Pool{ + // MaxIdle: config.Config.Redis.DBMaxIdle, + // MaxActive: config.Config.Redis.DBMaxActive, + // IdleTimeout: time.Duration(config.Config.Redis.DBIdleTimeout) * time.Second, + // Dial: func() (redis.Conn, error) { + // return redis.Dial( + // "tcp", + // config.Config.Redis.DBAddress, + // redis.DialReadTimeout(time.Duration(1000)*time.Millisecond), + // redis.DialWriteTimeout(time.Duration(1000)*time.Millisecond), + // redis.DialConnectTimeout(time.Duration(1000)*time.Millisecond), + // redis.DialDatabase(0), + // redis.DialPassword(config.Config.Redis.DBPassWord), + // ) + // }, + //} + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + if config.Config.Redis.EnableCluster { + DB.rdb = go_redis.NewClusterClient(&go_redis.ClusterOptions{ + Addrs: config.Config.Redis.DBAddress, + PoolSize: 50, + }) + _, err = DB.rdb.Ping(ctx).Result() + if err != nil { + panic(err.Error()) + } + } else { + DB.rdb = go_redis.NewClient(&go_redis.Options{ + Addr: config.Config.Redis.DBAddress[0], + Password: config.Config.Redis.DBPassWord, // no password set + DB: 0, // use default DB + PoolSize: 100, // 连接池大小 + }) + _, err = DB.rdb.Ping(ctx).Result() + if err != nil { + panic(err.Error()) + } } - DB.rdb = go_redis.NewClient(&go_redis.Options{ - Addr: config.Config.Redis.DBAddress, - Password: config.Config.Redis.DBPassWord, // no password set - DB: 0, // use default DB - PoolSize: 100, // 连接池大小 - }) } func createMongoIndex(client *mongo.Client, collection string, isUnique bool, keys ...string) error { diff --git a/pkg/common/db/model_struct.go b/pkg/common/db/model_struct.go index b0854169e..7bb337775 100644 --- a/pkg/common/db/model_struct.go +++ b/pkg/common/db/model_struct.go @@ -6,6 +6,7 @@ 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"` + UserID string `gorm:"column:user_id;type:varchar(255)" json:"userID"` } // @@ -147,16 +148,17 @@ type GroupRequest struct { //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"` + 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"` + GlobalRecvMsgOpt int32 `gorm:"column:global_recv_msg_opt"` } //message BlackInfo{ diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 22c54dae8..4576c26b5 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -10,7 +10,9 @@ import ( "context" "errors" "fmt" + "github.com/go-redis/redis/v8" "github.com/gogo/protobuf/sortkeys" + "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "math/rand" "sync" @@ -29,6 +31,8 @@ const cTag = "tag" const cSendLog = "send_log" const cWorkMoment = "work_moment" const cCommentMsg = "comment_msg" +const cSuperGroup = "super_group" +const cUserToSuperGroup = "user_to_super_group" const singleGocMsgNum = 5000 func GetSingleGocMsgNum() int { @@ -305,6 +309,57 @@ func (d *DataBases) GetMsgBySeqListMongo2(uid string, seqList []uint32, operatio } return seqMsg, nil } +func (d *DataBases) GetSuperGroupMsgBySeqListMongo(groupID 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 + }(groupID, 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 seqGroupID", seqUid, value, groupID, 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, groupID, 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 := genExceptionSuperGroupMessageBySeqList(diff, groupID) + seqMsg = append(seqMsg, exceptionMSg...) + + } + return seqMsg, nil +} func (d *DataBases) GetMsgAndIndexBySeqListInOneMongo2(suffixUserID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, indexList []int, unexistSeqList []uint32, err error) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) @@ -350,6 +405,17 @@ func genExceptionMessageBySeqList(seqList []uint32) (exceptionMsg []*open_im_sdk return exceptionMsg } +func genExceptionSuperGroupMessageBySeqList(seqList []uint32, groupID string) (exceptionMsg []*open_im_sdk.MsgData) { + for _, v := range seqList { + msg := new(open_im_sdk.MsgData) + msg.Seq = v + msg.GroupID = groupID + msg.SessionType = constant.SuperGroupChatType + 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) @@ -878,6 +944,171 @@ func (d *DataBases) GetUserFriendWorkMoments(showNumber, pageNumber int32, userI return workMomentList, err } +type SuperGroup struct { + GroupID string `bson:"group_id"` + //MemberNumCount int `bson:"member_num_count"` + MemberIDList []string `bson:"member_id_list"` +} + +type UserToSuperGroup struct { + UserID string `bson:"user_id"` + GroupIDList []string `bson:"group_id_list"` +} + +func (d *DataBases) CreateSuperGroup(groupID string, initMemberIDList []string, memberNumCount int) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + superGroup := SuperGroup{ + GroupID: groupID, + MemberIDList: initMemberIDList, + } + _, err = c.InsertOne(sCtx, superGroup) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + var users []UserToSuperGroup + for _, v := range initMemberIDList { + users = append(users, UserToSuperGroup{ + UserID: v, + }) + } + upsert := true + opts := &options.UpdateOptions{ + Upsert: &upsert, + } + c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + _, err = c.UpdateMany(sCtx, bson.M{"user_id": bson.M{"$in": initMemberIDList}}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + session.CommitTransaction(ctx) + return err +} + +func (d *DataBases) GetSuperGroup(groupID string) (SuperGroup, error) { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + superGroup := SuperGroup{} + err := c.FindOne(ctx, bson.M{"group_id": groupID}).Decode(&superGroup) + return superGroup, err +} + +func (d *DataBases) AddUserToSuperGroup(groupID string, userIDList []string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + if err != nil { + return utils.Wrap(err, "start transaction failed") + } + _, err = c.UpdateOne(sCtx, bson.M{"group_id": groupID}, bson.M{"$addToSet": bson.M{"member_id_list": bson.M{"$each": userIDList}}}) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + var users []UserToSuperGroup + for _, v := range userIDList { + users = append(users, UserToSuperGroup{ + UserID: v, + }) + } + upsert := true + opts := &options.UpdateOptions{ + Upsert: &upsert, + } + for _, userID := range userIDList { + _, err = c.UpdateOne(sCtx, bson.M{"user_id": userID}, bson.M{"$addToSet": bson.M{"group_id_list": groupID}}, opts) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + } + session.CommitTransaction(ctx) + return err +} + +func (d *DataBases) RemoverUserFromSuperGroup(groupID string, userIDList []string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + _, err = c.UpdateOne(ctx, bson.M{"group_id": groupID}, bson.M{"$pull": bson.M{"member_id_list": bson.M{"$in": userIDList}}}) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + err = d.RemoveGroupFromUser(ctx, sCtx, groupID, userIDList) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + session.CommitTransaction(ctx) + return err +} + +func (d *DataBases) GetSuperGroupByUserID(userID string) (UserToSuperGroup, error) { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + var user UserToSuperGroup + return user, c.FindOne(ctx, bson.M{"user_id": userID}).Decode(&user) +} + +func (d *DataBases) DeleteSuperGroup(groupID string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSuperGroup) + session, err := d.mongoClient.StartSession() + if err != nil { + return utils.Wrap(err, "start session failed") + } + defer session.EndSession(ctx) + sCtx := mongo.NewSessionContext(ctx, session) + superGroup := &SuperGroup{} + result := c.FindOneAndDelete(sCtx, bson.M{"group_id": groupID}) + err = result.Decode(superGroup) + if err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + if err = d.RemoveGroupFromUser(ctx, sCtx, groupID, superGroup.MemberIDList); err != nil { + session.AbortTransaction(ctx) + return utils.Wrap(err, "transaction failed") + } + session.CommitTransaction(ctx) + return nil +} + +func (d *DataBases) RemoveGroupFromUser(ctx, sCtx context.Context, groupID string, userIDList []string) error { + var users []UserToSuperGroup + for _, v := range userIDList { + users = append(users, UserToSuperGroup{ + UserID: v, + }) + } + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cUserToSuperGroup) + _, err := c.UpdateOne(sCtx, bson.M{"user_id": bson.M{"$in": userIDList}}, bson.M{"$pull": bson.M{"group_id_list": groupID}}) + if err != nil { + return utils.Wrap(err, "UpdateOne transaction failed") + } + return err +} + func generateTagID(tagName, userID string) string { return utils.Md5(tagName + userID + strconv.Itoa(rand.Int()) + time.Now().String()) } @@ -902,6 +1133,21 @@ func getSeqUid(uid string, seq uint32) string { return indexGen(uid, seqSuffix) } +func getSeqUserIDList(userID string, maxSeq uint32) []string { + seqMaxSuffix := maxSeq / singleGocMsgNum + var seqUserIDList []string + for i := 0; i <= int(seqMaxSuffix); i++ { + seqUserID := indexGen(userID, uint32(i)) + seqUserIDList = append(seqUserIDList, seqUserID) + } + return seqUserIDList +} + +func getSeqSuperGroupID(groupID string, seq uint32) string { + seqSuffix := seq / singleGocMsgNum + return superGroupIndexGen(groupID, seqSuffix) +} + func GetSeqUid(uid string, seq uint32) string { return getSeqUid(uid, seq) } @@ -938,3 +1184,26 @@ func isNotContainInt32(target uint32, List []uint32) bool { func indexGen(uid string, seqSuffix uint32) string { return uid + ":" + strconv.FormatInt(int64(seqSuffix), 10) } +func superGroupIndexGen(groupID string, seqSuffix uint32) string { + return "super_group_" + groupID + ":" + strconv.FormatInt(int64(seqSuffix), 10) +} + +func (d *DataBases) CleanUpUserMsgFromMongo(userID string, operationID string) error { + ctx := context.Background() + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + maxSeq, err := d.GetUserMaxSeq(userID) + if err == redis.Nil { + return nil + } + if err != nil { + return utils.Wrap(err, "") + } + + seqUsers := getSeqUserIDList(userID, uint32(maxSeq)) + log.Error(operationID, "getSeqUserIDList", seqUsers) + _, err = c.DeleteMany(ctx, bson.M{"uid": bson.M{"$in": seqUsers}}) + if err == mongo.ErrNoDocuments { + return nil + } + return utils.Wrap(err, "") +} diff --git a/pkg/common/db/mysql.go b/pkg/common/db/mysql.go index 0f9f4303f..9713537b9 100644 --- a/pkg/common/db/mysql.go +++ b/pkg/common/db/mysql.go @@ -53,7 +53,9 @@ func initMysqlDB() { } fmt.Println("open db ok ", dsn) - db.AutoMigrate(&Friend{}, + db.AutoMigrate( + &Register{}, + &Friend{}, &FriendRequest{}, &Group{}, &GroupMember{}, 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 index eff3050be..278e8bd7f 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go @@ -15,11 +15,12 @@ func GetRegister(account string) (*db.Register, error) { account).Take(&r).Error } -func SetPassword(account, password, ex string) error { +func SetPassword(account, password, ex, userID string) error { r := db.Register{ Account: account, Password: password, Ex: ex, + UserID: userID, } dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { diff --git a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go index 17a6c938f..52b5bf245 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go @@ -16,14 +16,14 @@ func CreateDepartment(department *db.Department) error { return dbConn.Table("departments").Create(department).Error } -func GetDepartment(departmentID string) (error, *db.Department) { +func GetDepartment(departmentID string) (*db.Department, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { - return err, nil + return nil, err } var department db.Department err = dbConn.Table("departments").Where("department_id=?", departmentID).Find(&department).Error - return err, &department + return &department, err } func UpdateDepartment(department *db.Department, args map[string]interface{}) error { @@ -237,6 +237,15 @@ func GetSubDepartmentNum(departmentID string) (error, uint32) { return nil, number } +func SetDepartmentRelatedGroupID(groupID, departmentID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return utils.Wrap(err, "DefaultGormDB failed") + } + department := &db.Department{RelatedGroupID: groupID} + return dbConn.Model(&department).Where("department_id=?", departmentID).Update(department).Error +} + func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error) { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { @@ -249,12 +258,17 @@ func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*db.Department, error) { var department db.Department + var parentDepartment db.Department //var parentID string dbConn.LogMode(true) - // select * from departments where department_id = (select parent_id from departments where department_id= zx234fd); - //dbConn.Table("departments").Where("department_id=?", departmentID).Pluck("parent_id", parentID).Error - err := dbConn.Table("departments").Where("department_id=?").Find(&department).Error - return &department, err + err := dbConn.Model(&department).Where("department_id=?", departmentID).Select("parent_id").First(&department).Error + if err != nil { + return nil, utils.Wrap(err, "") + } + if department.ParentID != "" { + err = dbConn.Model(&parentDepartment).Where("department_id = ?", department.ParentID).Find(&parentDepartment).Error + } + return &parentDepartment, utils.Wrap(err, "") } func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList *[]string) error { @@ -262,9 +276,9 @@ func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList *[]s if err != nil { return err } - if department.ParentID != "" { - *parentIDList = append(*parentIDList, department.ParentID) - err = GetDepartmentParent(departmentID, dbConn, parentIDList) + if department.DepartmentID != "" { + *parentIDList = append(*parentIDList, department.DepartmentID) + err = GetDepartmentParent(department.DepartmentID, dbConn, parentIDList) if err != nil { return err } @@ -281,3 +295,13 @@ func GetDepartmentParentIDList(departmentID string) ([]string, error) { err = GetDepartmentParent(departmentID, dbConn, &parentIDList) return parentIDList, err } + +func GetRandomDepartmentID() (string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return "", err + } + department := &db.Department{} + err = dbConn.Model(department).Order("RAND()").Where("related_group_id != ? AND department_id != ?", "", "0").First(department).Error + return department.DepartmentID, 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 4f26cecbe..1598bac4e 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 @@ -22,7 +22,11 @@ func init() { } var appMgr db.User appMgr.UserID = v - appMgr.Nickname = "AppManager" + utils.IntToString(k+1) + if k == 0 { + appMgr.Nickname = config.Config.Manager.AppSysNotificationName + } else { + appMgr.Nickname = "AppManager" + utils.IntToString(k+1) + } appMgr.AppMangerLevel = constant.AppAdmin err = UserRegister(appMgr) if err != nil { @@ -103,6 +107,17 @@ func UpdateUserInfo(user db.User) error { } dbConn.LogMode(false) err = dbConn.Table("users").Where("user_id=?", user.UserID).Update(&user).Error + + return err +} + +func UpdateUserInfoByMap(user db.User, m map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + err = dbConn.Table("users").Where("user_id=?", user.UserID).Updates(m).Error return err } 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 99c099ac4..5f7ef59f7 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 @@ -26,7 +26,7 @@ func InsertMessageToChatLog(msg pbMsg.MsgDataToMQ) error { chatLog := new(db.ChatLog) copier.Copy(chatLog, msg.MsgData) switch msg.MsgData.SessionType { - case constant.GroupChatType: + case constant.GroupChatType, constant.SuperGroupChatType: chatLog.RecvID = msg.MsgData.GroupID case constant.SingleChatType: chatLog.RecvID = msg.MsgData.RecvID diff --git a/pkg/common/db/newRedisModel.go b/pkg/common/db/newRedisModel.go index 4147b7af3..da5ec2127 100644 --- a/pkg/common/db/newRedisModel.go +++ b/pkg/common/db/newRedisModel.go @@ -2,23 +2,21 @@ package db import ( "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" log2 "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/chat" pbRtc "Open_IM/pkg/proto/rtc" pbCommon "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" + "encoding/json" "errors" "fmt" - - "github.com/garyburd/redigo/redis" - - //goRedis "github.com/go-redis/redis/v8" + go_redis "github.com/go-redis/redis/v8" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" "strconv" "time" - - "github.com/golang/protobuf/proto" - "github.com/mitchellh/mapstructure" ) //func (d * DataBases)pubMessage(channel, msg string) { @@ -27,68 +25,158 @@ import ( //func (d * DataBases)pubMessage(channel, msg string) { // d.rdb.Publish(context.Background(),channel,msg) //} +func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { + key := accountTempCode + account + n, err := d.rdb.Exists(context.Background(), key).Result() + if n > 0 { + return true, err + } else { + return false, err + } +} +func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error) { + key := accountTempCode + account + return d.rdb.Set(context.Background(), key, code, time.Duration(ttl)*time.Second).Err() +} +func (d *DataBases) GetAccountCode(account string) (string, error) { + key := accountTempCode + account + return d.rdb.Get(context.Background(), key).Result() +} -func (d *DataBases) NewGetMessageListBySeq(userID string, seqList []uint32, operationID string) (seqMsg []*pbCommon.MsgData, failedSeqList []uint32, errResult error) { +//Perform seq auto-increment operation of user messages +func (d *DataBases) IncrUserSeq(uid string) (uint64, error) { + key := userIncrSeq + uid + seq, err := d.rdb.Incr(context.Background(), key).Result() + return uint64(seq), err +} + +//Get the largest Seq +func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) { + key := userIncrSeq + uid + seq, err := d.rdb.Get(context.Background(), key).Result() + return uint64(utils.StringToInt(seq)), err +} + +//set the largest Seq +func (d *DataBases) SetUserMaxSeq(uid string, maxSeq uint64) error { + key := userIncrSeq + uid + return d.rdb.Set(context.Background(), key, maxSeq, 0).Err() +} + +//Set the user's minimum seq +func (d *DataBases) SetUserMinSeq(uid string, minSeq uint32) (err error) { + key := userMinSeq + uid + return d.rdb.Set(context.Background(), key, minSeq, 0).Err() +} + +//Get the smallest Seq +func (d *DataBases) GetUserMinSeq(uid string) (uint64, error) { + key := userMinSeq + uid + seq, err := d.rdb.Get(context.Background(), key).Result() + return uint64(utils.StringToInt(seq)), err +} + +//Store userid and platform class to redis +func (d *DataBases) AddTokenFlag(userID string, platformID int, token string, flag int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + log2.NewDebug("", "add token key is ", key) + return d.rdb.HSet(context.Background(), key, token, flag).Err() +} + +func (d *DataBases) GetTokenMapByUidPid(userID, platformID string) (map[string]int, error) { + key := uidPidToken + userID + ":" + platformID + log2.NewDebug("", "get token key is ", key) + m, err := d.rdb.HGetAll(context.Background(), key).Result() + mm := make(map[string]int) + for k, v := range m { + mm[k] = utils.StringToInt(v) + } + return mm, err +} +func (d *DataBases) SetTokenMapByUidPid(userID string, platformID int, m map[string]int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + return d.rdb.HMSet(context.Background(), key, m).Err() +} +func (d *DataBases) DeleteTokenByUidPid(userID string, platformID int, fields []string) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + return d.rdb.HDel(context.Background(), key, fields...).Err() +} +func (d *DataBases) SetSingleConversationRecvMsgOpt(userID, conversationID string, opt int32) error { + key := conversationReceiveMessageOpt + userID + return d.rdb.HSet(context.Background(), key, conversationID, opt).Err() +} + +func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID string) (int, error) { + key := conversationReceiveMessageOpt + userID + result, err := d.rdb.HGet(context.Background(), key, conversationID).Result() + return utils.StringToInt(result), err +} +func (d *DataBases) SetUserGlobalMsgRecvOpt(userID string, opt int32) error { + key := conversationReceiveMessageOpt + userID + return d.rdb.HSet(context.Background(), key, GlobalMsgRecvOpt, opt).Err() +} +func (d *DataBases) GetUserGlobalMsgRecvOpt(userID string) (int, error) { + key := conversationReceiveMessageOpt + userID + result, err := d.rdb.HGet(context.Background(), key, GlobalMsgRecvOpt).Result() + if err != nil { + if err == go_redis.Nil { + return 0, nil + } else { + return 0, err + } + } + return utils.StringToInt(result), err +} +func (d *DataBases) GetMessageListBySeq(userID string, seqList []uint32, operationID string) (seqMsg []*pbCommon.MsgData, failedSeqList []uint32, errResult error) { for _, v := range seqList { //MESSAGE_CACHE:169.254.225.224_reliability1653387820_0_1 key := messageCache + userID + "_" + strconv.Itoa(int(v)) - result, err := d.rdb.HGetAll(context.Background(), key).Result() + result, err := d.rdb.Get(context.Background(), key).Result() if err != nil { errResult = err failedSeqList = append(failedSeqList, v) log2.NewWarn(operationID, "redis get message error:", err.Error(), v) } else { - msg, err := Map2Pb(result) - //msg := pbCommon.MsgData{} - //err = jsonpb.UnmarshalString(result, &msg) + msg := pbCommon.MsgData{} + err = jsonpb.UnmarshalString(result, &msg) if err != nil { errResult = err failedSeqList = append(failedSeqList, v) log2.NewWarn(operationID, "Unmarshal err", result, err.Error()) } else { log2.NewDebug(operationID, "redis get msg is ", msg.String()) - seqMsg = append(seqMsg, msg) + seqMsg = append(seqMsg, &msg) } } } return seqMsg, failedSeqList, errResult } -func Map2Pb(m map[string]string) (*pbCommon.MsgData, error) { - var data pbCommon.MsgData - err := mapstructure.Decode(m, &data) - if err != nil { - return nil, err - } - return &data, nil -} - -func (d *DataBases) NewSetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error { +func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error { ctx := context.Background() + pipe := d.rdb.Pipeline() var failedList []pbChat.MsgDataToMQ for _, msg := range msgList { key := messageCache + uid + "_" + strconv.Itoa(int(msg.MsgData.Seq)) - s, err := utils.Pb2Map(msg.MsgData) + s, err := utils.Pb2String(msg.MsgData) if err != nil { - log2.NewWarn(operationID, utils.GetSelfFuncName(), "Pb2Map failed", msg.MsgData.String(), uid, err.Error()) + log2.NewWarn(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg.MsgData.String(), uid, err.Error()) continue } - log2.NewDebug(operationID, "convert map is ", s) - fmt.Println("ts", s) - err = d.rdb.HMSet(context.Background(), key, s).Err() + log2.NewDebug(operationID, "convert string is ", s) + err = pipe.Set(ctx, key, s, time.Duration(config.Config.MsgCacheTimeout)*time.Second).Err() //err = d.rdb.HMSet(context.Background(), "12", map[string]interface{}{"1": 2, "343": false}).Err() if err != nil { - return err log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid, s, err.Error()) failedList = append(failedList, *msg) } - d.rdb.Expire(ctx, key, time.Second*time.Duration(config.Config.MsgCacheTimeout)) } if len(failedList) != 0 { return errors.New(fmt.Sprintf("set msg to cache failed, failed lists: %q,%s", failedList, operationID)) } - return nil + _, err := pipe.Exec(ctx) + return err } func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID string) error { @@ -96,7 +184,7 @@ func (d *DataBases) CleanUpOneUserAllMsgFromRedis(userID string, operationID str key := messageCache + userID + "_" + "*" vals, err := d.rdb.Keys(ctx, key).Result() log2.Debug(operationID, "vals: ", vals) - if err == redis.ErrNil { + if err == go_redis.Nil { return nil } if err != nil { @@ -205,3 +293,114 @@ func (d *DataBases) DelUserSignalList(userID string) error { err := d.rdb.Del(context.Background(), keyList).Err() return err } + +func (d *DataBases) DelMsgFromCache(uid string, seqList []uint32, operationID string) { + for _, seq := range seqList { + key := messageCache + uid + "_" + strconv.Itoa(int(seq)) + result := d.rdb.Get(context.Background(), key).String() + var msg pbCommon.MsgData + if err := utils.String2Pb(result, &msg); err != nil { + log2.Error(operationID, utils.GetSelfFuncName(), "String2Pb failed", msg, err.Error()) + continue + } + msg.Status = constant.MsgDeleted + s, err := utils.Pb2String(&msg) + if err != nil { + log2.Error(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg, err.Error()) + continue + } + if err := d.rdb.Set(context.Background(), key, s, time.Duration(config.Config.MsgCacheTimeout)*time.Second).Err(); err != nil { + log2.Error(operationID, utils.GetSelfFuncName(), "Set failed", err.Error()) + } + } +} + +func (d *DataBases) SetGetuiToken(token string, expireTime int64) error { + return d.rdb.Set(context.Background(), getuiToken, token, time.Duration(expireTime)*time.Second).Err() +} + +func (d *DataBases) GetGetuiToken() (string, error) { + result := d.rdb.Get(context.Background(), getuiToken) + return result.String(), result.Err() +} + +func (d *DataBases) AddFriendToCache(userID string, friendIDList ...string) error { + var IDList []interface{} + for _, id := range friendIDList { + IDList = append(IDList, id) + } + return d.rdb.SAdd(context.Background(), friendRelationCache+userID, IDList...).Err() +} + +func (d *DataBases) ReduceFriendToCache(userID string, friendIDList ...string) error { + var IDList []interface{} + for _, id := range friendIDList { + IDList = append(IDList, id) + } + return d.rdb.SRem(context.Background(), friendRelationCache+userID, IDList...).Err() +} + +func (d *DataBases) GetFriendIDListFromCache(userID string) ([]string, error) { + result := d.rdb.SMembers(context.Background(), friendRelationCache+userID) + return result.Result() +} + +func (d *DataBases) AddBlackUserToCache(userID string, blackList ...string) error { + var IDList []interface{} + for _, id := range blackList { + IDList = append(IDList, id) + } + return d.rdb.SAdd(context.Background(), blackListCache+userID, IDList...).Err() +} + +func (d *DataBases) ReduceBlackUserFromCache(userID string, blackList ...string) error { + var IDList []interface{} + for _, id := range blackList { + IDList = append(IDList, id) + } + return d.rdb.SRem(context.Background(), blackListCache+userID, IDList...).Err() +} + +func (d *DataBases) GetBlackListFromCache(userID string) ([]string, error) { + result := d.rdb.SMembers(context.Background(), blackListCache+userID) + return result.Result() +} + +func (d *DataBases) AddGroupMemberToCache(groupID string, userIDList ...string) error { + var IDList []interface{} + for _, id := range userIDList { + IDList = append(IDList, id) + } + return d.rdb.SAdd(context.Background(), groupCache+groupID, IDList...).Err() +} + +func (d *DataBases) ReduceGroupMemberFromCache(groupID string, userIDList ...string) error { + var IDList []interface{} + for _, id := range userIDList { + IDList = append(IDList, id) + } + return d.rdb.SRem(context.Background(), groupCache+groupID, IDList...).Err() +} + +func (d *DataBases) GetGroupMemberIDListFromCache(groupID string) ([]string, error) { + result := d.rdb.SMembers(context.Background(), groupCache+groupID) + return result.Result() +} + +func (d *DataBases) SetUserInfoToCache(userID string, m map[string]interface{}) error { + return d.rdb.HSet(context.Background(), userInfoCache+userID, m).Err() +} + +func (d *DataBases) GetUserInfoFromCache(userID string) (*pbCommon.UserInfo, error) { + result, err := d.rdb.HGetAll(context.Background(), userInfoCache+userID).Result() + bytes, err := json.Marshal(result) + if err != nil { + return nil, err + } + userInfo := &pbCommon.UserInfo{} + if err := proto.Unmarshal(bytes, userInfo); err != nil { + return nil, err + } + err = json.Unmarshal(bytes, userInfo) + return userInfo, err +} diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go index 364b386ce..c986d408f 100644 --- a/pkg/common/db/redisModel.go +++ b/pkg/common/db/redisModel.go @@ -1,25 +1,5 @@ package db -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - log2 "Open_IM/pkg/common/log" - pbChat "Open_IM/pkg/proto/chat" - pbRtc "Open_IM/pkg/proto/rtc" - pbCommon "Open_IM/pkg/proto/sdk_ws" - "Open_IM/pkg/utils" - "encoding/json" - "errors" - "fmt" - - "github.com/garyburd/redigo/redis" - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" - - //osconfig "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha" - "strconv" -) - const ( accountTempCode = "ACCOUNT_TEMP_CODE" resetPwdTempCode = "RESET_PWD_TEMP_CODE" @@ -28,7 +8,7 @@ const ( userMinSeq = "REDIS_USER_MIN_SEQ:" uidPidToken = "UID_PID_TOKEN_STATUS:" conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:" - getuiToken = "GETUI" + getuiToken = "GETUI_TOKEN" userInfoCache = "USER_INFO_CACHE:" friendRelationCache = "FRIEND_RELATION_CACHE:" blackListCache = "BLACK_LIST_CACHE:" @@ -36,338 +16,319 @@ const ( messageCache = "MESSAGE_CACHE:" SignalCache = "SIGNAL_CACHE:" SignalListCache = "SIGNAL_LIST_CACHE:" + GlobalMsgRecvOpt = "GLOBAL_MSG_RECV_OPT" ) -func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { - con := d.redisPool.Get() - if err := con.Err(); err != nil { - log2.Error("", "", "redis cmd = %v, err = %v", cmd, err) - return nil, err - } - defer con.Close() +//func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { +// con := d.redisPool.Get() +// if err := con.Err(); err != nil { +// log2.Error("", "", "redis cmd = %v, err = %v", cmd, err) +// return nil, err +// } +// defer con.Close() +// +// params := make([]interface{}, 0) +// params = append(params, key) +// +// if len(args) > 0 { +// for _, v := range args { +// params = append(params, v) +// } +// } +// +// return con.Do(cmd, params...) +//} - params := make([]interface{}, 0) - params = append(params, key) +//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) (uint64, error) { +// key := userIncrSeq + uid +// return redis.Uint64(d.Exec("INCR", key)) +//} +// +////Get the largest Seq +//func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) { +// key := userIncrSeq + uid +// return redis.Uint64(d.Exec("GET", key)) +//} +// +////set the largest Seq +//func (d *DataBases) SetUserMaxSeq(uid string, maxSeq uint64) error { +// key := userIncrSeq + uid +// _, err := d.Exec("SET", key, maxSeq) +// return err +//} +// +////Set the user's minimum seq +//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) (uint64, error) { +// key := userMinSeq + uid +// return redis.Uint64(d.Exec("GET", key)) +//} +// +// +////Store userid and platform class to redis +//func (d *DataBases) AddTokenFlag(userID string, platformID int, 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 int, m map[string]int) error { +// key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) +// _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) +// return err +//} +//func (d *DataBases) DeleteTokenByUidPid(userID string, platformID int, fields []string) error { +// key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) +// _, err := d.Exec("HDEL", key, redis.Args{}.Add().AddFlat(fields)...) +// return err +//} +// +//func (d *DataBases) SetSingleConversationRecvMsgOpt(userID, conversationID string, opt int32) error { +// key := conversationReceiveMessageOpt + userID +// _, err := d.Exec("HSet", key, conversationID, opt) +// return err +//} +// +//func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID string) (int, error) { +// key := conversationReceiveMessageOpt + userID +// return redis.Int(d.Exec("HGet", key, conversationID)) +//} +//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 +// +//} - if len(args) > 0 { - for _, v := range args { - params = append(params, v) - } - } - - 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) (uint64, error) { - key := userIncrSeq + uid - return redis.Uint64(d.Exec("INCR", key)) -} - -//Get the largest Seq -func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) { - key := userIncrSeq + uid - return redis.Uint64(d.Exec("GET", key)) -} - -//set the largest Seq -func (d *DataBases) SetUserMaxSeq(uid string, maxSeq uint64) error { - key := userIncrSeq + uid - _, err := d.Exec("SET", key, maxSeq) - return err -} - -//Set the user's minimum seq -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) (uint64, error) { - key := userMinSeq + uid - return redis.Uint64(d.Exec("GET", key)) -} - -//Store Apple's device token to redis -func (d *DataBases) SetAppleDeviceToken(accountAddress, value string) (err error) { - key := appleDeviceToken + accountAddress - _, err = d.Exec("SET", key, value) - return err -} - -//Delete Apple device token -func (d *DataBases) DelAppleDeviceToken(accountAddress string) (err error) { - key := appleDeviceToken + accountAddress - _, err = d.Exec("DEL", key) - return err -} - -//Store userid and platform class to redis -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 -} -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 -} - -func (d *DataBases) SetSingleConversationRecvMsgOpt(userID, conversationID string, opt int32) error { - key := conversationReceiveMessageOpt + userID - _, err := d.Exec("HSet", key, conversationID, opt) - return err -} - -func (d *DataBases) GetSingleConversationRecvMsgOpt(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 - -} - -func (d *DataBases) SetGetuiToken(token string, expireTime int64) error { - _, err := d.Exec("SET", getuiToken, token, "ex", expireTime) - return err -} - -func (d *DataBases) GetGetuiToken() (string, error) { - result, err := redis.String(d.Exec("GET", getuiToken)) - return result, err -} +//func (d *DataBases) SetGetuiToken(token string, expireTime int64) error { +// _, err := d.Exec("SET", getuiToken, token, "ex", expireTime) +// return err +//} +// +//func (d *DataBases) GetGetuiToken() (string, error) { +// result, err := redis.String(d.Exec("GET", getuiToken)) +// return result, err +//} func (d *DataBases) SearchContentType() { } -func (d *DataBases) SetUserInfoToCache(userID string, m map[string]interface{}) error { - _, err := d.Exec("hmset", userInfoCache+userID, redis.Args{}.Add().AddFlat(m)...) - return err -} +//func (d *DataBases) SetUserInfoToCache(userID string, m map[string]interface{}) error { +// _, err := d.Exec("hmset", userInfoCache+userID, redis.Args{}.Add().AddFlat(m)...) +// return err +//} +// +//func (d *DataBases) GetUserInfoFromCache(userID string) (*pbCommon.UserInfo, error) { +// result, err := redis.String(d.Exec("hgetall", userInfoCache+userID)) +// log2.NewInfo("", result) +// if err != nil { +// return nil, err +// } +// userInfo := &pbCommon.UserInfo{} +// err = json.Unmarshal([]byte(result), userInfo) +// return userInfo, err +//} -func (d *DataBases) GetUserInfoFromCache(userID string) (*pbCommon.UserInfo, error) { - result, err := redis.String(d.Exec("hgetall", userInfoCache+userID)) - log2.NewInfo("", result) - if err != nil { - return nil, err - } - userInfo := &pbCommon.UserInfo{} - err = json.Unmarshal([]byte(result), userInfo) - return userInfo, err -} +//func (d *DataBases) AddFriendToCache(userID string, friendIDList ...string) error { +// var IDList []interface{} +// for _, id := range friendIDList { +// IDList = append(IDList, id) +// } +// _, err := d.Exec("SADD", friendRelationCache+userID, IDList...) +// return err +//} -func (d *DataBases) AddFriendToCache(userID string, friendIDList ...string) error { - var IDList []interface{} - for _, id := range friendIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SADD", friendRelationCache+userID, IDList...) - return err -} +//func (d *DataBases) ReduceFriendToCache(userID string, friendIDList ...string) error { +// var IDList []interface{} +// for _, id := range friendIDList { +// IDList = append(IDList, id) +// } +// _, err := d.Exec("SREM", friendRelationCache+userID, IDList...) +// return err +//} -func (d *DataBases) ReduceFriendToCache(userID string, friendIDList ...string) error { - var IDList []interface{} - for _, id := range friendIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SREM", friendRelationCache+userID, IDList...) - return err -} +//func (d *DataBases) GetFriendIDListFromCache(userID string) ([]string, error) { +// result, err := redis.Strings(d.Exec("SMEMBERS", friendRelationCache+userID)) +// return result, err +//} +// +//func (d *DataBases) AddBlackUserToCache(userID string, blackList ...string) error { +// var IDList []interface{} +// for _, id := range blackList { +// IDList = append(IDList, id) +// } +// _, err := d.Exec("SADD", blackListCache+userID, IDList...) +// return err +//} -func (d *DataBases) GetFriendIDListFromCache(userID string) ([]string, error) { - result, err := redis.Strings(d.Exec("SMEMBERS", friendRelationCache+userID)) - return result, err -} +//func (d *DataBases) ReduceBlackUserFromCache(userID string, blackList ...string) error { +// var IDList []interface{} +// for _, id := range blackList { +// IDList = append(IDList, id) +// } +// _, err := d.Exec("SREM", blackListCache+userID, IDList...) +// return err +//} -func (d *DataBases) AddBlackUserToCache(userID string, blackList ...string) error { - var IDList []interface{} - for _, id := range blackList { - IDList = append(IDList, id) - } - _, err := d.Exec("SADD", blackListCache+userID, IDList...) - return err -} +//func (d *DataBases) GetBlackListFromCache(userID string) ([]string, error) { +// result, err := redis.Strings(d.Exec("SMEMBERS", blackListCache+userID)) +// return result, err +//} -func (d *DataBases) ReduceBlackUserFromCache(userID string, blackList ...string) error { - var IDList []interface{} - for _, id := range blackList { - IDList = append(IDList, id) - } - _, err := d.Exec("SREM", blackListCache+userID, IDList...) - return err -} +//func (d *DataBases) AddGroupMemberToCache(groupID string, userIDList ...string) error { +// var IDList []interface{} +// for _, id := range userIDList { +// IDList = append(IDList, id) +// } +// _, err := d.Exec("SADD", groupCache+groupID, IDList...) +// return err +//} -func (d *DataBases) GetBlackListFromCache(userID string) ([]string, error) { - result, err := redis.Strings(d.Exec("SMEMBERS", blackListCache+userID)) - return result, err -} +//func (d *DataBases) ReduceGroupMemberFromCache(groupID string, userIDList ...string) error { +// var IDList []interface{} +// for _, id := range userIDList { +// IDList = append(IDList, id) +// } +// _, err := d.Exec("SREM", groupCache+groupID, IDList...) +// return err +//} -func (d *DataBases) AddGroupMemberToCache(groupID string, userIDList ...string) error { - var IDList []interface{} - for _, id := range userIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SADD", groupCache+groupID, IDList...) - return err -} +//func (d *DataBases) GetGroupMemberIDListFromCache(groupID string) ([]string, error) { +// result, err := redis.Strings(d.Exec("SMEMBERS", groupCache+groupID)) +// return result, err +//} -func (d *DataBases) ReduceGroupMemberFromCache(groupID string, userIDList ...string) error { - var IDList []interface{} - for _, id := range userIDList { - IDList = append(IDList, id) - } - _, err := d.Exec("SREM", groupCache+groupID, IDList...) - return err -} +//func (d *DataBases) GetMessageListBySeq(userID string, seqList []uint32, operationID string) (seqMsg []*pbCommon.MsgData, failedSeqList []uint32, errResult error) { +// for _, v := range seqList { +// //MESSAGE_CACHE:169.254.225.224_reliability1653387820_0_1 +// key := messageCache + userID + "_" + strconv.Itoa(int(v)) +// +// result, err := redis.String(d.Exec("GET", key)) +// if err != nil { +// errResult = err +// failedSeqList = append(failedSeqList, v) +// log2.NewWarn(operationID, "redis get message error:", err.Error(), v) +// } else { +// msg := pbCommon.MsgData{} +// err = jsonpb.UnmarshalString(result, &msg) +// if err != nil { +// errResult = err +// failedSeqList = append(failedSeqList, v) +// log2.NewWarn(operationID, "Unmarshal err", result, err.Error()) +// } else { +// log2.NewDebug(operationID, "redis get msg is ", msg.String()) +// seqMsg = append(seqMsg, &msg) +// } +// +// } +// } +// return seqMsg, failedSeqList, errResult +//} -func (d *DataBases) GetGroupMemberIDListFromCache(groupID string) ([]string, error) { - result, err := redis.Strings(d.Exec("SMEMBERS", groupCache+groupID)) - return result, err -} -func (d *DataBases) GetMessageListBySeq(userID string, seqList []uint32, operationID string) (seqMsg []*pbCommon.MsgData, failedSeqList []uint32, errResult error) { - for _, v := range seqList { - //MESSAGE_CACHE:169.254.225.224_reliability1653387820_0_1 - key := messageCache + userID + "_" + strconv.Itoa(int(v)) +//func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error { +// var failedList []pbChat.MsgDataToMQ +// for _, msg := range msgList { +// key := messageCache + uid + "_" + strconv.Itoa(int(msg.MsgData.Seq)) +// s, err := utils.Pb2String(msg.MsgData) +// if err != nil { +// log2.NewWarn(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg.MsgData.String(), uid, err.Error()) +// continue +// } +// log2.NewDebug(operationID, "convert string is ", s) +// _, err = d.Exec("SET", key, s, "ex", config.Config.MsgCacheTimeout) +// if err != nil { +// log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid, s) +// failedList = append(failedList, *msg) +// } +// } +// if len(failedList) != 0 { +// return errors.New(fmt.Sprintf("set msg to cache failed, failed lists: %q", failedList)) +// } +// return nil +//} - result, err := redis.String(d.Exec("GET", key)) - if err != nil { - errResult = err - failedSeqList = append(failedSeqList, v) - log2.NewWarn(operationID, "redis get message error:", err.Error(), v) - } else { - msg := pbCommon.MsgData{} - err = jsonpb.UnmarshalString(result, &msg) - if err != nil { - errResult = err - failedSeqList = append(failedSeqList, v) - log2.NewWarn(operationID, "Unmarshal err", result, err.Error()) - } else { - log2.NewDebug(operationID, "redis get msg is ", msg.String()) - seqMsg = append(seqMsg, &msg) - } +//func (d *DataBases) DelMsgFromCache(uid string, seqList []uint32, operationID string) { +// for _, seq := range seqList { +// key := messageCache + uid + "_" + strconv.Itoa(int(seq)) +// result, err := redis.String(d.Exec("GET", key)) +// if err != nil { +// log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key) +// continue +// } +// log2.Debug(operationID, utils.GetSelfFuncName(), "del result", result) +// var msg pbCommon.MsgData +// err = utils.String2Pb(result, &msg) +// log2.NewDebug(operationID, utils.GetSelfFuncName(), "msg", msg) +// if err != nil { +// log2.NewWarn(operationID, utils.GetSelfFuncName(), "string2Pb failed", msg, err.Error()) +// continue +// } +// msg.Status = constant.MsgDeleted +// s, err := utils.Pb2String(&msg) +// if err != nil { +// log2.NewWarn(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg, err.Error()) +// continue +// } +// _, err = d.Exec("SET", key, s) +// if err != nil { +// log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, msg, s) +// } +// } +//} - } - } - return seqMsg, failedSeqList, errResult -} - -func (d *DataBases) SetMessageToCache(msgList []*pbChat.MsgDataToMQ, uid string, operationID string) error { - var failedList []pbChat.MsgDataToMQ - for _, msg := range msgList { - key := messageCache + uid + "_" + strconv.Itoa(int(msg.MsgData.Seq)) - s, err := utils.Pb2String(msg.MsgData) - if err != nil { - log2.NewWarn(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg.MsgData.String(), uid, err.Error()) - continue - } - log2.NewDebug(operationID, "convert string is ", s) - _, err = d.Exec("SET", key, s, "ex", config.Config.MsgCacheTimeout) - if err != nil { - log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, *msg, uid, s) - failedList = append(failedList, *msg) - } - } - if len(failedList) != 0 { - return errors.New(fmt.Sprintf("set msg to cache failed, failed lists: %s", failedList)) - } - return nil -} - -func (d *DataBases) DelMsgFromCache(uid string, seqList []uint32, operationID string) { - for _, seq := range seqList { - key := messageCache + uid + "_" + strconv.Itoa(int(seq)) - result, err := redis.String(d.Exec("GET", key)) - if err != nil { - log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key) - continue - } - log2.Debug(operationID, utils.GetSelfFuncName(), "del result", result) - var msg pbCommon.MsgData - err = utils.String2Pb(result, &msg) - log2.NewDebug(operationID, utils.GetSelfFuncName(), "msg", msg) - if err != nil { - log2.NewWarn(operationID, utils.GetSelfFuncName(), "string2Pb failed", msg, err.Error()) - continue - } - msg.Status = constant.MsgDeleted - s, err := utils.Pb2String(&msg) - if err != nil { - log2.NewWarn(operationID, utils.GetSelfFuncName(), "Pb2String failed", msg, err.Error()) - continue - } - _, err = d.Exec("SET", key, s) - if err != nil { - log2.NewWarn(operationID, utils.GetSelfFuncName(), "redis failed", "args:", key, msg, s) - } - } -} - -func (d *DataBases) CacheSignalInfo(msg *pbCommon.MsgData) error { - key := SignalCache + msg.ClientMsgID - _, err := d.Exec("SET", key, msg.Content, "ex", config.Config.Rtc.SignalTimeout) - return err -} - -func (d *DataBases) GetSignalInfoFromCache(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) { - key := SignalCache + clientMsgID - result, err := redis.Bytes(d.Exec("GET", key)) - log2.NewDebug("", utils.GetSelfFuncName(), clientMsgID, result, string(result)) - if err != nil { - return nil, err - } - req := &pbRtc.SignalReq{} - if err = proto.Unmarshal(result, req); err != nil { - return nil, err - } - req2 := req.Payload.(*pbRtc.SignalReq_Invite) - invitationInfo = req2.Invite - return invitationInfo, err -} +//func (d *DataBases) CacheSignalInfo(msg *pbCommon.MsgData) error { +// key := SignalCache + msg.ClientMsgID +// _, err := d.Exec("SET", key, msg.Content, "ex", config.Config.Rtc.SignalTimeout) +// return err +//} +// +//func (d *DataBases) GetSignalInfoFromCache(clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) { +// key := SignalCache + clientMsgID +// result, err := redis.Bytes(d.Exec("GET", key)) +// log2.NewDebug("", utils.GetSelfFuncName(), clientMsgID, result, string(result)) +// if err != nil { +// return nil, err +// } +// req := &pbRtc.SignalReq{} +// if err = proto.Unmarshal(result, req); err != nil { +// return nil, err +// } +// req2 := req.Payload.(*pbRtc.SignalReq_Invite) +// invitationInfo = req2.Invite +// return invitationInfo, err +//} diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go index 1d9d254b7..f90cd99cd 100644 --- a/pkg/common/db/redisModel_test.go +++ b/pkg/common/db/redisModel_test.go @@ -1,6 +1,11 @@ package db import ( + "Open_IM/pkg/common/constant" + pbChat "Open_IM/pkg/proto/chat" + server_api_params "Open_IM/pkg/proto/sdk_ws" + "context" + "flag" "fmt" "github.com/stretchr/testify/assert" "testing" @@ -20,8 +25,96 @@ func Test_GetTokenMapByUidPid(t *testing.T) { fmt.Println(m) } -func TestDataBases_GetMultiConversationMsgOpt(t *testing.T) { - m, err := DB.GetMultiConversationMsgOpt("fg", []string{"user", "age", "color"}) +//func TestDataBases_GetMultiConversationMsgOpt(t *testing.T) { +// m, err := DB.GetMultiConversationMsgOpt("fg", []string{"user", "age", "color"}) +// assert.Nil(t, err) +// fmt.Println(m) +//} +func Test_GetKeyTTL(t *testing.T) { + ctx := context.Background() + key := flag.String("key", "key", "key value") + flag.Parse() + ttl, err := DB.rdb.TTL(ctx, *key).Result() assert.Nil(t, err) - fmt.Println(m) + fmt.Println(ttl) +} +func Test_HGetAll(t *testing.T) { + ctx := context.Background() + key := flag.String("key", "key", "key value") + flag.Parse() + ttl, err := DB.rdb.TTL(ctx, *key).Result() + assert.Nil(t, err) + fmt.Println(ttl) +} + +func Test_NewSetMessageToCache(t *testing.T) { + var msg pbChat.MsgDataToMQ + m := make(map[string]bool) + var offlinePush server_api_params.OfflinePushInfo + offlinePush.Title = "3" + offlinePush.Ex = "34" + offlinePush.IOSPushSound = "+1" + offlinePush.IOSBadgeCount = true + m[constant.IsPersistent] = true + m[constant.IsHistory] = true + var data server_api_params.MsgData + uid := "test_uid" + data.Seq = 11 + data.ClientMsgID = "23jwhjsdf" + data.SendID = "111" + data.RecvID = "222" + data.Content = []byte{1, 2, 3, 4, 5, 6, 7} + data.Seq = 1212 + data.Options = m + data.OfflinePushInfo = &offlinePush + data.AtUserIDList = []string{"1212", "23232"} + msg.MsgData = &data + messageList := []*pbChat.MsgDataToMQ{&msg} + err := DB.SetMessageToCache(messageList, uid, "cacheTest") + assert.Nil(t, err) + +} +func Test_NewGetMessageListBySeq(t *testing.T) { + var msg pbChat.MsgDataToMQ + var data server_api_params.MsgData + uid := "test_uid" + data.Seq = 11 + data.ClientMsgID = "23jwhjsdf" + msg.MsgData = &data + + seqMsg, failedSeqList, err := DB.GetMessageListBySeq(uid, []uint32{1212}, "cacheTest") + assert.Nil(t, err) + fmt.Println(seqMsg, failedSeqList) + +} +func Test_SetUserGlobalMsgRecvOpt(t *testing.T) { + var opt int32 + uid := "test_uid" + opt = 1 + err := DB.SetUserGlobalMsgRecvOpt(uid, opt) + assert.Nil(t, err) +} +func Test_GetUserGlobalMsgRecvOpt(t *testing.T) { + uid := "test_uid" + opt, err := DB.GetUserGlobalMsgRecvOpt(uid) + assert.Nil(t, err) + fmt.Println("get opt", opt) +} +func Test_JudgeAccountEXISTS(t *testing.T) { + uid := "test_uid" + b, err := DB.JudgeAccountEXISTS(uid) + assert.Nil(t, err) + fmt.Println(b) +} +func Test_SetAccountCode(t *testing.T) { + uid := "test_uid" + code := 666666 + err := DB.SetAccountCode(uid, code, 100) + assert.Nil(t, err) +} +func Test_GetAccountCode(t *testing.T) { + uid := "test_uid" + code, err := DB.GetAccountCode(uid) + assert.Nil(t, err) + fmt.Println(code) } diff --git a/pkg/common/kafka/producer.go b/pkg/common/kafka/producer.go index 3d8ca02f5..1ebaaab10 100644 --- a/pkg/common/kafka/producer.go +++ b/pkg/common/kafka/producer.go @@ -2,6 +2,7 @@ package kafka import ( log2 "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" "errors" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" @@ -16,8 +17,9 @@ type Producer struct { func NewKafkaProducer(addr []string, topic string) *Producer { p := Producer{} - p.config = sarama.NewConfig() //Instantiate a sarama Config - p.config.Producer.Return.Successes = true //Whether to enable the successes channel to be notified after the message is sent successfully + p.config = sarama.NewConfig() //Instantiate a sarama Config + p.config.Producer.Return.Successes = true //Whether to enable the successes channel to be notified after the message is sent successfully + p.config.Producer.Return.Errors = true p.config.Producer.RequiredAcks = sarama.WaitForAll //Set producer Message Reply level 0 1 all p.config.Producer.Partitioner = sarama.NewHashPartitioner //Set the hash-key automatic hash partition. When sending a message, you must specify the key value of the message. If there is no key, the partition will be selected randomly @@ -44,11 +46,16 @@ func (p *Producer) SendMessage(m proto.Message, key string, operationID string) return -1, -1, err } if len(bMsg) == 0 { - return 0, 0, errors.New("msg content is nil") + log2.Error(operationID, "len(bMsg) == 0 ") + return 0, 0, errors.New("len(bMsg) == 0 ") } kMsg.Value = sarama.ByteEncoder(bMsg) - log2.Info(operationID, "ByteEncoder SendMessage begin", "key ", kMsg, p.producer) + log2.Info(operationID, "ByteEncoder SendMessage begin", "key ", kMsg, p.producer, "len: ", kMsg.Key.Length(), kMsg.Value.Length()) + if kMsg.Key.Length() == 0 || kMsg.Value.Length() == 0 { + log2.Error(operationID, "kMsg.Key.Length() == 0 || kMsg.Value.Length() == 0 ", kMsg) + return -1, -1, errors.New("key or value == 0") + } a, b, c := p.producer.SendMessage(kMsg) - log2.Info(operationID, "ByteEncoder SendMessage end", "key ", kMsg, p.producer) - return a, b, c + log2.Info(operationID, "ByteEncoder SendMessage end", "key ", kMsg.Key.Length(), kMsg.Value.Length(), p.producer) + return a, b, utils.Wrap(c, "") } diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go index 363feeedc..54a1b4274 100644 --- a/pkg/common/token_verify/jwt_token.go +++ b/pkg/common/token_verify/jwt_token.go @@ -6,7 +6,7 @@ import ( commonDB "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" "Open_IM/pkg/utils" - "github.com/garyburd/redigo/redis" + go_redis "github.com/go-redis/redis/v8" "github.com/golang-jwt/jwt/v4" "time" ) @@ -37,7 +37,26 @@ func BuildClaims(uid, platform string, ttl int64) Claims { }} } -func CreateToken(userID string, platformID int32) (string, int64, error) { +func DeleteToken(userID string, platformID int) error { + m, err := commonDB.DB.GetTokenMapByUidPid(userID, constant.PlatformIDToName(platformID)) + if err != nil && err != go_redis.Nil { + return utils.Wrap(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) + return utils.Wrap(err, "") + } + return nil +} + +func CreateToken(userID string, platformID int) (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)) @@ -46,7 +65,7 @@ func CreateToken(userID string, platformID int32) (string, int64, error) { } //remove Invalid token m, err := commonDB.DB.GetTokenMapByUidPid(userID, constant.PlatformIDToName(platformID)) - if err != nil && err != redis.ErrNil { + if err != nil && err != go_redis.Nil { return "", 0, err } var deleteTokenKey []string @@ -226,15 +245,19 @@ func VerifyToken(token, uid string) (bool, error) { return true, nil } func WsVerifyToken(token, uid string, platformID string, operationID string) (bool, error, string) { + argMsg := "token: " + token + " operationID: " + operationID + " userID: " + uid + " platformID: " + platformID claims, err := ParseToken(token, operationID) if err != nil { - return false, utils.Wrap(err, "parse token err"), "parse token err" + errMsg := "parse token err " + argMsg + return false, utils.Wrap(err, errMsg), errMsg } if claims.UID != uid { - return false, utils.Wrap(&constant.ErrTokenUnknown, "uid is not same to token uid"), "uid is not same to token uid" + errMsg := " uid is not same to token uid " + " claims.UID " + claims.UID + argMsg + return false, utils.Wrap(&constant.ErrTokenUnknown, errMsg), errMsg } - if claims.Platform != constant.PlatformIDToName(utils.StringToInt32(platformID)) { - return false, utils.Wrap(&constant.ErrTokenUnknown, "platform is not same to token platform"), "platform is not same to token platform" + if claims.Platform != constant.PlatformIDToName(utils.StringToInt(platformID)) { + errMsg := " platform is not same to token platform " + argMsg + "claims platformID " + claims.Platform + return false, utils.Wrap(&constant.ErrTokenUnknown, errMsg), errMsg } log.NewDebug(operationID, utils.GetSelfFuncName(), " check ok ", claims.UID, uid, claims.Platform) return true, nil, "" diff --git a/pkg/grpc-etcdv3/getcdv3/register.go b/pkg/grpc-etcdv3/getcdv3/register.go index af96ffc29..4d9e3ee27 100644 --- a/pkg/grpc-etcdv3/getcdv3/register.go +++ b/pkg/grpc-etcdv3/getcdv3/register.go @@ -2,6 +2,7 @@ package getcdv3 import ( "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" "context" "fmt" clientv3 "go.etcd.io/etcd/client/v3" @@ -38,12 +39,15 @@ 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 { + operationID := utils.OperationIDGenerator() + args := schema + " " + etcdAddr + " " + myHost + " " + serviceName + " " + utils.Int32ToString(int32(myPort)) ttl = ttl * 3 cli, err := clientv3.New(clientv3.Config{ Endpoints: strings.Split(etcdAddr, ","), DialTimeout: 5 * time.Second}) - log.Info("", "RegisterEtcd, ", schema, etcdAddr, myHost, myPort, serviceName, ttl) + log.Info(operationID, "RegisterEtcd args: ", args, ttl) if err != nil { + log.Error(operationID, "clientv3.New failed ", args, ttl, err.Error()) return fmt.Errorf("create etcd clientv3 client failed, errmsg:%v, etcd addr:%s", err, etcdAddr) } @@ -51,8 +55,10 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin ctx, cancel := context.WithCancel(context.Background()) resp, err := cli.Grant(ctx, int64(ttl)) if err != nil { + log.Error(operationID, "Grant failed ", err.Error(), ctx, ttl) return fmt.Errorf("grant failed") } + log.Info(operationID, "Grant ok, resp ID ", resp.ID) // schema:///serviceName/ip:port ->ip:port serviceValue := net.JoinHostPort(myHost, strconv.Itoa(myPort)) @@ -60,24 +66,26 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin //set key->value if _, err := cli.Put(ctx, serviceKey, serviceValue, clientv3.WithLease(resp.ID)); err != nil { + log.Error(operationID, "cli.Put failed ", err.Error(), ctx, args, resp.ID) return fmt.Errorf("put failed, errmsg:%v, key:%s, value:%s", err, serviceKey, serviceValue) } //keepalive kresp, err := cli.KeepAlive(ctx, resp.ID) if err != nil { + log.Error(operationID, "KeepAlive failed ", err.Error(), args, resp.ID) return fmt.Errorf("keepalive failed, errmsg:%v, lease id:%d", err, resp.ID) } - //log.Info("", "RegisterEtcd ok ") + log.Info(operationID, "RegisterEtcd ok ", args) go func() { for { select { case pv, ok := <-kresp: if ok == true { - log.Debug("", "KeepAlive kresp ok", pv) + log.Debug(operationID, "KeepAlive kresp ok", pv, args) } else { - log.Error("", "KeepAlive kresp failed", pv) + log.Error(operationID, "KeepAlive kresp failed ", pv, args) t := time.NewTicker(time.Duration(ttl/2) * time.Second) for { select { @@ -86,17 +94,16 @@ func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName strin ctx, _ := context.WithCancel(context.Background()) resp, err := cli.Grant(ctx, int64(ttl)) if err != nil { - log.Error("", "Grant failed ", err.Error()) + log.Error(operationID, "Grant failed ", err.Error(), args) continue } 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.Error(operationID, "etcd Put failed ", err.Error(), args, " resp ID: ", resp.ID) continue } else { - log.Info("", "etcd Put ok", serviceKey, serviceValue, resp.ID) + log.Info(operationID, "etcd Put ok ", args, " resp ID: ", resp.ID) } - } } } diff --git a/pkg/grpc-etcdv3/getcdv3/resolver.go b/pkg/grpc-etcdv3/getcdv3/resolver.go index 5d7f9e828..b72df5fc9 100644 --- a/pkg/grpc-etcdv3/getcdv3/resolver.go +++ b/pkg/grpc-etcdv3/getcdv3/resolver.go @@ -2,6 +2,7 @@ package getcdv3 import ( "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" "context" "fmt" "go.etcd.io/etcd/api/v3/mvccpb" @@ -32,12 +33,13 @@ var ( rwNameResolverMutex sync.RWMutex ) -func NewResolver(schema, etcdAddr, serviceName string) (*Resolver, error) { +func NewResolver(schema, etcdAddr, serviceName string, operationID string) (*Resolver, error) { etcdCli, err := clientv3.New(clientv3.Config{ Endpoints: strings.Split(etcdAddr, ","), }) if err != nil { - return nil, err + log.Error(operationID, "etcd client v3 failed") + return nil, utils.Wrap(err, "") } var r Resolver @@ -51,18 +53,11 @@ func NewResolver(schema, etcdAddr, serviceName string) (*Resolver, error) { conn, err := grpc.DialContext(ctx, GetPrefix(schema, serviceName), grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)), grpc.WithInsecure()) - log.Debug("", "etcd key ", GetPrefix(schema, serviceName)) - - //conn, err := grpc.Dial( - // GetPrefix(schema, serviceName), - // grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)), - // grpc.WithInsecure(), - // grpc.WithTimeout(time.Duration(5)*time.Second), - //) + log.Debug(operationID, "etcd key ", GetPrefix(schema, serviceName)) if err == nil { r.grpcClientConn = conn } - return &r, err + return &r, utils.Wrap(err, "") } func (r1 *Resolver) ResolveNow(rn resolver.ResolveNowOptions) { @@ -71,12 +66,12 @@ func (r1 *Resolver) ResolveNow(rn resolver.ResolveNowOptions) { func (r1 *Resolver) Close() { } -func GetConn(schema, etcdaddr, serviceName string) *grpc.ClientConn { +func GetConn(schema, etcdaddr, serviceName string, operationID string) *grpc.ClientConn { rwNameResolverMutex.RLock() r, ok := nameResolver[schema+serviceName] rwNameResolverMutex.RUnlock() if ok { - log.Debug("", "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) + log.Debug(operationID, "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) return r.grpcClientConn } @@ -84,18 +79,18 @@ func GetConn(schema, etcdaddr, serviceName string) *grpc.ClientConn { r, ok = nameResolver[schema+serviceName] if ok { rwNameResolverMutex.Unlock() - log.Debug("", "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) + log.Debug(operationID, "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) return r.grpcClientConn } - r, err := NewResolver(schema, etcdaddr, serviceName) + r, err := NewResolver(schema, etcdaddr, serviceName, operationID) if err != nil { - log.Error("", "etcd failed ", schema, etcdaddr, serviceName) + log.Error(operationID, "etcd failed ", schema, etcdaddr, serviceName, err.Error()) rwNameResolverMutex.Unlock() return nil } - log.Debug("", "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) + log.Debug(operationID, "etcd key ", schema+serviceName, "value ", *r.grpcClientConn, *r) nameResolver[schema+serviceName] = r rwNameResolverMutex.Unlock() return r.grpcClientConn @@ -220,7 +215,7 @@ func GetConn4Unique(schema, etcdaddr, servicename string) []*grpc.ClientConn { allConn := make([]*grpc.ClientConn, 0) for _, v := range allService { - r := GetConn(schema, etcdaddr, v) + r := GetConn(schema, etcdaddr, v, "0") allConn = append(allConn, r) } @@ -233,7 +228,7 @@ var ( ) func GetconnFactory(schema, etcdaddr, servicename string) (*grpc.ClientConn, error) { - c := GetConn(schema, etcdaddr, servicename) + c := GetConn(schema, etcdaddr, servicename, "0") if c != nil { return c, nil } else { diff --git a/pkg/proto/auth/auth.pb.go b/pkg/proto/auth/auth.pb.go index 3941570ee..09f54b1f9 100644 --- a/pkg/proto/auth/auth.pb.go +++ b/pkg/proto/auth/auth.pb.go @@ -36,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_auth_88965eda3ab7f34d, []int{0} + return fileDescriptor_auth_68293efd650e0000, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -82,7 +82,7 @@ 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_88965eda3ab7f34d, []int{1} + return fileDescriptor_auth_68293efd650e0000, []int{1} } func (m *UserRegisterReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterReq.Unmarshal(m, b) @@ -127,7 +127,7 @@ 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_88965eda3ab7f34d, []int{2} + return fileDescriptor_auth_68293efd650e0000, []int{2} } func (m *UserRegisterResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterResp.Unmarshal(m, b) @@ -168,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_88965eda3ab7f34d, []int{3} + return fileDescriptor_auth_68293efd650e0000, []int{3} } func (m *UserTokenReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenReq.Unmarshal(m, b) @@ -229,7 +229,7 @@ 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_88965eda3ab7f34d, []int{4} + return fileDescriptor_auth_68293efd650e0000, []int{4} } func (m *UserTokenResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenResp.Unmarshal(m, b) @@ -270,12 +270,114 @@ func (m *UserTokenResp) GetExpiredTime() int64 { return 0 } +type ForceLogoutReq struct { + Platform int32 `protobuf:"varint,1,opt,name=Platform" json:"Platform,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:"-"` +} + +func (m *ForceLogoutReq) Reset() { *m = ForceLogoutReq{} } +func (m *ForceLogoutReq) String() string { return proto.CompactTextString(m) } +func (*ForceLogoutReq) ProtoMessage() {} +func (*ForceLogoutReq) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_68293efd650e0000, []int{5} +} +func (m *ForceLogoutReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ForceLogoutReq.Unmarshal(m, b) +} +func (m *ForceLogoutReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ForceLogoutReq.Marshal(b, m, deterministic) +} +func (dst *ForceLogoutReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForceLogoutReq.Merge(dst, src) +} +func (m *ForceLogoutReq) XXX_Size() int { + return xxx_messageInfo_ForceLogoutReq.Size(m) +} +func (m *ForceLogoutReq) XXX_DiscardUnknown() { + xxx_messageInfo_ForceLogoutReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ForceLogoutReq proto.InternalMessageInfo + +func (m *ForceLogoutReq) GetPlatform() int32 { + if m != nil { + return m.Platform + } + return 0 +} + +func (m *ForceLogoutReq) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *ForceLogoutReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *ForceLogoutReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ForceLogoutResp 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 *ForceLogoutResp) Reset() { *m = ForceLogoutResp{} } +func (m *ForceLogoutResp) String() string { return proto.CompactTextString(m) } +func (*ForceLogoutResp) ProtoMessage() {} +func (*ForceLogoutResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_68293efd650e0000, []int{6} +} +func (m *ForceLogoutResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ForceLogoutResp.Unmarshal(m, b) +} +func (m *ForceLogoutResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ForceLogoutResp.Marshal(b, m, deterministic) +} +func (dst *ForceLogoutResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForceLogoutResp.Merge(dst, src) +} +func (m *ForceLogoutResp) XXX_Size() int { + return xxx_messageInfo_ForceLogoutResp.Size(m) +} +func (m *ForceLogoutResp) XXX_DiscardUnknown() { + xxx_messageInfo_ForceLogoutResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ForceLogoutResp proto.InternalMessageInfo + +func (m *ForceLogoutResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + 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") proto.RegisterType((*UserTokenResp)(nil), "pbAuth.UserTokenResp") + proto.RegisterType((*ForceLogoutReq)(nil), "pbAuth.ForceLogoutReq") + proto.RegisterType((*ForceLogoutResp)(nil), "pbAuth.ForceLogoutResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -291,6 +393,7 @@ const _ = grpc.SupportPackageIsVersion4 type AuthClient interface { UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) + ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...grpc.CallOption) (*ForceLogoutResp, error) } type authClient struct { @@ -319,11 +422,21 @@ func (c *authClient) UserToken(ctx context.Context, in *UserTokenReq, opts ...gr return out, nil } +func (c *authClient) ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...grpc.CallOption) (*ForceLogoutResp, error) { + out := new(ForceLogoutResp) + err := grpc.Invoke(ctx, "/pbAuth.Auth/ForceLogout", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Auth service type AuthServer interface { UserRegister(context.Context, *UserRegisterReq) (*UserRegisterResp, error) UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error) + ForceLogout(context.Context, *ForceLogoutReq) (*ForceLogoutResp, error) } func RegisterAuthServer(s *grpc.Server, srv AuthServer) { @@ -366,6 +479,24 @@ func _Auth_UserToken_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Auth_ForceLogout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ForceLogoutReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).ForceLogout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbAuth.Auth/ForceLogout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).ForceLogout(ctx, req.(*ForceLogoutReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Auth_serviceDesc = grpc.ServiceDesc{ ServiceName: "pbAuth.Auth", HandlerType: (*AuthServer)(nil), @@ -378,37 +509,44 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ MethodName: "UserToken", Handler: _Auth_UserToken_Handler, }, + { + MethodName: "ForceLogout", + Handler: _Auth_ForceLogout_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth/auth.proto", } -func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_88965eda3ab7f34d) } +func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_68293efd650e0000) } -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, 0x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 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, +var fileDescriptor_auth_68293efd650e0000 = []byte{ + // 417 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x53, 0x5d, 0x8b, 0xda, 0x40, + 0x14, 0x25, 0xf5, 0xa3, 0x7a, 0xad, 0x4d, 0x19, 0xac, 0x86, 0x14, 0x8a, 0xcd, 0x93, 0x4f, 0x09, + 0xd8, 0x87, 0x16, 0x0a, 0x82, 0xb5, 0x0a, 0x42, 0xc5, 0x12, 0xec, 0xcb, 0xbe, 0x84, 0xb8, 0x8e, + 0x31, 0x68, 0x32, 0xb3, 0x33, 0x71, 0x5d, 0xd8, 0x3f, 0xb0, 0xec, 0xdf, 0xda, 0x3f, 0xb6, 0xcc, + 0xe4, 0x63, 0x47, 0xd7, 0x27, 0x5f, 0xf6, 0x25, 0xe1, 0x9e, 0x73, 0x66, 0xee, 0x39, 0x77, 0x66, + 0x40, 0xf7, 0xf7, 0xc9, 0xc6, 0x11, 0x1f, 0x9b, 0x32, 0x92, 0x10, 0x54, 0xa5, 0xcb, 0xe1, 0x3e, + 0xd9, 0x98, 0xdf, 0xe6, 0x14, 0xc7, 0xde, 0x74, 0xe6, 0xd0, 0x6d, 0xe0, 0x48, 0xca, 0xe1, 0xab, + 0xad, 0x77, 0xe0, 0xce, 0x81, 0xa7, 0x52, 0x6b, 0x00, 0x30, 0x22, 0x51, 0x44, 0x62, 0x17, 0x73, + 0x8a, 0x0c, 0x78, 0x8f, 0x19, 0x1b, 0x91, 0x15, 0x36, 0xb4, 0xae, 0xd6, 0xab, 0xb8, 0x79, 0x89, + 0xda, 0x50, 0xc5, 0x8c, 0xcd, 0x78, 0x60, 0xbc, 0xeb, 0x6a, 0xbd, 0xba, 0x9b, 0x55, 0xd6, 0x0e, + 0xf4, 0xff, 0x1c, 0x33, 0x17, 0x07, 0x21, 0x4f, 0xc4, 0xff, 0x06, 0xfd, 0x80, 0x9a, 0x80, 0xa6, + 0xf1, 0x9a, 0xc8, 0x5d, 0x1a, 0xfd, 0x2f, 0x36, 0xc7, 0xec, 0x16, 0x33, 0xcf, 0xa7, 0xa1, 0x47, + 0x7d, 0xe6, 0x47, 0xdc, 0xce, 0x25, 0x6e, 0x21, 0x46, 0x5d, 0x68, 0xcc, 0x29, 0x66, 0x7e, 0x12, + 0x92, 0x78, 0xf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, 0xb6, 0x7c, 0xd2, 0xbf, 0x52, 0xc1, 0xb2, 0x2a, + 0xdf, 0xeb, 0xf7, 0xe7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0x61, 0xac, 0x2b, 0xed, 0x03, 0x00, 0x00, } diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index c91921fe9..53a14d760 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -30,7 +30,23 @@ message UserTokenResp { } + +message ForceLogoutReq { + int32 Platform = 1; + string FromUserID = 2; + string OpUserID = 3; + string OperationID = 4; +} +message ForceLogoutResp { + CommonResp CommonResp = 1; +} + + + + + service Auth { rpc UserRegister(UserRegisterReq) returns(UserRegisterResp); rpc UserToken(UserTokenReq) returns(UserTokenResp); + rpc ForceLogout(ForceLogoutReq) returns(ForceLogoutResp); } diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh index 25408d46e..7ecece08e 100644 --- a/pkg/proto/auto_proto.sh +++ b/pkg/proto/auto_proto.sh @@ -4,10 +4,14 @@ source ./proto_dir.cfg for ((i = 0; i < ${#all_proto[*]}; i++)); do proto=${all_proto[$i]} - protoc -I ../../../ -I ./ --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 echo "protoc --go_out=plugins=grpc:." $proto done echo "proto file generate success..." + +find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g' + diff --git a/pkg/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go index cf1c6ba50..b69f57018 100644 --- a/pkg/proto/chat/chat.pb.go +++ b/pkg/proto/chat/chat.pb.go @@ -37,7 +37,7 @@ 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_83f286704599d5b1, []int{0} + return fileDescriptor_chat_64077d68a66b2cfd, []int{0} } func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) @@ -90,7 +90,7 @@ 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_83f286704599d5b1, []int{1} + return fileDescriptor_chat_64077d68a66b2cfd, []int{1} } func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) @@ -137,7 +137,7 @@ 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_83f286704599d5b1, []int{2} + return fileDescriptor_chat_64077d68a66b2cfd, []int{2} } func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) @@ -178,6 +178,68 @@ func (m *PushMsgDataToMQ) GetPushToUserID() string { return "" } +type MsgDataToMongoByMQ struct { + LastSeq uint64 `protobuf:"varint,1,opt,name=lastSeq" json:"lastSeq,omitempty"` + AggregationID string `protobuf:"bytes,2,opt,name=aggregationID" json:"aggregationID,omitempty"` + MessageList []*MsgDataToMQ `protobuf:"bytes,3,rep,name=messageList" json:"messageList,omitempty"` + TriggerID string `protobuf:"bytes,4,opt,name=triggerID" json:"triggerID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataToMongoByMQ) Reset() { *m = MsgDataToMongoByMQ{} } +func (m *MsgDataToMongoByMQ) String() string { return proto.CompactTextString(m) } +func (*MsgDataToMongoByMQ) ProtoMessage() {} +func (*MsgDataToMongoByMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_64077d68a66b2cfd, []int{3} +} +func (m *MsgDataToMongoByMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToMongoByMQ.Unmarshal(m, b) +} +func (m *MsgDataToMongoByMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToMongoByMQ.Marshal(b, m, deterministic) +} +func (dst *MsgDataToMongoByMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToMongoByMQ.Merge(dst, src) +} +func (m *MsgDataToMongoByMQ) XXX_Size() int { + return xxx_messageInfo_MsgDataToMongoByMQ.Size(m) +} +func (m *MsgDataToMongoByMQ) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToMongoByMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToMongoByMQ proto.InternalMessageInfo + +func (m *MsgDataToMongoByMQ) GetLastSeq() uint64 { + if m != nil { + return m.LastSeq + } + return 0 +} + +func (m *MsgDataToMongoByMQ) GetAggregationID() string { + if m != nil { + return m.AggregationID + } + return "" +} + +func (m *MsgDataToMongoByMQ) GetMessageList() []*MsgDataToMQ { + if m != nil { + return m.MessageList + } + return nil +} + +func (m *MsgDataToMongoByMQ) GetTriggerID() string { + if m != nil { + return m.TriggerID + } + return "" +} + // message PullMessageReq { // string UserID = 1; // int64 SeqBegin = 2; @@ -210,7 +272,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_83f286704599d5b1, []int{3} + return fileDescriptor_chat_64077d68a66b2cfd, []int{4} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -258,7 +320,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_83f286704599d5b1, []int{4} + return fileDescriptor_chat_64077d68a66b2cfd, []int{5} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -319,7 +381,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_83f286704599d5b1, []int{5} + return fileDescriptor_chat_64077d68a66b2cfd, []int{6} } func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) @@ -375,7 +437,7 @@ 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_83f286704599d5b1, []int{6} + return fileDescriptor_chat_64077d68a66b2cfd, []int{7} } func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) @@ -430,14 +492,117 @@ func (m *SendMsgResp) GetSendTime() int64 { return 0 } +type ClearMsgReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,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 *ClearMsgReq) Reset() { *m = ClearMsgReq{} } +func (m *ClearMsgReq) String() string { return proto.CompactTextString(m) } +func (*ClearMsgReq) ProtoMessage() {} +func (*ClearMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_64077d68a66b2cfd, []int{8} +} +func (m *ClearMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearMsgReq.Unmarshal(m, b) +} +func (m *ClearMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearMsgReq.Marshal(b, m, deterministic) +} +func (dst *ClearMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearMsgReq.Merge(dst, src) +} +func (m *ClearMsgReq) XXX_Size() int { + return xxx_messageInfo_ClearMsgReq.Size(m) +} +func (m *ClearMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_ClearMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearMsgReq proto.InternalMessageInfo + +func (m *ClearMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *ClearMsgReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *ClearMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ClearMsgResp 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 *ClearMsgResp) Reset() { *m = ClearMsgResp{} } +func (m *ClearMsgResp) String() string { return proto.CompactTextString(m) } +func (*ClearMsgResp) ProtoMessage() {} +func (*ClearMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_64077d68a66b2cfd, []int{9} +} +func (m *ClearMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearMsgResp.Unmarshal(m, b) +} +func (m *ClearMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearMsgResp.Marshal(b, m, deterministic) +} +func (dst *ClearMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearMsgResp.Merge(dst, src) +} +func (m *ClearMsgResp) XXX_Size() int { + return xxx_messageInfo_ClearMsgResp.Size(m) +} +func (m *ClearMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_ClearMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearMsgResp proto.InternalMessageInfo + +func (m *ClearMsgResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *ClearMsgResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + func init() { proto.RegisterType((*MsgDataToMQ)(nil), "pbChat.MsgDataToMQ") proto.RegisterType((*MsgDataToDB)(nil), "pbChat.MsgDataToDB") proto.RegisterType((*PushMsgDataToMQ)(nil), "pbChat.PushMsgDataToMQ") + proto.RegisterType((*MsgDataToMongoByMQ)(nil), "pbChat.MsgDataToMongoByMQ") proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "pbChat.GetMaxAndMinSeqReq") proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "pbChat.GetMaxAndMinSeqResp") proto.RegisterType((*SendMsgReq)(nil), "pbChat.SendMsgReq") proto.RegisterType((*SendMsgResp)(nil), "pbChat.SendMsgResp") + proto.RegisterType((*ClearMsgReq)(nil), "pbChat.ClearMsgReq") + proto.RegisterType((*ClearMsgResp)(nil), "pbChat.ClearMsgResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -451,10 +616,11 @@ const _ = grpc.SupportPackageIsVersion4 // Client API for Chat service type ChatClient interface { - GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) + GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, 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) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) + ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) } type chatClient struct { @@ -465,8 +631,8 @@ func NewChatClient(cc *grpc.ClientConn) ChatClient { return &chatClient{cc} } -func (c *chatClient) GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) { - out := new(GetMaxAndMinSeqResp) +func (c *chatClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) { + out := new(sdk_ws.GetMaxAndMinSeqResp) err := grpc.Invoke(ctx, "/pbChat.Chat/GetMaxAndMinSeq", in, out, c.cc, opts...) if err != nil { return nil, err @@ -501,13 +667,23 @@ func (c *chatClient) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, o return out, nil } +func (c *chatClient) ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error) { + out := new(ClearMsgResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/ClearMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for Chat service type ChatServer interface { - GetMaxAndMinSeq(context.Context, *GetMaxAndMinSeqReq) (*GetMaxAndMinSeqResp, error) + GetMaxAndMinSeq(context.Context, *sdk_ws.GetMaxAndMinSeqReq) (*sdk_ws.GetMaxAndMinSeqResp, error) PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error) SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error) DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error) + ClearMsg(context.Context, *ClearMsgReq) (*ClearMsgResp, error) } func RegisterChatServer(s *grpc.Server, srv ChatServer) { @@ -515,7 +691,7 @@ func RegisterChatServer(s *grpc.Server, srv ChatServer) { } func _Chat_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMaxAndMinSeqReq) + in := new(sdk_ws.GetMaxAndMinSeqReq) if err := dec(in); err != nil { return nil, err } @@ -527,7 +703,7 @@ func _Chat_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec fun FullMethod: "/pbChat.Chat/GetMaxAndMinSeq", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).GetMaxAndMinSeq(ctx, req.(*GetMaxAndMinSeqReq)) + return srv.(ChatServer).GetMaxAndMinSeq(ctx, req.(*sdk_ws.GetMaxAndMinSeqReq)) } return interceptor(ctx, in, info, handler) } @@ -586,6 +762,24 @@ func _Chat_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Chat_ClearMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServer).ClearMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbChat.Chat/ClearMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).ClearMsg(ctx, req.(*ClearMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Chat_serviceDesc = grpc.ServiceDesc{ ServiceName: "pbChat.Chat", HandlerType: (*ChatServer)(nil), @@ -606,45 +800,57 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ MethodName: "DelMsgList", Handler: _Chat_DelMsgList_Handler, }, + { + MethodName: "ClearMsg", + Handler: _Chat_ClearMsg_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "chat/chat.proto", } -func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_83f286704599d5b1) } +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_64077d68a66b2cfd) } -var fileDescriptor_chat_83f286704599d5b1 = []byte{ - // 507 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcd, 0x6e, 0xda, 0x40, - 0x10, 0x96, 0x49, 0x80, 0x32, 0x34, 0x42, 0xda, 0x44, 0x95, 0xe5, 0x5e, 0x1c, 0x9f, 0x50, 0x2b, - 0x19, 0x89, 0xf6, 0xd6, 0x53, 0x89, 0xa3, 0x8a, 0xaa, 0xdb, 0x24, 0x86, 0x5e, 0x7a, 0x41, 0x9b, - 0x30, 0x32, 0x16, 0x60, 0x2f, 0x3b, 0xa6, 0xa4, 0xed, 0x33, 0xf4, 0x19, 0xfa, 0x3e, 0x7d, 0xaa, - 0xca, 0xbb, 0x26, 0x98, 0x40, 0x15, 0x4e, 0xbd, 0x58, 0x9a, 0x6f, 0x3e, 0x7f, 0x3f, 0xeb, 0x1f, - 0x68, 0xdd, 0x4d, 0x44, 0xd6, 0xc9, 0x2f, 0xbe, 0x54, 0x69, 0x96, 0xb2, 0x9a, 0xbc, 0xbd, 0x98, - 0x88, 0xcc, 0x39, 0xbf, 0x92, 0x98, 0x8c, 0xfa, 0xbc, 0x23, 0xa7, 0x51, 0x47, 0xaf, 0x3a, 0x34, - 0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09, 0x06, 0xc9, 0x5e, 0xeb, - 0xeb, 0x89, 0xaf, 0x7f, 0x71, 0xef, 0x8c, 0xdf, 0x6d, 0x4d, 0xff, 0xbf, 0xde, 0xfc, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x6f, 0x9d, 0x6f, 0xa0, 0xfd, 0x04, 0x00, 0x00, +var fileDescriptor_chat_64077d68a66b2cfd = []byte{ + // 636 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x6f, 0xda, 0x4c, + 0x10, 0x95, 0x43, 0x42, 0x92, 0x71, 0x22, 0xa4, 0x4d, 0x14, 0x21, 0xf4, 0x1d, 0x1c, 0xeb, 0x6b, + 0x85, 0x5a, 0x09, 0x24, 0xda, 0x9c, 0x7a, 0x69, 0x09, 0x51, 0x15, 0xa9, 0x6e, 0x12, 0x93, 0x5e, + 0x7a, 0xa1, 0x9b, 0x30, 0x5a, 0xac, 0x80, 0xbd, 0xec, 0x98, 0x26, 0x69, 0x7f, 0x43, 0xcf, 0x3d, + 0xf6, 0xdc, 0x7f, 0x59, 0xed, 0xae, 0x01, 0x83, 0x91, 0x82, 0x7a, 0xe8, 0x05, 0xe9, 0xbd, 0x7d, + 0xbc, 0x99, 0x37, 0x3b, 0x2b, 0x43, 0xe5, 0x76, 0xc0, 0xd3, 0xa6, 0xfe, 0x69, 0x48, 0x95, 0xa4, + 0x09, 0x2b, 0xcb, 0x9b, 0xd3, 0x01, 0x4f, 0x6b, 0xc7, 0x17, 0x12, 0xe3, 0xde, 0x79, 0xd0, 0x94, + 0x77, 0xa2, 0x69, 0x8e, 0x9a, 0xd4, 0xbf, 0xeb, 0xdd, 0x53, 0xf3, 0x9e, 0xac, 0xd4, 0xff, 0x0e, + 0x6e, 0x40, 0xa2, 0xc3, 0x53, 0x7e, 0x9d, 0x04, 0x57, 0xec, 0x10, 0xb6, 0xd2, 0xe4, 0x0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f, 0x25, 0xd8, 0xd4, 0xdb, 0xcc, 0xbe, + 0x40, 0x65, 0x69, 0x8d, 0xd8, 0xb3, 0x15, 0x37, 0x51, 0x5c, 0xdd, 0xda, 0xf3, 0x75, 0x64, 0x24, + 0x59, 0x02, 0x87, 0x97, 0x93, 0xe1, 0x30, 0xb0, 0x2f, 0xa5, 0xfd, 0xd8, 0xc5, 0xb1, 0x79, 0x2e, + 0x2f, 0x56, 0xfc, 0x7f, 0x95, 0x50, 0xd7, 0x7a, 0xb9, 0xb6, 0x96, 0x24, 0x6b, 0xc1, 0x76, 0xb6, + 0x23, 0x8c, 0x4d, 0x1f, 0xed, 0x7c, 0x63, 0x6b, 0x07, 0x05, 0x8e, 0x24, 0xbb, 0x02, 0xe8, 0xe0, + 0x30, 0x20, 0x61, 0x5a, 0xf3, 0x56, 0x94, 0x9b, 0x1f, 0x6b, 0x93, 0xe3, 0x27, 0x14, 0x24, 0xd9, + 0x09, 0xec, 0x4c, 0x2f, 0x89, 0xcd, 0x6a, 0xe6, 0x76, 0xa3, 0x76, 0x58, 0x24, 0x49, 0xb6, 0x2b, + 0x9f, 0xf7, 0x1b, 0xe6, 0x13, 0xf4, 0xc6, 0x9e, 0xde, 0x94, 0xcd, 0xf7, 0xe5, 0xd5, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x88, 0x55, 0xa7, 0xa7, 0x9d, 0x06, 0x00, 0x00, } diff --git a/pkg/proto/chat/chat.proto b/pkg/proto/chat/chat.proto index 146994f01..74ea0f396 100644 --- a/pkg/proto/chat/chat.proto +++ b/pkg/proto/chat/chat.proto @@ -22,6 +22,14 @@ message PushMsgDataToMQ{ server_api_params.MsgData msgData = 2; string pushToUserID = 3; } +message MsgDataToMongoByMQ{ + uint64 lastSeq =1; + string aggregationID = 2; + repeated MsgDataToMQ messageList = 3; + string triggerID = 4; + + +} //message PullMessageReq { // string UserID = 1; @@ -69,14 +77,25 @@ message SendMsgResp { string serverMsgID = 4; string clientMsgID = 5; int64 sendTime = 6; - } +message ClearMsgReq{ + string userID = 1; + string opUserID = 2; + string operationID = 3; +} + + +message ClearMsgResp{ + int32 errCode = 1; + string errMsg = 2; +} service Chat { - rpc GetMaxAndMinSeq(GetMaxAndMinSeqReq) returns(GetMaxAndMinSeqResp); + rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp); rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); rpc SendMsg(SendMsgReq) returns(SendMsgResp); rpc DelMsgList(server_api_params.DelMsgListReq) returns(server_api_params.DelMsgListResp); + rpc ClearMsg(ClearMsgReq) returns(ClearMsgResp); } diff --git a/pkg/proto/group/group.pb.go b/pkg/proto/group/group.pb.go index d036b6641..e7bdc47c5 100644 --- a/pkg/proto/group/group.pb.go +++ b/pkg/proto/group/group.pb.go @@ -37,7 +37,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_group_8c320ccb494991ed, []int{0} + return fileDescriptor_group_f05abf5eae29d157, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -83,7 +83,7 @@ func (m *GroupAddMemberInfo) Reset() { *m = GroupAddMemberInfo{} } func (m *GroupAddMemberInfo) String() string { return proto.CompactTextString(m) } func (*GroupAddMemberInfo) ProtoMessage() {} func (*GroupAddMemberInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{1} + return fileDescriptor_group_f05abf5eae29d157, []int{1} } func (m *GroupAddMemberInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupAddMemberInfo.Unmarshal(m, b) @@ -132,7 +132,7 @@ 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_8c320ccb494991ed, []int{2} + return fileDescriptor_group_f05abf5eae29d157, []int{2} } func (m *CreateGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupReq.Unmarshal(m, b) @@ -200,7 +200,7 @@ 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_8c320ccb494991ed, []int{3} + return fileDescriptor_group_f05abf5eae29d157, []int{3} } func (m *CreateGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupResp.Unmarshal(m, b) @@ -254,7 +254,7 @@ 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_8c320ccb494991ed, []int{4} + return fileDescriptor_group_f05abf5eae29d157, []int{4} } func (m *GetGroupsInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoReq.Unmarshal(m, b) @@ -308,7 +308,7 @@ func (m *GetGroupsInfoResp) Reset() { *m = GetGroupsInfoResp{} } func (m *GetGroupsInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupsInfoResp) ProtoMessage() {} func (*GetGroupsInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{5} + return fileDescriptor_group_f05abf5eae29d157, []int{5} } func (m *GetGroupsInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoResp.Unmarshal(m, b) @@ -362,7 +362,7 @@ func (m *SetGroupInfoReq) Reset() { *m = SetGroupInfoReq{} } func (m *SetGroupInfoReq) String() string { return proto.CompactTextString(m) } func (*SetGroupInfoReq) ProtoMessage() {} func (*SetGroupInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{6} + return fileDescriptor_group_f05abf5eae29d157, []int{6} } func (m *SetGroupInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupInfoReq.Unmarshal(m, b) @@ -414,7 +414,7 @@ func (m *SetGroupInfoResp) Reset() { *m = SetGroupInfoResp{} } func (m *SetGroupInfoResp) String() string { return proto.CompactTextString(m) } func (*SetGroupInfoResp) ProtoMessage() {} func (*SetGroupInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{7} + return fileDescriptor_group_f05abf5eae29d157, []int{7} } func (m *SetGroupInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupInfoResp.Unmarshal(m, b) @@ -454,7 +454,7 @@ func (m *GetGroupApplicationListReq) Reset() { *m = GetGroupApplicationL func (m *GetGroupApplicationListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListReq) ProtoMessage() {} func (*GetGroupApplicationListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{8} + return fileDescriptor_group_f05abf5eae29d157, []int{8} } func (m *GetGroupApplicationListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListReq.Unmarshal(m, b) @@ -508,7 +508,7 @@ func (m *GetGroupApplicationListResp) Reset() { *m = GetGroupApplication func (m *GetGroupApplicationListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListResp) ProtoMessage() {} func (*GetGroupApplicationListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{9} + return fileDescriptor_group_f05abf5eae29d157, []int{9} } func (m *GetGroupApplicationListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListResp.Unmarshal(m, b) @@ -562,7 +562,7 @@ func (m *GetUserReqApplicationListReq) Reset() { *m = GetUserReqApplicat func (m *GetUserReqApplicationListReq) String() string { return proto.CompactTextString(m) } func (*GetUserReqApplicationListReq) ProtoMessage() {} func (*GetUserReqApplicationListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{10} + return fileDescriptor_group_f05abf5eae29d157, []int{10} } func (m *GetUserReqApplicationListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserReqApplicationListReq.Unmarshal(m, b) @@ -615,7 +615,7 @@ func (m *GetUserReqApplicationListResp) Reset() { *m = GetUserReqApplica func (m *GetUserReqApplicationListResp) String() string { return proto.CompactTextString(m) } func (*GetUserReqApplicationListResp) ProtoMessage() {} func (*GetUserReqApplicationListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{11} + return fileDescriptor_group_f05abf5eae29d157, []int{11} } func (m *GetUserReqApplicationListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserReqApplicationListResp.Unmarshal(m, b) @@ -664,7 +664,7 @@ func (m *TransferGroupOwnerReq) Reset() { *m = TransferGroupOwnerReq{} } func (m *TransferGroupOwnerReq) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerReq) ProtoMessage() {} func (*TransferGroupOwnerReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{12} + return fileDescriptor_group_f05abf5eae29d157, []int{12} } func (m *TransferGroupOwnerReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerReq.Unmarshal(m, b) @@ -730,7 +730,7 @@ func (m *TransferGroupOwnerResp) Reset() { *m = TransferGroupOwnerResp{} func (m *TransferGroupOwnerResp) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerResp) ProtoMessage() {} func (*TransferGroupOwnerResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{13} + return fileDescriptor_group_f05abf5eae29d157, []int{13} } func (m *TransferGroupOwnerResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerResp.Unmarshal(m, b) @@ -771,7 +771,7 @@ func (m *JoinGroupReq) Reset() { *m = JoinGroupReq{} } func (m *JoinGroupReq) String() string { return proto.CompactTextString(m) } func (*JoinGroupReq) ProtoMessage() {} func (*JoinGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{14} + return fileDescriptor_group_f05abf5eae29d157, []int{14} } func (m *JoinGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupReq.Unmarshal(m, b) @@ -830,7 +830,7 @@ func (m *JoinGroupResp) Reset() { *m = JoinGroupResp{} } func (m *JoinGroupResp) String() string { return proto.CompactTextString(m) } func (*JoinGroupResp) ProtoMessage() {} func (*JoinGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{15} + return fileDescriptor_group_f05abf5eae29d157, []int{15} } func (m *JoinGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupResp.Unmarshal(m, b) @@ -873,7 +873,7 @@ func (m *GroupApplicationResponseReq) Reset() { *m = GroupApplicationRes func (m *GroupApplicationResponseReq) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseReq) ProtoMessage() {} func (*GroupApplicationResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{16} + return fileDescriptor_group_f05abf5eae29d157, []int{16} } func (m *GroupApplicationResponseReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseReq.Unmarshal(m, b) @@ -946,7 +946,7 @@ func (m *GroupApplicationResponseResp) Reset() { *m = GroupApplicationRe func (m *GroupApplicationResponseResp) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseResp) ProtoMessage() {} func (*GroupApplicationResponseResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{17} + return fileDescriptor_group_f05abf5eae29d157, []int{17} } func (m *GroupApplicationResponseResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseResp.Unmarshal(m, b) @@ -986,7 +986,7 @@ func (m *QuitGroupReq) Reset() { *m = QuitGroupReq{} } func (m *QuitGroupReq) String() string { return proto.CompactTextString(m) } func (*QuitGroupReq) ProtoMessage() {} func (*QuitGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{18} + return fileDescriptor_group_f05abf5eae29d157, []int{18} } func (m *QuitGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QuitGroupReq.Unmarshal(m, b) @@ -1038,7 +1038,7 @@ func (m *QuitGroupResp) Reset() { *m = QuitGroupResp{} } func (m *QuitGroupResp) String() string { return proto.CompactTextString(m) } func (*QuitGroupResp) ProtoMessage() {} func (*QuitGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{19} + return fileDescriptor_group_f05abf5eae29d157, []int{19} } func (m *QuitGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QuitGroupResp.Unmarshal(m, b) @@ -1080,7 +1080,7 @@ func (m *GetGroupMemberListReq) Reset() { *m = GetGroupMemberListReq{} } func (m *GetGroupMemberListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListReq) ProtoMessage() {} func (*GetGroupMemberListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{20} + return fileDescriptor_group_f05abf5eae29d157, []int{20} } func (m *GetGroupMemberListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListReq.Unmarshal(m, b) @@ -1149,7 +1149,7 @@ func (m *GetGroupMemberListResp) Reset() { *m = GetGroupMemberListResp{} func (m *GetGroupMemberListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListResp) ProtoMessage() {} func (*GetGroupMemberListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{21} + return fileDescriptor_group_f05abf5eae29d157, []int{21} } func (m *GetGroupMemberListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListResp.Unmarshal(m, b) @@ -1211,7 +1211,7 @@ func (m *GetGroupMembersInfoReq) Reset() { *m = GetGroupMembersInfoReq{} func (m *GetGroupMembersInfoReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoReq) ProtoMessage() {} func (*GetGroupMembersInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{22} + return fileDescriptor_group_f05abf5eae29d157, []int{22} } func (m *GetGroupMembersInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoReq.Unmarshal(m, b) @@ -1272,7 +1272,7 @@ func (m *GetGroupMembersInfoResp) Reset() { *m = GetGroupMembersInfoResp func (m *GetGroupMembersInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoResp) ProtoMessage() {} func (*GetGroupMembersInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{23} + return fileDescriptor_group_f05abf5eae29d157, []int{23} } func (m *GetGroupMembersInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoResp.Unmarshal(m, b) @@ -1328,7 +1328,7 @@ func (m *KickGroupMemberReq) Reset() { *m = KickGroupMemberReq{} } func (m *KickGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberReq) ProtoMessage() {} func (*KickGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{24} + return fileDescriptor_group_f05abf5eae29d157, []int{24} } func (m *KickGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberReq.Unmarshal(m, b) @@ -1395,7 +1395,7 @@ func (m *Id2Result) Reset() { *m = Id2Result{} } func (m *Id2Result) String() string { return proto.CompactTextString(m) } func (*Id2Result) ProtoMessage() {} func (*Id2Result) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{25} + return fileDescriptor_group_f05abf5eae29d157, []int{25} } func (m *Id2Result) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Id2Result.Unmarshal(m, b) @@ -1442,7 +1442,7 @@ func (m *KickGroupMemberResp) Reset() { *m = KickGroupMemberResp{} } func (m *KickGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberResp) ProtoMessage() {} func (*KickGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{26} + return fileDescriptor_group_f05abf5eae29d157, []int{26} } func (m *KickGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberResp.Unmarshal(m, b) @@ -1496,7 +1496,7 @@ func (m *GetJoinedGroupListReq) Reset() { *m = GetJoinedGroupListReq{} } func (m *GetJoinedGroupListReq) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListReq) ProtoMessage() {} func (*GetJoinedGroupListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{27} + return fileDescriptor_group_f05abf5eae29d157, []int{27} } func (m *GetJoinedGroupListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListReq.Unmarshal(m, b) @@ -1550,7 +1550,7 @@ func (m *GetJoinedGroupListResp) Reset() { *m = GetJoinedGroupListResp{} func (m *GetJoinedGroupListResp) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListResp) ProtoMessage() {} func (*GetJoinedGroupListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{28} + return fileDescriptor_group_f05abf5eae29d157, []int{28} } func (m *GetJoinedGroupListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListResp.Unmarshal(m, b) @@ -1606,7 +1606,7 @@ func (m *InviteUserToGroupReq) Reset() { *m = InviteUserToGroupReq{} } func (m *InviteUserToGroupReq) String() string { return proto.CompactTextString(m) } func (*InviteUserToGroupReq) ProtoMessage() {} func (*InviteUserToGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{29} + return fileDescriptor_group_f05abf5eae29d157, []int{29} } func (m *InviteUserToGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupReq.Unmarshal(m, b) @@ -1674,7 +1674,7 @@ 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_8c320ccb494991ed, []int{30} + return fileDescriptor_group_f05abf5eae29d157, []int{30} } func (m *InviteUserToGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupResp.Unmarshal(m, b) @@ -1728,7 +1728,7 @@ func (m *GetGroupAllMemberReq) Reset() { *m = GetGroupAllMemberReq{} } func (m *GetGroupAllMemberReq) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberReq) ProtoMessage() {} func (*GetGroupAllMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{31} + return fileDescriptor_group_f05abf5eae29d157, []int{31} } func (m *GetGroupAllMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberReq.Unmarshal(m, b) @@ -1782,7 +1782,7 @@ func (m *GetGroupAllMemberResp) Reset() { *m = GetGroupAllMemberResp{} } func (m *GetGroupAllMemberResp) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberResp) ProtoMessage() {} func (*GetGroupAllMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{32} + return fileDescriptor_group_f05abf5eae29d157, []int{32} } func (m *GetGroupAllMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberResp.Unmarshal(m, b) @@ -1836,7 +1836,7 @@ func (m *CMSGroup) Reset() { *m = CMSGroup{} } func (m *CMSGroup) String() string { return proto.CompactTextString(m) } func (*CMSGroup) ProtoMessage() {} func (*CMSGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{33} + return fileDescriptor_group_f05abf5eae29d157, []int{33} } func (m *CMSGroup) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CMSGroup.Unmarshal(m, b) @@ -1890,7 +1890,7 @@ func (m *GetGroupReq) Reset() { *m = GetGroupReq{} } func (m *GetGroupReq) String() string { return proto.CompactTextString(m) } func (*GetGroupReq) ProtoMessage() {} func (*GetGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{34} + return fileDescriptor_group_f05abf5eae29d157, []int{34} } func (m *GetGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupReq.Unmarshal(m, b) @@ -1944,7 +1944,7 @@ func (m *GetGroupResp) Reset() { *m = GetGroupResp{} } func (m *GetGroupResp) String() string { return proto.CompactTextString(m) } func (*GetGroupResp) ProtoMessage() {} func (*GetGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{35} + return fileDescriptor_group_f05abf5eae29d157, []int{35} } func (m *GetGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupResp.Unmarshal(m, b) @@ -1997,7 +1997,7 @@ func (m *GetGroupsReq) Reset() { *m = GetGroupsReq{} } func (m *GetGroupsReq) String() string { return proto.CompactTextString(m) } func (*GetGroupsReq) ProtoMessage() {} func (*GetGroupsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{36} + return fileDescriptor_group_f05abf5eae29d157, []int{36} } func (m *GetGroupsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsReq.Unmarshal(m, b) @@ -2044,7 +2044,7 @@ func (m *GetGroupsResp) Reset() { *m = GetGroupsResp{} } func (m *GetGroupsResp) String() string { return proto.CompactTextString(m) } func (*GetGroupsResp) ProtoMessage() {} func (*GetGroupsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{37} + return fileDescriptor_group_f05abf5eae29d157, []int{37} } func (m *GetGroupsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsResp.Unmarshal(m, b) @@ -2097,7 +2097,7 @@ func (m *GetGroupMemberReq) Reset() { *m = GetGroupMemberReq{} } func (m *GetGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberReq) ProtoMessage() {} func (*GetGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{38} + return fileDescriptor_group_f05abf5eae29d157, []int{38} } func (m *GetGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberReq.Unmarshal(m, b) @@ -2144,7 +2144,7 @@ func (m *OperateGroupStatusReq) Reset() { *m = OperateGroupStatusReq{} } func (m *OperateGroupStatusReq) String() string { return proto.CompactTextString(m) } func (*OperateGroupStatusReq) ProtoMessage() {} func (*OperateGroupStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{39} + return fileDescriptor_group_f05abf5eae29d157, []int{39} } func (m *OperateGroupStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateGroupStatusReq.Unmarshal(m, b) @@ -2195,7 +2195,7 @@ func (m *OperateGroupStatusResp) Reset() { *m = OperateGroupStatusResp{} func (m *OperateGroupStatusResp) String() string { return proto.CompactTextString(m) } func (*OperateGroupStatusResp) ProtoMessage() {} func (*OperateGroupStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{40} + return fileDescriptor_group_f05abf5eae29d157, []int{40} } func (m *OperateGroupStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateGroupStatusResp.Unmarshal(m, b) @@ -2229,7 +2229,7 @@ func (m *OperateUserRoleReq) Reset() { *m = OperateUserRoleReq{} } func (m *OperateUserRoleReq) String() string { return proto.CompactTextString(m) } func (*OperateUserRoleReq) ProtoMessage() {} func (*OperateUserRoleReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{41} + return fileDescriptor_group_f05abf5eae29d157, []int{41} } func (m *OperateUserRoleReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateUserRoleReq.Unmarshal(m, b) @@ -2287,7 +2287,7 @@ func (m *OperateUserRoleResp) Reset() { *m = OperateUserRoleResp{} } func (m *OperateUserRoleResp) String() string { return proto.CompactTextString(m) } func (*OperateUserRoleResp) ProtoMessage() {} func (*OperateUserRoleResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{42} + return fileDescriptor_group_f05abf5eae29d157, []int{42} } func (m *OperateUserRoleResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OperateUserRoleResp.Unmarshal(m, b) @@ -2319,7 +2319,7 @@ func (m *DeleteGroupReq) Reset() { *m = DeleteGroupReq{} } func (m *DeleteGroupReq) String() string { return proto.CompactTextString(m) } func (*DeleteGroupReq) ProtoMessage() {} func (*DeleteGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{43} + return fileDescriptor_group_f05abf5eae29d157, []int{43} } func (m *DeleteGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteGroupReq.Unmarshal(m, b) @@ -2363,7 +2363,7 @@ func (m *DeleteGroupResp) Reset() { *m = DeleteGroupResp{} } func (m *DeleteGroupResp) String() string { return proto.CompactTextString(m) } func (*DeleteGroupResp) ProtoMessage() {} func (*DeleteGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{44} + return fileDescriptor_group_f05abf5eae29d157, []int{44} } func (m *DeleteGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteGroupResp.Unmarshal(m, b) @@ -2395,7 +2395,7 @@ func (m *GetGroupByIdReq) Reset() { *m = GetGroupByIdReq{} } func (m *GetGroupByIdReq) String() string { return proto.CompactTextString(m) } func (*GetGroupByIdReq) ProtoMessage() {} func (*GetGroupByIdReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{45} + return fileDescriptor_group_f05abf5eae29d157, []int{45} } func (m *GetGroupByIdReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupByIdReq.Unmarshal(m, b) @@ -2440,7 +2440,7 @@ func (m *GetGroupByIdResp) Reset() { *m = GetGroupByIdResp{} } func (m *GetGroupByIdResp) String() string { return proto.CompactTextString(m) } func (*GetGroupByIdResp) ProtoMessage() {} func (*GetGroupByIdResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{46} + return fileDescriptor_group_f05abf5eae29d157, []int{46} } func (m *GetGroupByIdResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupByIdResp.Unmarshal(m, b) @@ -2481,7 +2481,7 @@ func (m *GetGroupMembersCMSReq) Reset() { *m = GetGroupMembersCMSReq{} } func (m *GetGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersCMSReq) ProtoMessage() {} func (*GetGroupMembersCMSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{47} + return fileDescriptor_group_f05abf5eae29d157, []int{47} } func (m *GetGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersCMSReq.Unmarshal(m, b) @@ -2542,7 +2542,7 @@ func (m *GetGroupMembersCMSResp) Reset() { *m = GetGroupMembersCMSResp{} func (m *GetGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersCMSResp) ProtoMessage() {} func (*GetGroupMembersCMSResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{48} + return fileDescriptor_group_f05abf5eae29d157, []int{48} } func (m *GetGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersCMSResp.Unmarshal(m, b) @@ -2597,7 +2597,7 @@ func (m *RemoveGroupMembersCMSReq) Reset() { *m = RemoveGroupMembersCMSR func (m *RemoveGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } func (*RemoveGroupMembersCMSReq) ProtoMessage() {} func (*RemoveGroupMembersCMSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{49} + return fileDescriptor_group_f05abf5eae29d157, []int{49} } func (m *RemoveGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RemoveGroupMembersCMSReq.Unmarshal(m, b) @@ -2657,7 +2657,7 @@ func (m *RemoveGroupMembersCMSResp) Reset() { *m = RemoveGroupMembersCMS func (m *RemoveGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } func (*RemoveGroupMembersCMSResp) ProtoMessage() {} func (*RemoveGroupMembersCMSResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{50} + return fileDescriptor_group_f05abf5eae29d157, []int{50} } func (m *RemoveGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RemoveGroupMembersCMSResp.Unmarshal(m, b) @@ -2705,7 +2705,7 @@ func (m *AddGroupMembersCMSReq) Reset() { *m = AddGroupMembersCMSReq{} } func (m *AddGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } func (*AddGroupMembersCMSReq) ProtoMessage() {} func (*AddGroupMembersCMSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{51} + return fileDescriptor_group_f05abf5eae29d157, []int{51} } func (m *AddGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddGroupMembersCMSReq.Unmarshal(m, b) @@ -2765,7 +2765,7 @@ func (m *AddGroupMembersCMSResp) Reset() { *m = AddGroupMembersCMSResp{} func (m *AddGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } func (*AddGroupMembersCMSResp) ProtoMessage() {} func (*AddGroupMembersCMSResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{52} + return fileDescriptor_group_f05abf5eae29d157, []int{52} } func (m *AddGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddGroupMembersCMSResp.Unmarshal(m, b) @@ -2812,7 +2812,7 @@ func (m *DismissGroupReq) Reset() { *m = DismissGroupReq{} } func (m *DismissGroupReq) String() string { return proto.CompactTextString(m) } func (*DismissGroupReq) ProtoMessage() {} func (*DismissGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{53} + return fileDescriptor_group_f05abf5eae29d157, []int{53} } func (m *DismissGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DismissGroupReq.Unmarshal(m, b) @@ -2864,7 +2864,7 @@ func (m *DismissGroupResp) Reset() { *m = DismissGroupResp{} } func (m *DismissGroupResp) String() string { return proto.CompactTextString(m) } func (*DismissGroupResp) ProtoMessage() {} func (*DismissGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{54} + return fileDescriptor_group_f05abf5eae29d157, []int{54} } func (m *DismissGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DismissGroupResp.Unmarshal(m, b) @@ -2906,7 +2906,7 @@ func (m *MuteGroupMemberReq) Reset() { *m = MuteGroupMemberReq{} } func (m *MuteGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*MuteGroupMemberReq) ProtoMessage() {} func (*MuteGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{55} + return fileDescriptor_group_f05abf5eae29d157, []int{55} } func (m *MuteGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupMemberReq.Unmarshal(m, b) @@ -2972,7 +2972,7 @@ func (m *MuteGroupMemberResp) Reset() { *m = MuteGroupMemberResp{} } func (m *MuteGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*MuteGroupMemberResp) ProtoMessage() {} func (*MuteGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{56} + return fileDescriptor_group_f05abf5eae29d157, []int{56} } func (m *MuteGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupMemberResp.Unmarshal(m, b) @@ -3013,7 +3013,7 @@ func (m *CancelMuteGroupMemberReq) Reset() { *m = CancelMuteGroupMemberR func (m *CancelMuteGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupMemberReq) ProtoMessage() {} func (*CancelMuteGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{57} + return fileDescriptor_group_f05abf5eae29d157, []int{57} } func (m *CancelMuteGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupMemberReq.Unmarshal(m, b) @@ -3072,7 +3072,7 @@ func (m *CancelMuteGroupMemberResp) Reset() { *m = CancelMuteGroupMember func (m *CancelMuteGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupMemberResp) ProtoMessage() {} func (*CancelMuteGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{58} + return fileDescriptor_group_f05abf5eae29d157, []int{58} } func (m *CancelMuteGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupMemberResp.Unmarshal(m, b) @@ -3112,7 +3112,7 @@ func (m *MuteGroupReq) Reset() { *m = MuteGroupReq{} } func (m *MuteGroupReq) String() string { return proto.CompactTextString(m) } func (*MuteGroupReq) ProtoMessage() {} func (*MuteGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{59} + return fileDescriptor_group_f05abf5eae29d157, []int{59} } func (m *MuteGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupReq.Unmarshal(m, b) @@ -3164,7 +3164,7 @@ func (m *MuteGroupResp) Reset() { *m = MuteGroupResp{} } func (m *MuteGroupResp) String() string { return proto.CompactTextString(m) } func (*MuteGroupResp) ProtoMessage() {} func (*MuteGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{60} + return fileDescriptor_group_f05abf5eae29d157, []int{60} } func (m *MuteGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MuteGroupResp.Unmarshal(m, b) @@ -3204,7 +3204,7 @@ func (m *CancelMuteGroupReq) Reset() { *m = CancelMuteGroupReq{} } func (m *CancelMuteGroupReq) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupReq) ProtoMessage() {} func (*CancelMuteGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{61} + return fileDescriptor_group_f05abf5eae29d157, []int{61} } func (m *CancelMuteGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupReq.Unmarshal(m, b) @@ -3256,7 +3256,7 @@ func (m *CancelMuteGroupResp) Reset() { *m = CancelMuteGroupResp{} } func (m *CancelMuteGroupResp) String() string { return proto.CompactTextString(m) } func (*CancelMuteGroupResp) ProtoMessage() {} func (*CancelMuteGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{62} + return fileDescriptor_group_f05abf5eae29d157, []int{62} } func (m *CancelMuteGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CancelMuteGroupResp.Unmarshal(m, b) @@ -3298,7 +3298,7 @@ func (m *SetGroupMemberNicknameReq) Reset() { *m = SetGroupMemberNicknam func (m *SetGroupMemberNicknameReq) String() string { return proto.CompactTextString(m) } func (*SetGroupMemberNicknameReq) ProtoMessage() {} func (*SetGroupMemberNicknameReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{63} + return fileDescriptor_group_f05abf5eae29d157, []int{63} } func (m *SetGroupMemberNicknameReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupMemberNicknameReq.Unmarshal(m, b) @@ -3364,7 +3364,7 @@ func (m *SetGroupMemberNicknameResp) Reset() { *m = SetGroupMemberNickna func (m *SetGroupMemberNicknameResp) String() string { return proto.CompactTextString(m) } func (*SetGroupMemberNicknameResp) ProtoMessage() {} func (*SetGroupMemberNicknameResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{64} + return fileDescriptor_group_f05abf5eae29d157, []int{64} } func (m *SetGroupMemberNicknameResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupMemberNicknameResp.Unmarshal(m, b) @@ -3391,6 +3391,206 @@ func (m *SetGroupMemberNicknameResp) GetCommonResp() *CommonResp { return nil } +type GetJoinedSuperGroupListReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,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 *GetJoinedSuperGroupListReq) Reset() { *m = GetJoinedSuperGroupListReq{} } +func (m *GetJoinedSuperGroupListReq) String() string { return proto.CompactTextString(m) } +func (*GetJoinedSuperGroupListReq) ProtoMessage() {} +func (*GetJoinedSuperGroupListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_f05abf5eae29d157, []int{65} +} +func (m *GetJoinedSuperGroupListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinedSuperGroupListReq.Unmarshal(m, b) +} +func (m *GetJoinedSuperGroupListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinedSuperGroupListReq.Marshal(b, m, deterministic) +} +func (dst *GetJoinedSuperGroupListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinedSuperGroupListReq.Merge(dst, src) +} +func (m *GetJoinedSuperGroupListReq) XXX_Size() int { + return xxx_messageInfo_GetJoinedSuperGroupListReq.Size(m) +} +func (m *GetJoinedSuperGroupListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinedSuperGroupListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetJoinedSuperGroupListReq proto.InternalMessageInfo + +func (m *GetJoinedSuperGroupListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetJoinedSuperGroupListReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetJoinedSuperGroupListReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetJoinedSuperGroupListResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + GroupList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupList" json:"GroupList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetJoinedSuperGroupListResp) Reset() { *m = GetJoinedSuperGroupListResp{} } +func (m *GetJoinedSuperGroupListResp) String() string { return proto.CompactTextString(m) } +func (*GetJoinedSuperGroupListResp) ProtoMessage() {} +func (*GetJoinedSuperGroupListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_f05abf5eae29d157, []int{66} +} +func (m *GetJoinedSuperGroupListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinedSuperGroupListResp.Unmarshal(m, b) +} +func (m *GetJoinedSuperGroupListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinedSuperGroupListResp.Marshal(b, m, deterministic) +} +func (dst *GetJoinedSuperGroupListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinedSuperGroupListResp.Merge(dst, src) +} +func (m *GetJoinedSuperGroupListResp) XXX_Size() int { + return xxx_messageInfo_GetJoinedSuperGroupListResp.Size(m) +} +func (m *GetJoinedSuperGroupListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinedSuperGroupListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetJoinedSuperGroupListResp proto.InternalMessageInfo + +func (m *GetJoinedSuperGroupListResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetJoinedSuperGroupListResp) GetGroupList() []*sdk_ws.GroupInfo { + if m != nil { + return m.GroupList + } + return nil +} + +type GetSuperGroupsInfoReq struct { + GroupIDList []string `protobuf:"bytes,1,rep,name=GroupIDList" json:"GroupIDList,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 *GetSuperGroupsInfoReq) Reset() { *m = GetSuperGroupsInfoReq{} } +func (m *GetSuperGroupsInfoReq) String() string { return proto.CompactTextString(m) } +func (*GetSuperGroupsInfoReq) ProtoMessage() {} +func (*GetSuperGroupsInfoReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_f05abf5eae29d157, []int{67} +} +func (m *GetSuperGroupsInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSuperGroupsInfoReq.Unmarshal(m, b) +} +func (m *GetSuperGroupsInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSuperGroupsInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetSuperGroupsInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSuperGroupsInfoReq.Merge(dst, src) +} +func (m *GetSuperGroupsInfoReq) XXX_Size() int { + return xxx_messageInfo_GetSuperGroupsInfoReq.Size(m) +} +func (m *GetSuperGroupsInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetSuperGroupsInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSuperGroupsInfoReq proto.InternalMessageInfo + +func (m *GetSuperGroupsInfoReq) GetGroupIDList() []string { + if m != nil { + return m.GroupIDList + } + return nil +} + +func (m *GetSuperGroupsInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetSuperGroupsInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetSuperGroupsInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + GroupInfoList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupInfoList" json:"GroupInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSuperGroupsInfoResp) Reset() { *m = GetSuperGroupsInfoResp{} } +func (m *GetSuperGroupsInfoResp) String() string { return proto.CompactTextString(m) } +func (*GetSuperGroupsInfoResp) ProtoMessage() {} +func (*GetSuperGroupsInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_f05abf5eae29d157, []int{68} +} +func (m *GetSuperGroupsInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSuperGroupsInfoResp.Unmarshal(m, b) +} +func (m *GetSuperGroupsInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSuperGroupsInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetSuperGroupsInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSuperGroupsInfoResp.Merge(dst, src) +} +func (m *GetSuperGroupsInfoResp) XXX_Size() int { + return xxx_messageInfo_GetSuperGroupsInfoResp.Size(m) +} +func (m *GetSuperGroupsInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetSuperGroupsInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSuperGroupsInfoResp proto.InternalMessageInfo + +func (m *GetSuperGroupsInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetSuperGroupsInfoResp) GetGroupInfoList() []*sdk_ws.GroupInfo { + if m != nil { + return m.GroupInfoList + } + return nil +} + type SetGroupMemberInfoReq struct { GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` @@ -3409,7 +3609,7 @@ func (m *SetGroupMemberInfoReq) Reset() { *m = SetGroupMemberInfoReq{} } func (m *SetGroupMemberInfoReq) String() string { return proto.CompactTextString(m) } func (*SetGroupMemberInfoReq) ProtoMessage() {} func (*SetGroupMemberInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{65} + return fileDescriptor_group_f05abf5eae29d157, []int{69} } func (m *SetGroupMemberInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupMemberInfoReq.Unmarshal(m, b) @@ -3496,7 +3696,7 @@ func (m *SetGroupMemberInfoResp) Reset() { *m = SetGroupMemberInfoResp{} func (m *SetGroupMemberInfoResp) String() string { return proto.CompactTextString(m) } func (*SetGroupMemberInfoResp) ProtoMessage() {} func (*SetGroupMemberInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_8c320ccb494991ed, []int{66} + return fileDescriptor_group_f05abf5eae29d157, []int{70} } func (m *SetGroupMemberInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupMemberInfoResp.Unmarshal(m, b) @@ -3589,6 +3789,10 @@ func init() { proto.RegisterType((*CancelMuteGroupResp)(nil), "group.CancelMuteGroupResp") proto.RegisterType((*SetGroupMemberNicknameReq)(nil), "group.SetGroupMemberNicknameReq") proto.RegisterType((*SetGroupMemberNicknameResp)(nil), "group.SetGroupMemberNicknameResp") + proto.RegisterType((*GetJoinedSuperGroupListReq)(nil), "group.GetJoinedSuperGroupListReq") + proto.RegisterType((*GetJoinedSuperGroupListResp)(nil), "group.GetJoinedSuperGroupListResp") + proto.RegisterType((*GetSuperGroupsInfoReq)(nil), "group.GetSuperGroupsInfoReq") + proto.RegisterType((*GetSuperGroupsInfoResp)(nil), "group.GetSuperGroupsInfoResp") proto.RegisterType((*SetGroupMemberInfoReq)(nil), "group.SetGroupMemberInfoReq") proto.RegisterType((*SetGroupMemberInfoResp)(nil), "group.SetGroupMemberInfoResp") } @@ -3634,6 +3838,8 @@ type GroupClient interface { MuteGroup(ctx context.Context, in *MuteGroupReq, opts ...grpc.CallOption) (*MuteGroupResp, error) CancelMuteGroup(ctx context.Context, in *CancelMuteGroupReq, opts ...grpc.CallOption) (*CancelMuteGroupResp, error) SetGroupMemberNickname(ctx context.Context, in *SetGroupMemberNicknameReq, opts ...grpc.CallOption) (*SetGroupMemberNicknameResp, error) + GetJoinedSuperGroupList(ctx context.Context, in *GetJoinedSuperGroupListReq, opts ...grpc.CallOption) (*GetJoinedSuperGroupListResp, error) + GetSuperGroupsInfo(ctx context.Context, in *GetSuperGroupsInfoReq, opts ...grpc.CallOption) (*GetSuperGroupsInfoResp, error) SetGroupMemberInfo(ctx context.Context, in *SetGroupMemberInfoReq, opts ...grpc.CallOption) (*SetGroupMemberInfoResp, error) } @@ -3915,6 +4121,24 @@ func (c *groupClient) SetGroupMemberNickname(ctx context.Context, in *SetGroupMe return out, nil } +func (c *groupClient) GetJoinedSuperGroupList(ctx context.Context, in *GetJoinedSuperGroupListReq, opts ...grpc.CallOption) (*GetJoinedSuperGroupListResp, error) { + out := new(GetJoinedSuperGroupListResp) + err := grpc.Invoke(ctx, "/group.group/GetJoinedSuperGroupList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetSuperGroupsInfo(ctx context.Context, in *GetSuperGroupsInfoReq, opts ...grpc.CallOption) (*GetSuperGroupsInfoResp, error) { + out := new(GetSuperGroupsInfoResp) + err := grpc.Invoke(ctx, "/group.group/GetSuperGroupsInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *groupClient) SetGroupMemberInfo(ctx context.Context, in *SetGroupMemberInfoReq, opts ...grpc.CallOption) (*SetGroupMemberInfoResp, error) { out := new(SetGroupMemberInfoResp) err := grpc.Invoke(ctx, "/group.group/SetGroupMemberInfo", in, out, c.cc, opts...) @@ -3957,6 +4181,8 @@ type GroupServer interface { MuteGroup(context.Context, *MuteGroupReq) (*MuteGroupResp, error) CancelMuteGroup(context.Context, *CancelMuteGroupReq) (*CancelMuteGroupResp, error) SetGroupMemberNickname(context.Context, *SetGroupMemberNicknameReq) (*SetGroupMemberNicknameResp, error) + GetJoinedSuperGroupList(context.Context, *GetJoinedSuperGroupListReq) (*GetJoinedSuperGroupListResp, error) + GetSuperGroupsInfo(context.Context, *GetSuperGroupsInfoReq) (*GetSuperGroupsInfoResp, error) SetGroupMemberInfo(context.Context, *SetGroupMemberInfoReq) (*SetGroupMemberInfoResp, error) } @@ -4504,6 +4730,42 @@ func _Group_SetGroupMemberNickname_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Group_GetJoinedSuperGroupList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetJoinedSuperGroupListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetJoinedSuperGroupList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetJoinedSuperGroupList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetJoinedSuperGroupList(ctx, req.(*GetJoinedSuperGroupListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetSuperGroupsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSuperGroupsInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetSuperGroupsInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetSuperGroupsInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetSuperGroupsInfo(ctx, req.(*GetSuperGroupsInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Group_SetGroupMemberInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetGroupMemberInfoReq) if err := dec(in); err != nil { @@ -4646,6 +4908,14 @@ var _Group_serviceDesc = grpc.ServiceDesc{ MethodName: "SetGroupMemberNickname", Handler: _Group_SetGroupMemberNickname_Handler, }, + { + MethodName: "GetJoinedSuperGroupList", + Handler: _Group_GetJoinedSuperGroupList_Handler, + }, + { + MethodName: "GetSuperGroupsInfo", + Handler: _Group_GetSuperGroupsInfo_Handler, + }, { MethodName: "SetGroupMemberInfo", Handler: _Group_SetGroupMemberInfo_Handler, @@ -4655,150 +4925,156 @@ var _Group_serviceDesc = grpc.ServiceDesc{ Metadata: "group/group.proto", } -func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_8c320ccb494991ed) } +func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_f05abf5eae29d157) } -var fileDescriptor_group_8c320ccb494991ed = []byte{ - // 2272 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4f, 0x6f, 0x1c, 0x4b, - 0x11, 0xd7, 0xd8, 0x5e, 0xdb, 0x5b, 0xb6, 0xb3, 0x76, 0x3b, 0x6b, 0xaf, 0x27, 0x7e, 0x79, 0x4e, - 0xbf, 0xf0, 0x88, 0xe0, 0x61, 0x0b, 0x47, 0x8a, 0x80, 0x87, 0x08, 0xf1, 0x9f, 0xc4, 0x9b,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0x0d, 0x58, 0xca, 0x6c, 0x5a, 0x49, - 0xee, 0x1d, 0x58, 0x90, 0x82, 0x30, 0xa4, 0x93, 0xcc, 0x34, 0xca, 0x65, 0x4f, 0x2f, 0xc1, 0xbf, - 0x34, 0xa0, 0x71, 0x22, 0xb0, 0xc4, 0xf2, 0xa7, 0xf4, 0x69, 0xbc, 0x99, 0xc1, 0xa8, 0x72, 0x4f, - 0x68, 0xcc, 0xa1, 0xd4, 0x98, 0xf0, 0x3e, 0x2c, 0xa6, 0xc1, 0x50, 0x1f, 0x7d, 0x53, 0x75, 0x50, - 0x01, 0x67, 0x49, 0x58, 0x7f, 0x32, 0x61, 0x29, 0x4c, 0xf8, 0x67, 0x60, 0xc6, 0xfa, 0xbd, 0xe7, - 0xfb, 0xfd, 0x5e, 0x87, 0x7d, 0x3f, 0x92, 0x37, 0x12, 0x4f, 0x85, 0x68, 0x94, 0x43, 0xd4, 0x1c, - 0xec, 0x75, 0x80, 0xfb, 0x81, 0x37, 0x48, 0x1d, 0xad, 0x42, 0xc1, 0xbf, 0x37, 0xe0, 0x5a, 0xe1, - 0xe6, 0x95, 0x8e, 0xf9, 0x11, 0x2c, 0xc6, 0xe1, 0x60, 0x48, 0x68, 0xa8, 0x9c, 0xf4, 0x87, 0x45, - 0xa7, 0x22, 0x58, 0xad, 0xdc, 0x42, 0x1c, 0xc2, 0xfa, 0x03, 0x12, 0x46, 0x58, 0x2d, 0x72, 0xae, - 0x51, 0x4e, 0x51, 0xe0, 0x1a, 0xef, 0x5c, 0xff, 0x60, 0xc0, 0x07, 0x25, 0xdb, 0x56, 0x3a, 0x65, - 0xad, 0x5e, 0x26, 0xaa, 0xea, 0xe5, 0x1f, 0x06, 0x34, 0x9f, 0x06, 0xb6, 0x4b, 0x4f, 0x49, 0xc0, - 0x26, 0x59, 0x94, 0x8a, 0x34, 0xd2, 0x82, 0x19, 0xe1, 0xfa, 0x42, 0x25, 0xf1, 0x10, 0x7d, 0x0c, - 0x57, 0x8e, 0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 0x44, 0x49, 0xd3, 0xd0, 0xe6, 0xb0, 0xd2, 0x34, 0xf4, - 0xd9, 0xd7, 0x4e, 0xe3, 0xd9, 0xc2, 0x26, 0xff, 0xdb, 0xe6, 0xa7, 0xec, 0xf7, 0xc5, 0x34, 0x4b, - 0xe1, 0x6e, 0xff, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x53, 0x05, 0x0a, 0x0e, 0xd2, 0x29, 0x00, 0x00, +var fileDescriptor_group_f05abf5eae29d157 = []byte{ + // 2362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4f, 0x6f, 0x1c, 0x49, + 0x15, 0x57, 0xdb, 0x99, 0xd8, 0xf3, 0x6c, 0x67, 0xec, 0x72, 0xc6, 0x1e, 0x77, 0xbc, 0x59, 0xa7, + 0x37, 0x2c, 0x11, 0x2c, 0xb6, 0x70, 0xa4, 0x08, 0x58, 0x44, 0x88, 0xff, 0x24, 0x9e, 0x24, 0xb6, + 0x71, 0x3b, 0xcb, 0x21, 0x12, 0x0a, 0x9d, 0xe9, 0xf2, 0x68, 0xf0, 0x4c, 0x77, 0xbb, 0xab, 0xc7, + 0x0e, 0x5c, 0x56, 0x5c, 0x56, 0x5a, 0x40, 0x02, 0x84, 0xc4, 0x09, 0x09, 0xf6, 0x04, 0x07, 0x0e, + 0x1c, 0xe0, 0x8c, 0xf8, 0x18, 0x5c, 0xf9, 0x02, 0x7c, 0x02, 0x24, 0xd4, 0x55, 0xd5, 0xd5, 0xd5, + 0x5d, 0xd5, 0xed, 0x49, 0x4f, 0xb2, 0xb9, 0xb4, 0x54, 0x55, 0xaf, 0xea, 0xfd, 0xde, 0xab, 0xf7, + 0x5e, 0xd5, 0x7b, 0xd5, 0xb0, 0xd0, 0x0d, 0xfd, 0x61, 0xb0, 0x41, 0xbf, 0xeb, 0x41, 0xe8, 0x47, + 0x3e, 0xaa, 0xd1, 0x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f, 0x01, 0x52, + 0x6f, 0x7e, 0x62, 0x49, 0xed, 0xc5, 0x5b, 0x2c, 0xa9, 0xbf, 0x32, 0x6e, 0x35, 0x9e, 0xcf, 0xad, + 0xb3, 0x3f, 0x8f, 0x3f, 0xa6, 0xdf, 0x97, 0x57, 0xe9, 0xbd, 0xf3, 0xee, 0xff, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xce, 0xc7, 0x31, 0xb6, 0x95, 0x2c, 0x00, 0x00, } diff --git a/pkg/proto/group/group.proto b/pkg/proto/group/group.proto index b457983b5..f9c93ee3d 100644 --- a/pkg/proto/group/group.proto +++ b/pkg/proto/group/group.proto @@ -14,7 +14,6 @@ message GroupAddMemberInfo{ int32 RoleLevel = 2; } - message CreateGroupReq{ repeated GroupAddMemberInfo InitMemberList = 1; server_api_params.GroupInfo GroupInfo = 2; @@ -392,6 +391,28 @@ message SetGroupMemberNicknameResp{ CommonResp CommonResp = 1; } +message GetJoinedSuperGroupListReq { + string operationID = 1; + string userID = 2; + string opUserID = 3; +} + +message GetJoinedSuperGroupListResp { + CommonResp commonResp = 1; + repeated server_api_params.GroupInfo GroupList = 3; +} + +message GetSuperGroupsInfoReq { + repeated string GroupIDList = 1; + string OperationID = 2; + string OpUserID = 3; //No verification permission +} + +message GetSuperGroupsInfoResp { + CommonResp commonResp = 1; + repeated server_api_params.GroupInfo GroupInfoList = 3; +} + message SetGroupMemberInfoReq{ string groupID = 1; string userID = 2; @@ -441,7 +462,11 @@ service group{ rpc CancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp); rpc SetGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp); + + rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp); + rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp); rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp); + } diff --git a/pkg/proto/organization/organization.pb.go b/pkg/proto/organization/organization.pb.go index 803c23fad..4aec922db 100644 --- a/pkg/proto/organization/organization.pb.go +++ b/pkg/proto/organization/organization.pb.go @@ -37,7 +37,7 @@ func (m *CreateDepartmentReq) Reset() { *m = CreateDepartmentReq{} } func (m *CreateDepartmentReq) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentReq) ProtoMessage() {} func (*CreateDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{0} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{0} } func (m *CreateDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentReq.Unmarshal(m, b) @@ -91,7 +91,7 @@ func (m *CreateDepartmentResp) Reset() { *m = CreateDepartmentResp{} } func (m *CreateDepartmentResp) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentResp) ProtoMessage() {} func (*CreateDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{1} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{1} } func (m *CreateDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentResp.Unmarshal(m, b) @@ -145,7 +145,7 @@ func (m *UpdateDepartmentReq) Reset() { *m = UpdateDepartmentReq{} } func (m *UpdateDepartmentReq) String() string { return proto.CompactTextString(m) } func (*UpdateDepartmentReq) ProtoMessage() {} func (*UpdateDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{2} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{2} } func (m *UpdateDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateDepartmentReq.Unmarshal(m, b) @@ -198,7 +198,7 @@ func (m *UpdateDepartmentResp) Reset() { *m = UpdateDepartmentResp{} } func (m *UpdateDepartmentResp) String() string { return proto.CompactTextString(m) } func (*UpdateDepartmentResp) ProtoMessage() {} func (*UpdateDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{3} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{3} } func (m *UpdateDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateDepartmentResp.Unmarshal(m, b) @@ -245,7 +245,7 @@ func (m *GetSubDepartmentReq) Reset() { *m = GetSubDepartmentReq{} } func (m *GetSubDepartmentReq) String() string { return proto.CompactTextString(m) } func (*GetSubDepartmentReq) ProtoMessage() {} func (*GetSubDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{4} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{4} } func (m *GetSubDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSubDepartmentReq.Unmarshal(m, b) @@ -299,7 +299,7 @@ func (m *GetSubDepartmentResp) Reset() { *m = GetSubDepartmentResp{} } func (m *GetSubDepartmentResp) String() string { return proto.CompactTextString(m) } func (*GetSubDepartmentResp) ProtoMessage() {} func (*GetSubDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{5} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{5} } func (m *GetSubDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetSubDepartmentResp.Unmarshal(m, b) @@ -353,7 +353,7 @@ func (m *DeleteDepartmentReq) Reset() { *m = DeleteDepartmentReq{} } func (m *DeleteDepartmentReq) String() string { return proto.CompactTextString(m) } func (*DeleteDepartmentReq) ProtoMessage() {} func (*DeleteDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{6} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{6} } func (m *DeleteDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteDepartmentReq.Unmarshal(m, b) @@ -406,7 +406,7 @@ func (m *DeleteDepartmentResp) Reset() { *m = DeleteDepartmentResp{} } func (m *DeleteDepartmentResp) String() string { return proto.CompactTextString(m) } func (*DeleteDepartmentResp) ProtoMessage() {} func (*DeleteDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{7} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{7} } func (m *DeleteDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteDepartmentResp.Unmarshal(m, b) @@ -452,7 +452,7 @@ func (m *GetDepartmentParentIDListReq) Reset() { *m = GetDepartmentParen func (m *GetDepartmentParentIDListReq) String() string { return proto.CompactTextString(m) } func (*GetDepartmentParentIDListReq) ProtoMessage() {} func (*GetDepartmentParentIDListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{8} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{8} } func (m *GetDepartmentParentIDListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentParentIDListReq.Unmarshal(m, b) @@ -499,7 +499,7 @@ func (m *GetDepartmentParentIDListResp) Reset() { *m = GetDepartmentPare func (m *GetDepartmentParentIDListResp) String() string { return proto.CompactTextString(m) } func (*GetDepartmentParentIDListResp) ProtoMessage() {} func (*GetDepartmentParentIDListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{9} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{9} } func (m *GetDepartmentParentIDListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentParentIDListResp.Unmarshal(m, b) @@ -544,6 +544,7 @@ type CreateOrganizationUserReq struct { OrganizationUser *sdk_ws.OrganizationUser `protobuf:"bytes,1,opt,name=organizationUser" json:"organizationUser,omitempty"` OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + IsRegister bool `protobuf:"varint,4,opt,name=IsRegister" json:"IsRegister,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -553,7 +554,7 @@ func (m *CreateOrganizationUserReq) Reset() { *m = CreateOrganizationUse func (m *CreateOrganizationUserReq) String() string { return proto.CompactTextString(m) } func (*CreateOrganizationUserReq) ProtoMessage() {} func (*CreateOrganizationUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{10} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{10} } func (m *CreateOrganizationUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateOrganizationUserReq.Unmarshal(m, b) @@ -594,6 +595,13 @@ func (m *CreateOrganizationUserReq) GetOpUserID() string { return "" } +func (m *CreateOrganizationUserReq) GetIsRegister() bool { + if m != nil { + return m.IsRegister + } + return false +} + type CreateOrganizationUserResp struct { ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` @@ -606,7 +614,7 @@ func (m *CreateOrganizationUserResp) Reset() { *m = CreateOrganizationUs func (m *CreateOrganizationUserResp) String() string { return proto.CompactTextString(m) } func (*CreateOrganizationUserResp) ProtoMessage() {} func (*CreateOrganizationUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{11} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{11} } func (m *CreateOrganizationUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateOrganizationUserResp.Unmarshal(m, b) @@ -653,7 +661,7 @@ func (m *UpdateOrganizationUserReq) Reset() { *m = UpdateOrganizationUse func (m *UpdateOrganizationUserReq) String() string { return proto.CompactTextString(m) } func (*UpdateOrganizationUserReq) ProtoMessage() {} func (*UpdateOrganizationUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{12} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{12} } func (m *UpdateOrganizationUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateOrganizationUserReq.Unmarshal(m, b) @@ -706,7 +714,7 @@ func (m *UpdateOrganizationUserResp) Reset() { *m = UpdateOrganizationUs func (m *UpdateOrganizationUserResp) String() string { return proto.CompactTextString(m) } func (*UpdateOrganizationUserResp) ProtoMessage() {} func (*UpdateOrganizationUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{13} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{13} } func (m *UpdateOrganizationUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateOrganizationUserResp.Unmarshal(m, b) @@ -753,7 +761,7 @@ func (m *CreateDepartmentMemberReq) Reset() { *m = CreateDepartmentMembe func (m *CreateDepartmentMemberReq) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentMemberReq) ProtoMessage() {} func (*CreateDepartmentMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{14} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{14} } func (m *CreateDepartmentMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentMemberReq.Unmarshal(m, b) @@ -806,7 +814,7 @@ func (m *CreateDepartmentMemberResp) Reset() { *m = CreateDepartmentMemb func (m *CreateDepartmentMemberResp) String() string { return proto.CompactTextString(m) } func (*CreateDepartmentMemberResp) ProtoMessage() {} func (*CreateDepartmentMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{15} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{15} } func (m *CreateDepartmentMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateDepartmentMemberResp.Unmarshal(m, b) @@ -853,7 +861,7 @@ func (m *GetUserInDepartmentReq) Reset() { *m = GetUserInDepartmentReq{} func (m *GetUserInDepartmentReq) String() string { return proto.CompactTextString(m) } func (*GetUserInDepartmentReq) ProtoMessage() {} func (*GetUserInDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{16} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{16} } func (m *GetUserInDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInDepartmentReq.Unmarshal(m, b) @@ -907,7 +915,7 @@ func (m *GetUserInDepartmentResp) Reset() { *m = GetUserInDepartmentResp func (m *GetUserInDepartmentResp) String() string { return proto.CompactTextString(m) } func (*GetUserInDepartmentResp) ProtoMessage() {} func (*GetUserInDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{17} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{17} } func (m *GetUserInDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInDepartmentResp.Unmarshal(m, b) @@ -961,7 +969,7 @@ func (m *UpdateUserInDepartmentReq) Reset() { *m = UpdateUserInDepartmen func (m *UpdateUserInDepartmentReq) String() string { return proto.CompactTextString(m) } func (*UpdateUserInDepartmentReq) ProtoMessage() {} func (*UpdateUserInDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{18} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{18} } func (m *UpdateUserInDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInDepartmentReq.Unmarshal(m, b) @@ -1014,7 +1022,7 @@ func (m *UpdateUserInDepartmentResp) Reset() { *m = UpdateUserInDepartme func (m *UpdateUserInDepartmentResp) String() string { return proto.CompactTextString(m) } func (*UpdateUserInDepartmentResp) ProtoMessage() {} func (*UpdateUserInDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{19} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{19} } func (m *UpdateUserInDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInDepartmentResp.Unmarshal(m, b) @@ -1062,7 +1070,7 @@ func (m *DeleteUserInDepartmentReq) Reset() { *m = DeleteUserInDepartmen func (m *DeleteUserInDepartmentReq) String() string { return proto.CompactTextString(m) } func (*DeleteUserInDepartmentReq) ProtoMessage() {} func (*DeleteUserInDepartmentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{20} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{20} } func (m *DeleteUserInDepartmentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserInDepartmentReq.Unmarshal(m, b) @@ -1122,7 +1130,7 @@ func (m *DeleteUserInDepartmentResp) Reset() { *m = DeleteUserInDepartme func (m *DeleteUserInDepartmentResp) String() string { return proto.CompactTextString(m) } func (*DeleteUserInDepartmentResp) ProtoMessage() {} func (*DeleteUserInDepartmentResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{21} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{21} } func (m *DeleteUserInDepartmentResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserInDepartmentResp.Unmarshal(m, b) @@ -1169,7 +1177,7 @@ func (m *DeleteOrganizationUserReq) Reset() { *m = DeleteOrganizationUse func (m *DeleteOrganizationUserReq) String() string { return proto.CompactTextString(m) } func (*DeleteOrganizationUserReq) ProtoMessage() {} func (*DeleteOrganizationUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{22} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{22} } func (m *DeleteOrganizationUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteOrganizationUserReq.Unmarshal(m, b) @@ -1222,7 +1230,7 @@ func (m *DeleteOrganizationUserResp) Reset() { *m = DeleteOrganizationUs func (m *DeleteOrganizationUserResp) String() string { return proto.CompactTextString(m) } func (*DeleteOrganizationUserResp) ProtoMessage() {} func (*DeleteOrganizationUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{23} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{23} } func (m *DeleteOrganizationUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteOrganizationUserResp.Unmarshal(m, b) @@ -1269,7 +1277,7 @@ func (m *GetDepartmentMemberReq) Reset() { *m = GetDepartmentMemberReq{} func (m *GetDepartmentMemberReq) String() string { return proto.CompactTextString(m) } func (*GetDepartmentMemberReq) ProtoMessage() {} func (*GetDepartmentMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{24} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{24} } func (m *GetDepartmentMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentMemberReq.Unmarshal(m, b) @@ -1323,7 +1331,7 @@ func (m *GetDepartmentMemberResp) Reset() { *m = GetDepartmentMemberResp func (m *GetDepartmentMemberResp) String() string { return proto.CompactTextString(m) } func (*GetDepartmentMemberResp) ProtoMessage() {} func (*GetDepartmentMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{25} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{25} } func (m *GetDepartmentMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentMemberResp.Unmarshal(m, b) @@ -1376,7 +1384,7 @@ func (m *GetDepartmentRelatedGroupIDListReq) Reset() { *m = GetDepartmen func (m *GetDepartmentRelatedGroupIDListReq) String() string { return proto.CompactTextString(m) } func (*GetDepartmentRelatedGroupIDListReq) ProtoMessage() {} func (*GetDepartmentRelatedGroupIDListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{26} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{26} } func (m *GetDepartmentRelatedGroupIDListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentRelatedGroupIDListReq.Unmarshal(m, b) @@ -1423,7 +1431,7 @@ func (m *GetDepartmentRelatedGroupIDListResp) Reset() { *m = GetDepartme func (m *GetDepartmentRelatedGroupIDListResp) String() string { return proto.CompactTextString(m) } func (*GetDepartmentRelatedGroupIDListResp) ProtoMessage() {} func (*GetDepartmentRelatedGroupIDListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_organization_6d9a9b5829486353, []int{27} + return fileDescriptor_organization_2845c40b2de0bcf0, []int{27} } func (m *GetDepartmentRelatedGroupIDListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetDepartmentRelatedGroupIDListResp.Unmarshal(m, b) @@ -1997,62 +2005,64 @@ var _Organization_serviceDesc = grpc.ServiceDesc{ } func init() { - proto.RegisterFile("organization/organization.proto", fileDescriptor_organization_6d9a9b5829486353) + proto.RegisterFile("organization/organization.proto", fileDescriptor_organization_2845c40b2de0bcf0) } -var fileDescriptor_organization_6d9a9b5829486353 = []byte{ - // 846 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6e, 0xd3, 0x4c, - 0x10, 0x97, 0x9b, 0xef, 0x2b, 0x74, 0x52, 0xa1, 0x68, 0x5b, 0x85, 0xd4, 0x50, 0x35, 0x75, 0x5b, - 0x35, 0x2a, 0x52, 0x02, 0xe5, 0xc8, 0x8d, 0x06, 0xa5, 0x91, 0x28, 0x41, 0x41, 0x3d, 0x94, 0x4b, - 0xe4, 0xe0, 0x25, 0x8a, 0xd2, 0xda, 0xdb, 0xb5, 0x43, 0x45, 0x1f, 0x80, 0x2b, 0x27, 0x2e, 0x88, - 0x27, 0xe0, 0xc4, 0x9b, 0xf0, 0x4a, 0xc8, 0x6b, 0x37, 0x59, 0xef, 0x8e, 0x93, 0xd4, 0x4d, 0x51, - 0x39, 0x7a, 0xb2, 0xfb, 0x9b, 0x7f, 0x3b, 0x33, 0xbf, 0x09, 0x6c, 0x78, 0xbc, 0x67, 0xbb, 0xfd, - 0x4b, 0x3b, 0xe8, 0x7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, 0x8a, 0x3f, 0xe1, 0x9e, - 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xfc, 0xb9, 0x33, 0xd8, 0x13, 0x00, 0x00, +var fileDescriptor_organization_2845c40b2de0bcf0 = []byte{ + // 869 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x4f, 0x13, 0x41, + 0x14, 0xcf, 0x52, 0x44, 0x78, 0x25, 0xa6, 0x19, 0x48, 0x6d, 0x57, 0x91, 0xb2, 0x40, 0x68, 0x30, + 0x69, 0x15, 0x8f, 0xde, 0xa4, 0xa6, 0x34, 0x11, 0x6b, 0xd6, 0x70, 0xc0, 0x4b, 0xb3, 0xb5, 0x63, + 0xd3, 0x14, 0xba, 0xc3, 0xcc, 0x56, 0x22, 0x1f, 0xc0, 0xab, 0x27, 0x2f, 0xc6, 0x4f, 0xe0, 0xc9, + 0xcf, 0xe1, 0xc5, 0xaf, 0x64, 0x76, 0xb7, 0xb4, 0xb3, 0x33, 0x6f, 0xdb, 0xb2, 0x2d, 0x86, 0xe3, + 0xbc, 0x9d, 0xf9, 0xbd, 0xf7, 0x7e, 0x6f, 0xe6, 0xfd, 0x59, 0xd8, 0x74, 0x79, 0xdb, 0xe9, 0x75, + 0xae, 0x1c, 0xaf, 0xe3, 0xf6, 0xca, 0xf2, 0xa2, 0xc4, 0xb8, 0xeb, 0xb9, 0x64, 0x55, 0x96, 0x99, + 0x5b, 0x75, 0x46, 0x7b, 0x8d, 0xda, 0x71, 0x99, 0x75, 0xdb, 0xe5, 0x60, 0x43, 0x59, 0xb4, 0xba, + 0x8d, 0x4b, 0x51, 0xbe, 0x14, 0xe1, 0x01, 0xeb, 0x87, 0x01, 0x6b, 0x87, 0x9c, 0x3a, 0x1e, 0xad, + 0x50, 0xe6, 0x70, 0xef, 0x9c, 0xf6, 0x3c, 0x9b, 0x5e, 0x90, 0xd7,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+ 0xe6, 0xd3, 0xa9, 0xf7, 0x0a, 0x46, 0xba, 0x90, 0xc5, 0x3b, 0x42, 0xb2, 0x87, 0x05, 0x11, 0xc9, + 0x7c, 0x66, 0x71, 0xba, 0x8d, 0xa1, 0x32, 0xbc, 0x03, 0x53, 0x95, 0xc5, 0xf6, 0x94, 0xaa, 0xb2, + 0x31, 0x0d, 0x5d, 0x17, 0xb2, 0x78, 0xea, 0x54, 0x95, 0xc5, 0xe6, 0x74, 0x55, 0xd9, 0x98, 0x4c, + 0x3c, 0xa4, 0x51, 0x4d, 0x23, 0x38, 0x8d, 0x48, 0x02, 0xc6, 0x69, 0x44, 0x93, 0x65, 0x33, 0x98, + 0x9e, 0xd5, 0xa2, 0x46, 0x76, 0xb4, 0xb8, 0x23, 0xe5, 0xd8, 0xdc, 0x9d, 0x62, 0x97, 0xcc, 0x9e, + 0xa6, 0x06, 0x65, 0x0f, 0xd3, 0x54, 0x9c, 0x6e, 0xa3, 0x7c, 0x2f, 0x26, 0x29, 0x8b, 0x6d, 0xb1, + 0xf0, 0x7b, 0x81, 0x2a, 0x0b, 0xd9, 0xd3, 0xe2, 0xb4, 0x33, 0xe6, 0xd5, 0x8c, 0x82, 0xb4, 0x3b, + 0xc5, 0x2e, 0xc1, 0xc8, 0x57, 0x03, 0x36, 0x27, 0x24, 0x71, 0xf2, 0x6c, 0x0c, 0x14, 0x5a, 0x67, + 0xcc, 0xe7, 0x37, 0x3c, 0x21, 0xd8, 0xab, 0x8d, 0x0f, 0x8f, 0x4a, 0x91, 0xff, 0x78, 0x2f, 0xe5, + 0x45, 0x73, 0x29, 0xf8, 0x49, 0xf7, 0xe2, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xff, 0x09, + 0x1d, 0xf8, 0x13, 0x00, 0x00, } diff --git a/pkg/proto/organization/organization.proto b/pkg/proto/organization/organization.proto index 8c3bd5026..ef7aedbf7 100644 --- a/pkg/proto/organization/organization.proto +++ b/pkg/proto/organization/organization.proto @@ -67,6 +67,7 @@ message CreateOrganizationUserReq{ server_api_params.OrganizationUser organizationUser = 1; string operationID = 2; string opUserID = 3; + bool IsRegister = 4; } diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go index 37334a8b2..7affbc050 100644 --- a/pkg/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -37,7 +37,7 @@ 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} + return fileDescriptor_relay_eb517eee82ca0aca, []int{0} } func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) @@ -79,17 +79,17 @@ func (m *OnlinePushMsgReq) GetPushToUserID() string { } 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:"-"` + Resp []*SingleMsgToUserPlatform `protobuf:"bytes,1,rep,name=resp" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } 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} + return fileDescriptor_relay_eb517eee82ca0aca, []int{1} } func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) @@ -109,14 +109,160 @@ func (m *OnlinePushMsgResp) XXX_DiscardUnknown() { var xxx_messageInfo_OnlinePushMsgResp proto.InternalMessageInfo -func (m *OnlinePushMsgResp) GetResp() []*SingleMsgToUser { +func (m *OnlinePushMsgResp) GetResp() []*SingleMsgToUserPlatform { if m != nil { return m.Resp } return nil } -type SingleMsgToUser struct { +type SingelMsgToUserResultList struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Resp []*SingleMsgToUserPlatform `protobuf:"bytes,2,rep,name=resp" json:"resp,omitempty"` + OnlinePush bool `protobuf:"varint,3,opt,name=onlinePush" json:"onlinePush,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SingelMsgToUserResultList) Reset() { *m = SingelMsgToUserResultList{} } +func (m *SingelMsgToUserResultList) String() string { return proto.CompactTextString(m) } +func (*SingelMsgToUserResultList) ProtoMessage() {} +func (*SingelMsgToUserResultList) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{2} +} +func (m *SingelMsgToUserResultList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SingelMsgToUserResultList.Unmarshal(m, b) +} +func (m *SingelMsgToUserResultList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SingelMsgToUserResultList.Marshal(b, m, deterministic) +} +func (dst *SingelMsgToUserResultList) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingelMsgToUserResultList.Merge(dst, src) +} +func (m *SingelMsgToUserResultList) XXX_Size() int { + return xxx_messageInfo_SingelMsgToUserResultList.Size(m) +} +func (m *SingelMsgToUserResultList) XXX_DiscardUnknown() { + xxx_messageInfo_SingelMsgToUserResultList.DiscardUnknown(m) +} + +var xxx_messageInfo_SingelMsgToUserResultList proto.InternalMessageInfo + +func (m *SingelMsgToUserResultList) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SingelMsgToUserResultList) GetResp() []*SingleMsgToUserPlatform { + if m != nil { + return m.Resp + } + return nil +} + +func (m *SingelMsgToUserResultList) GetOnlinePush() bool { + if m != nil { + return m.OnlinePush + } + return false +} + +type OnlineBatchPushOneMsgReq 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"` + PushToUserIDList []string `protobuf:"bytes,3,rep,name=pushToUserIDList" json:"pushToUserIDList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgReq{} } +func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) } +func (*OnlineBatchPushOneMsgReq) ProtoMessage() {} +func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{3} +} +func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b) +} +func (m *OnlineBatchPushOneMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlineBatchPushOneMsgReq.Marshal(b, m, deterministic) +} +func (dst *OnlineBatchPushOneMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlineBatchPushOneMsgReq.Merge(dst, src) +} +func (m *OnlineBatchPushOneMsgReq) XXX_Size() int { + return xxx_messageInfo_OnlineBatchPushOneMsgReq.Size(m) +} +func (m *OnlineBatchPushOneMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_OnlineBatchPushOneMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_OnlineBatchPushOneMsgReq proto.InternalMessageInfo + +func (m *OnlineBatchPushOneMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *OnlineBatchPushOneMsgReq) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *OnlineBatchPushOneMsgReq) GetPushToUserIDList() []string { + if m != nil { + return m.PushToUserIDList + } + return nil +} + +type OnlineBatchPushOneMsgResp struct { + SinglePushResult []*SingelMsgToUserResultList `protobuf:"bytes,1,rep,name=singlePushResult" json:"singlePushResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OnlineBatchPushOneMsgResp) Reset() { *m = OnlineBatchPushOneMsgResp{} } +func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) } +func (*OnlineBatchPushOneMsgResp) ProtoMessage() {} +func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{4} +} +func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b) +} +func (m *OnlineBatchPushOneMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlineBatchPushOneMsgResp.Marshal(b, m, deterministic) +} +func (dst *OnlineBatchPushOneMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlineBatchPushOneMsgResp.Merge(dst, src) +} +func (m *OnlineBatchPushOneMsgResp) XXX_Size() int { + return xxx_messageInfo_OnlineBatchPushOneMsgResp.Size(m) +} +func (m *OnlineBatchPushOneMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_OnlineBatchPushOneMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_OnlineBatchPushOneMsgResp proto.InternalMessageInfo + +func (m *OnlineBatchPushOneMsgResp) GetSinglePushResult() []*SingelMsgToUserResultList { + if m != nil { + return m.SinglePushResult + } + return nil +} + +type SingleMsgToUserPlatform struct { ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode" json:"ResultCode,omitempty"` RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` RecvPlatFormID int32 `protobuf:"varint,3,opt,name=RecvPlatFormID" json:"RecvPlatFormID,omitempty"` @@ -125,45 +271,45 @@ type SingleMsgToUser struct { XXX_sizecache int32 `json:"-"` } -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_34094e5333f6005a, []int{2} +func (m *SingleMsgToUserPlatform) Reset() { *m = SingleMsgToUserPlatform{} } +func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) } +func (*SingleMsgToUserPlatform) ProtoMessage() {} +func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{5} } -func (m *SingleMsgToUser) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SingleMsgToUser.Unmarshal(m, b) +func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b) } -func (m *SingleMsgToUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SingleMsgToUser.Marshal(b, m, deterministic) +func (m *SingleMsgToUserPlatform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SingleMsgToUserPlatform.Marshal(b, m, deterministic) } -func (dst *SingleMsgToUser) XXX_Merge(src proto.Message) { - xxx_messageInfo_SingleMsgToUser.Merge(dst, src) +func (dst *SingleMsgToUserPlatform) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleMsgToUserPlatform.Merge(dst, src) } -func (m *SingleMsgToUser) XXX_Size() int { - return xxx_messageInfo_SingleMsgToUser.Size(m) +func (m *SingleMsgToUserPlatform) XXX_Size() int { + return xxx_messageInfo_SingleMsgToUserPlatform.Size(m) } -func (m *SingleMsgToUser) XXX_DiscardUnknown() { - xxx_messageInfo_SingleMsgToUser.DiscardUnknown(m) +func (m *SingleMsgToUserPlatform) XXX_DiscardUnknown() { + xxx_messageInfo_SingleMsgToUserPlatform.DiscardUnknown(m) } -var xxx_messageInfo_SingleMsgToUser proto.InternalMessageInfo +var xxx_messageInfo_SingleMsgToUserPlatform proto.InternalMessageInfo -func (m *SingleMsgToUser) GetResultCode() int64 { +func (m *SingleMsgToUserPlatform) GetResultCode() int64 { if m != nil { return m.ResultCode } return 0 } -func (m *SingleMsgToUser) GetRecvID() string { +func (m *SingleMsgToUserPlatform) GetRecvID() string { if m != nil { return m.RecvID } return "" } -func (m *SingleMsgToUser) GetRecvPlatFormID() int32 { +func (m *SingleMsgToUserPlatform) GetRecvPlatFormID() int32 { if m != nil { return m.RecvPlatFormID } @@ -183,7 +329,7 @@ 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} + return fileDescriptor_relay_eb517eee82ca0aca, []int{6} } func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) @@ -238,7 +384,7 @@ func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusRe func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp) ProtoMessage() {} func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_34094e5333f6005a, []int{4} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7} } func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) @@ -300,7 +446,7 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() { 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} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7, 0} } func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) @@ -347,7 +493,7 @@ func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersO 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} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7, 1} } func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) @@ -403,7 +549,7 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() { 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} + return fileDescriptor_relay_eb517eee82ca0aca, []int{7, 2} } func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) @@ -444,15 +590,104 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) GetDetailPlatformStatus() []*Ge return nil } +type KickUserOfflineReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + PlatformID int32 `protobuf:"varint,2,opt,name=platformID" json:"platformID,omitempty"` + KickUserIDList []string `protobuf:"bytes,3,rep,name=kickUserIDList" json:"kickUserIDList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KickUserOfflineReq) Reset() { *m = KickUserOfflineReq{} } +func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) } +func (*KickUserOfflineReq) ProtoMessage() {} +func (*KickUserOfflineReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{8} +} +func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b) +} +func (m *KickUserOfflineReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KickUserOfflineReq.Marshal(b, m, deterministic) +} +func (dst *KickUserOfflineReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_KickUserOfflineReq.Merge(dst, src) +} +func (m *KickUserOfflineReq) XXX_Size() int { + return xxx_messageInfo_KickUserOfflineReq.Size(m) +} +func (m *KickUserOfflineReq) XXX_DiscardUnknown() { + xxx_messageInfo_KickUserOfflineReq.DiscardUnknown(m) +} + +var xxx_messageInfo_KickUserOfflineReq proto.InternalMessageInfo + +func (m *KickUserOfflineReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *KickUserOfflineReq) GetPlatformID() int32 { + if m != nil { + return m.PlatformID + } + return 0 +} + +func (m *KickUserOfflineReq) GetKickUserIDList() []string { + if m != nil { + return m.KickUserIDList + } + return nil +} + +type KickUserOfflineResp struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KickUserOfflineResp) Reset() { *m = KickUserOfflineResp{} } +func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) } +func (*KickUserOfflineResp) ProtoMessage() {} +func (*KickUserOfflineResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_eb517eee82ca0aca, []int{9} +} +func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b) +} +func (m *KickUserOfflineResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KickUserOfflineResp.Marshal(b, m, deterministic) +} +func (dst *KickUserOfflineResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_KickUserOfflineResp.Merge(dst, src) +} +func (m *KickUserOfflineResp) XXX_Size() int { + return xxx_messageInfo_KickUserOfflineResp.Size(m) +} +func (m *KickUserOfflineResp) XXX_DiscardUnknown() { + xxx_messageInfo_KickUserOfflineResp.DiscardUnknown(m) +} + +var xxx_messageInfo_KickUserOfflineResp proto.InternalMessageInfo + func init() { proto.RegisterType((*OnlinePushMsgReq)(nil), "relay.OnlinePushMsgReq") proto.RegisterType((*OnlinePushMsgResp)(nil), "relay.OnlinePushMsgResp") - proto.RegisterType((*SingleMsgToUser)(nil), "relay.SingleMsgToUser") + proto.RegisterType((*SingelMsgToUserResultList)(nil), "relay.SingelMsgToUserResultList") + proto.RegisterType((*OnlineBatchPushOneMsgReq)(nil), "relay.OnlineBatchPushOneMsgReq") + proto.RegisterType((*OnlineBatchPushOneMsgResp)(nil), "relay.OnlineBatchPushOneMsgResp") + proto.RegisterType((*SingleMsgToUserPlatform)(nil), "relay.SingleMsgToUserPlatform") 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") + proto.RegisterType((*KickUserOfflineReq)(nil), "relay.KickUserOfflineReq") + proto.RegisterType((*KickUserOfflineResp)(nil), "relay.KickUserOfflineResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -468,6 +703,9 @@ const _ = grpc.SupportPackageIsVersion4 type OnlineMessageRelayServiceClient interface { OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) + OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) + SuperGroupOnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) + KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error) } type onlineMessageRelayServiceClient struct { @@ -496,11 +734,41 @@ func (c *onlineMessageRelayServiceClient) GetUsersOnlineStatus(ctx context.Conte return out, nil } +func (c *onlineMessageRelayServiceClient) OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) { + out := new(OnlineBatchPushOneMsgResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/OnlineBatchPushOneMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *onlineMessageRelayServiceClient) SuperGroupOnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) { + out := new(OnlineBatchPushOneMsgResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/SuperGroupOnlineBatchPushOneMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *onlineMessageRelayServiceClient) KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error) { + out := new(KickUserOfflineResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/KickUserOffline", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for OnlineMessageRelayService service type OnlineMessageRelayServiceServer interface { OnlinePushMsg(context.Context, *OnlinePushMsgReq) (*OnlinePushMsgResp, error) GetUsersOnlineStatus(context.Context, *GetUsersOnlineStatusReq) (*GetUsersOnlineStatusResp, error) + OnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error) + SuperGroupOnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error) + KickUserOffline(context.Context, *KickUserOfflineReq) (*KickUserOfflineResp, error) } func RegisterOnlineMessageRelayServiceServer(s *grpc.Server, srv OnlineMessageRelayServiceServer) { @@ -543,6 +811,60 @@ func _OnlineMessageRelayService_GetUsersOnlineStatus_Handler(srv interface{}, ct return interceptor(ctx, in, info, handler) } +func _OnlineMessageRelayService_OnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnlineBatchPushOneMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).OnlineBatchPushOneMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/OnlineBatchPushOneMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).OnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OnlineMessageRelayService_SuperGroupOnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnlineBatchPushOneMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).SuperGroupOnlineBatchPushOneMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/SuperGroupOnlineBatchPushOneMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).SuperGroupOnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OnlineMessageRelayService_KickUserOffline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KickUserOfflineReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).KickUserOffline(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/KickUserOffline", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).KickUserOffline(ctx, req.(*KickUserOfflineReq)) + } + return interceptor(ctx, in, info, handler) +} + var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ ServiceName: "relay.OnlineMessageRelayService", HandlerType: (*OnlineMessageRelayServiceServer)(nil), @@ -555,48 +877,72 @@ var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ MethodName: "GetUsersOnlineStatus", Handler: _OnlineMessageRelayService_GetUsersOnlineStatus_Handler, }, + { + MethodName: "OnlineBatchPushOneMsg", + Handler: _OnlineMessageRelayService_OnlineBatchPushOneMsg_Handler, + }, + { + MethodName: "SuperGroupOnlineBatchPushOneMsg", + Handler: _OnlineMessageRelayService_SuperGroupOnlineBatchPushOneMsg_Handler, + }, + { + MethodName: "KickUserOffline", + Handler: _OnlineMessageRelayService_KickUserOffline_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "relay/relay.proto", } -func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_34094e5333f6005a) } +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_eb517eee82ca0aca) } -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, 0xc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65, 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, +var fileDescriptor_relay_eb517eee82ca0aca = []byte{ + // 749 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x4e, 0xdb, 0x5a, + 0x10, 0x96, 0x31, 0xe1, 0x67, 0x80, 0x0b, 0x9c, 0x0b, 0x17, 0xe3, 0x45, 0xc8, 0xf5, 0xe2, 0x2a, + 0xba, 0x6a, 0x13, 0x29, 0xed, 0xae, 0x3b, 0x88, 0xa0, 0x51, 0x89, 0x82, 0x4e, 0x5a, 0xb5, 0x62, + 0x13, 0x99, 0xe4, 0x24, 0x58, 0x71, 0xe2, 0xc3, 0x19, 0x1b, 0xc4, 0xa6, 0xdb, 0xee, 0xfa, 0x08, + 0x5d, 0xf4, 0x25, 0xfa, 0x02, 0x7d, 0xb0, 0xea, 0xfc, 0xc4, 0xb5, 0xf3, 0x03, 0x65, 0xc1, 0x06, + 0x31, 0x73, 0xe6, 0xcc, 0xcc, 0xf7, 0x7d, 0x73, 0x26, 0x86, 0x5d, 0xc1, 0x42, 0xff, 0xbe, 0xaa, + 0xfe, 0x56, 0xb8, 0x88, 0xe2, 0x88, 0x14, 0x94, 0xe1, 0xfe, 0xdb, 0xe2, 0x6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 0x46, 0x33, 0x1e, 0xef, 0x9b, 0x05, 0x8e, 0xc6, 0x74, 0xec, 0xc7, 0xdd, 0x6b, + 0xe9, 0x6b, 0x8d, 0xd9, 0x33, 0x73, 0xfd, 0x3f, 0xec, 0x64, 0x79, 0x95, 0xa0, 0x1d, 0xbb, 0x64, + 0x97, 0xd7, 0xe9, 0x8c, 0xdf, 0x0b, 0xe0, 0x70, 0x41, 0x7f, 0xc8, 0xc9, 0x39, 0xec, 0xa0, 0x82, + 0x2f, 0xfd, 0x9a, 0x41, 0xa3, 0x43, 0x29, 0xc3, 0xce, 0x5c, 0x96, 0xe9, 0xcc, 0x4d, 0xef, 0x1e, + 0x0e, 0x16, 0x90, 0x29, 0x69, 0xd4, 0x41, 0x27, 0x51, 0x8f, 0x29, 0x22, 0x6c, 0x9a, 0xf1, 0x48, + 0xc9, 0x28, 0xeb, 0xde, 0x36, 0xea, 0x8a, 0x86, 0x75, 0x6a, 0x2c, 0xf2, 0x1f, 0xfc, 0x25, 0xff, + 0x93, 0x79, 0x4e, 0x23, 0x31, 0x32, 0x73, 0x55, 0xa0, 0x53, 0x5e, 0xef, 0x0e, 0x0e, 0xce, 0x58, + 0x2c, 0x4b, 0xa2, 0x46, 0xdb, 0x8e, 0xfd, 0x38, 0x41, 0x29, 0x42, 0x11, 0x20, 0xf9, 0x4d, 0x93, + 0xa5, 0x68, 0xca, 0x78, 0xa4, 0x48, 0x51, 0x46, 0x24, 0x5d, 0x3f, 0xeb, 0x22, 0x2e, 0xac, 0x45, + 0x3c, 0x37, 0xd6, 0xa9, 0xed, 0xfd, 0x58, 0x06, 0x67, 0x7e, 0x65, 0xe4, 0xc4, 0x81, 0x55, 0x26, + 0x44, 0x0a, 0xb9, 0x40, 0x27, 0xa6, 0xc4, 0xcb, 0x84, 0x68, 0xe2, 0x60, 0x82, 0x57, 0x5b, 0xa4, + 0x0d, 0x5b, 0x98, 0x74, 0xbb, 0x0c, 0xd1, 0xa8, 0x61, 0x2b, 0x35, 0x5e, 0x1a, 0x35, 0x16, 0x55, + 0xaa, 0xb4, 0xb3, 0x97, 0x68, 0x3e, 0x07, 0xb9, 0x80, 0xcd, 0xbe, 0x1f, 0x84, 0xac, 0x67, 0x72, + 0x2e, 0xab, 0x9c, 0x2f, 0x1e, 0xcb, 0x79, 0xaa, 0xee, 0xd4, 0x59, 0xec, 0x07, 0x21, 0xcd, 0x65, + 0x70, 0x4f, 0x60, 0xcb, 0x54, 0xd4, 0xc7, 0x92, 0x22, 0x6e, 0xb4, 0x36, 0x63, 0x9e, 0xda, 0x12, + 0x2b, 0xaa, 0xac, 0x13, 0xac, 0xda, 0x72, 0x3f, 0xc1, 0x66, 0xb6, 0x44, 0xe6, 0xd9, 0xda, 0xb9, + 0x67, 0xfb, 0x64, 0x16, 0xdd, 0xef, 0x56, 0xda, 0x9f, 0xa1, 0x60, 0xd1, 0x4a, 0x58, 0xd0, 0x1b, + 0xf1, 0x61, 0xaf, 0xa7, 0xba, 0x9a, 0x4c, 0xb0, 0xe6, 0xe5, 0x89, 0x72, 0x18, 0xee, 0xe6, 0xa6, + 0xf2, 0x3e, 0x03, 0x79, 0x17, 0x74, 0x87, 0x32, 0x41, 0xab, 0xdf, 0x97, 0x09, 0xcc, 0xca, 0x88, + 0x66, 0x57, 0x46, 0x76, 0x1a, 0x8b, 0x00, 0x13, 0x6a, 0xcd, 0xb8, 0x16, 0x68, 0xc6, 0x23, 0x9f, + 0xcc, 0xd0, 0xe4, 0xcd, 0xad, 0x86, 0x29, 0xaf, 0xb7, 0x0f, 0x7f, 0xcf, 0xd4, 0x47, 0x5e, 0xfb, + 0x69, 0x4f, 0x16, 0x46, 0x93, 0x21, 0xfa, 0x03, 0x46, 0x25, 0xd4, 0x36, 0x13, 0xb7, 0x41, 0x97, + 0x91, 0x63, 0xd8, 0xca, 0x6d, 0x70, 0x72, 0x60, 0xa8, 0x98, 0xfe, 0x9d, 0x71, 0x9d, 0xf9, 0x07, + 0xc8, 0xc9, 0x47, 0xd8, 0x9b, 0x47, 0x1c, 0x29, 0x3e, 0xc8, 0xea, 0x8d, 0x7b, 0xf4, 0x08, 0xeb, + 0xe4, 0x12, 0xf6, 0xe7, 0xae, 0x3a, 0x72, 0x94, 0xeb, 0x65, 0x76, 0x51, 0xbb, 0xa5, 0x87, 0x03, + 0x90, 0x93, 0x1e, 0x1c, 0xb5, 0x13, 0xce, 0xc4, 0x99, 0x88, 0x12, 0xfe, 0x6c, 0x55, 0xde, 0xc2, + 0xf6, 0x94, 0x26, 0xe4, 0xd0, 0x5c, 0x9a, 0x9d, 0x15, 0xd7, 0x5d, 0x74, 0x84, 0xfc, 0x78, 0xf7, + 0x72, 0xbb, 0xa2, 0x3f, 0x1b, 0xde, 0xf0, 0x2b, 0x25, 0xe1, 0xd5, 0x8a, 0xfa, 0x2a, 0x78, 0xf5, + 0x2b, 0x00, 0x00, 0xff, 0xff, 0x01, 0x6a, 0x94, 0x1f, 0x54, 0x08, 0x00, 0x00, } diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index d8c5f1b7e..0203aa7ad 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -9,8 +9,23 @@ message OnlinePushMsgReq { string pushToUserID = 3; } message OnlinePushMsgResp{ -repeated SingleMsgToUser resp = 1; -}//message SendMsgByWSReq{ +repeated SingleMsgToUserPlatform resp = 1; +} +message SingelMsgToUserResultList{ + string userID =1; + repeated SingleMsgToUserPlatform resp = 2; + bool onlinePush = 3; + +} +message OnlineBatchPushOneMsgReq{ + string OperationID = 1; + server_api_params.MsgData msgData = 2; + repeated string pushToUserIDList = 3; +} +message OnlineBatchPushOneMsgResp{ + repeated SingelMsgToUserResultList singlePushResult= 1; +} +//message SendMsgByWSReq{ // string SendID = 1; // string RecvID = 2; // string Content = 3; @@ -22,7 +37,7 @@ repeated SingleMsgToUser resp = 1; // int64 PlatformID = 9; //} -message SingleMsgToUser{ +message SingleMsgToUserPlatform{ int64 ResultCode = 1; string RecvID = 2; int32 RecvPlatFormID = 3; @@ -52,10 +67,21 @@ message GetUsersOnlineStatusResp{ repeated SuccessDetail detailPlatformStatus = 3; } +} +message KickUserOfflineReq{ + string operationID = 1; +int32 platformID = 2; + repeated string kickUserIDList = 3; +} +message KickUserOfflineResp{ + } service OnlineMessageRelayService { rpc OnlinePushMsg(OnlinePushMsgReq) returns(OnlinePushMsgResp); rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq)returns(GetUsersOnlineStatusResp); + rpc OnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp); + rpc SuperGroupOnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp); + rpc KickUserOffline(KickUserOfflineReq) returns(KickUserOfflineResp); // rpc SendMsgByWS(SendMsgByWSReq) returns(MsgToUserResp); } diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go index f5ba92ee6..f508ee69b 100644 --- a/pkg/proto/sdk_ws/ws.pb.go +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -40,7 +40,7 @@ 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_d27672f8ab95a331, []int{0} + return fileDescriptor_ws_3940a0d922f4ad30, []int{0} } func (m *GroupInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfo.Unmarshal(m, b) @@ -165,7 +165,7 @@ 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_d27672f8ab95a331, []int{1} + return fileDescriptor_ws_3940a0d922f4ad30, []int{1} } func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) @@ -277,7 +277,7 @@ 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_d27672f8ab95a331, []int{2} + return fileDescriptor_ws_3940a0d922f4ad30, []int{2} } func (m *PublicUserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PublicUserInfo.Unmarshal(m, b) @@ -343,6 +343,7 @@ type UserInfo struct { 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"` + GlobalRecvMsgOpt int32 `protobuf:"varint,11,opt,name=globalRecvMsgOpt" json:"globalRecvMsgOpt,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -352,7 +353,7 @@ 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_d27672f8ab95a331, []int{3} + return fileDescriptor_ws_3940a0d922f4ad30, []int{3} } func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) @@ -442,6 +443,13 @@ func (m *UserInfo) GetAppMangerLevel() int32 { return 0 } +func (m *UserInfo) GetGlobalRecvMsgOpt() int32 { + if m != nil { + return m.GlobalRecvMsgOpt + } + 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"` @@ -459,7 +467,7 @@ 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_d27672f8ab95a331, []int{4} + return fileDescriptor_ws_3940a0d922f4ad30, []int{4} } func (m *FriendInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendInfo.Unmarshal(m, b) @@ -544,7 +552,7 @@ 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_d27672f8ab95a331, []int{5} + return fileDescriptor_ws_3940a0d922f4ad30, []int{5} } func (m *BlackInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackInfo.Unmarshal(m, b) @@ -625,7 +633,7 @@ 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_d27672f8ab95a331, []int{6} + return fileDescriptor_ws_3940a0d922f4ad30, []int{6} } func (m *GroupRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupRequest.Unmarshal(m, b) @@ -733,7 +741,7 @@ 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_d27672f8ab95a331, []int{7} + return fileDescriptor_ws_3940a0d922f4ad30, []int{7} } func (m *FriendRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendRequest.Unmarshal(m, b) @@ -878,7 +886,7 @@ func (m *Department) Reset() { *m = Department{} } func (m *Department) String() string { return proto.CompactTextString(m) } func (*Department) ProtoMessage() {} func (*Department) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{8} + return fileDescriptor_ws_3940a0d922f4ad30, []int{8} } func (m *Department) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Department.Unmarshal(m, b) @@ -989,7 +997,7 @@ func (m *OrganizationUser) Reset() { *m = OrganizationUser{} } func (m *OrganizationUser) String() string { return proto.CompactTextString(m) } func (*OrganizationUser) ProtoMessage() {} func (*OrganizationUser) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{9} + return fileDescriptor_ws_3940a0d922f4ad30, []int{9} } func (m *OrganizationUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrganizationUser.Unmarshal(m, b) @@ -1103,7 +1111,7 @@ func (m *DepartmentMember) Reset() { *m = DepartmentMember{} } func (m *DepartmentMember) String() string { return proto.CompactTextString(m) } func (*DepartmentMember) ProtoMessage() {} func (*DepartmentMember) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{10} + return fileDescriptor_ws_3940a0d922f4ad30, []int{10} } func (m *DepartmentMember) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DepartmentMember.Unmarshal(m, b) @@ -1184,7 +1192,7 @@ func (m *UserDepartmentMember) Reset() { *m = UserDepartmentMember{} } func (m *UserDepartmentMember) String() string { return proto.CompactTextString(m) } func (*UserDepartmentMember) ProtoMessage() {} func (*UserDepartmentMember) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{11} + return fileDescriptor_ws_3940a0d922f4ad30, []int{11} } func (m *UserDepartmentMember) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserDepartmentMember.Unmarshal(m, b) @@ -1230,7 +1238,7 @@ func (m *UserInDepartment) Reset() { *m = UserInDepartment{} } func (m *UserInDepartment) String() string { return proto.CompactTextString(m) } func (*UserInDepartment) ProtoMessage() {} func (*UserInDepartment) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{12} + return fileDescriptor_ws_3940a0d922f4ad30, []int{12} } func (m *UserInDepartment) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInDepartment.Unmarshal(m, b) @@ -1264,74 +1272,22 @@ func (m *UserInDepartment) GetDepartmentMemberList() []*DepartmentMember { return nil } -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_d27672f8ab95a331, []int{13} -} -func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) -} -func (m *PullMessageBySeqListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PullMessageBySeqListResp.Marshal(b, m, deterministic) -} -func (dst *PullMessageBySeqListResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_PullMessageBySeqListResp.Merge(dst, src) -} -func (m *PullMessageBySeqListResp) XXX_Size() int { - return xxx_messageInfo_PullMessageBySeqListResp.Size(m) -} -func (m *PullMessageBySeqListResp) XXX_DiscardUnknown() { - xxx_messageInfo_PullMessageBySeqListResp.DiscardUnknown(m) -} - -var xxx_messageInfo_PullMessageBySeqListResp proto.InternalMessageInfo - -func (m *PullMessageBySeqListResp) GetErrCode() int32 { - if m != nil { - return m.ErrCode - } - return 0 -} - -func (m *PullMessageBySeqListResp) GetErrMsg() string { - if m != nil { - return m.ErrMsg - } - return "" -} - -func (m *PullMessageBySeqListResp) GetList() []*MsgData { - if m != nil { - return m.List - } - return nil -} - +// /////////////////////////////////base end///////////////////////////////////// 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 []uint32 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + 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"` + GroupSeqList map[string]*SeqList `protobuf:"bytes,4,rep,name=groupSeqList" json:"groupSeqList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + 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_ws_d27672f8ab95a331, []int{14} + return fileDescriptor_ws_3940a0d922f4ad30, []int{13} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -1372,7 +1328,155 @@ func (m *PullMessageBySeqListReq) GetSeqList() []uint32 { return nil } +func (m *PullMessageBySeqListReq) GetGroupSeqList() map[string]*SeqList { + if m != nil { + return m.GroupSeqList + } + return nil +} + +type SeqList struct { + SeqList []uint32 `protobuf:"varint,1,rep,packed,name=seqList" json:"seqList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SeqList) Reset() { *m = SeqList{} } +func (m *SeqList) String() string { return proto.CompactTextString(m) } +func (*SeqList) ProtoMessage() {} +func (*SeqList) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_3940a0d922f4ad30, []int{14} +} +func (m *SeqList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SeqList.Unmarshal(m, b) +} +func (m *SeqList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SeqList.Marshal(b, m, deterministic) +} +func (dst *SeqList) XXX_Merge(src proto.Message) { + xxx_messageInfo_SeqList.Merge(dst, src) +} +func (m *SeqList) XXX_Size() int { + return xxx_messageInfo_SeqList.Size(m) +} +func (m *SeqList) XXX_DiscardUnknown() { + xxx_messageInfo_SeqList.DiscardUnknown(m) +} + +var xxx_messageInfo_SeqList proto.InternalMessageInfo + +func (m *SeqList) GetSeqList() []uint32 { + if m != nil { + return m.SeqList + } + return nil +} + +type MsgDataList struct { + MsgDataList []*MsgData `protobuf:"bytes,1,rep,name=msgDataList" json:"msgDataList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataList) Reset() { *m = MsgDataList{} } +func (m *MsgDataList) String() string { return proto.CompactTextString(m) } +func (*MsgDataList) ProtoMessage() {} +func (*MsgDataList) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_3940a0d922f4ad30, []int{15} +} +func (m *MsgDataList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataList.Unmarshal(m, b) +} +func (m *MsgDataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataList.Marshal(b, m, deterministic) +} +func (dst *MsgDataList) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataList.Merge(dst, src) +} +func (m *MsgDataList) XXX_Size() int { + return xxx_messageInfo_MsgDataList.Size(m) +} +func (m *MsgDataList) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataList.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataList proto.InternalMessageInfo + +func (m *MsgDataList) GetMsgDataList() []*MsgData { + if m != nil { + return m.MsgDataList + } + return nil +} + +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"` + GroupMsgDataList map[string]*MsgDataList `protobuf:"bytes,4,rep,name=groupMsgDataList" json:"groupMsgDataList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + 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_3940a0d922f4ad30, []int{16} +} +func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) +} +func (m *PullMessageBySeqListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PullMessageBySeqListResp.Marshal(b, m, deterministic) +} +func (dst *PullMessageBySeqListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_PullMessageBySeqListResp.Merge(dst, src) +} +func (m *PullMessageBySeqListResp) XXX_Size() int { + return xxx_messageInfo_PullMessageBySeqListResp.Size(m) +} +func (m *PullMessageBySeqListResp) XXX_DiscardUnknown() { + xxx_messageInfo_PullMessageBySeqListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_PullMessageBySeqListResp proto.InternalMessageInfo + +func (m *PullMessageBySeqListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *PullMessageBySeqListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *PullMessageBySeqListResp) GetList() []*MsgData { + if m != nil { + return m.List + } + return nil +} + +func (m *PullMessageBySeqListResp) GetGroupMsgDataList() map[string]*MsgDataList { + if m != nil { + return m.GroupMsgDataList + } + return nil +} + type GetMaxAndMinSeqReq struct { + GroupIDList []string `protobuf:"bytes,1,rep,name=groupIDList" json:"groupIDList,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1382,7 +1486,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_d27672f8ab95a331, []int{15} + return fileDescriptor_ws_3940a0d922f4ad30, []int{17} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -1402,7 +1506,28 @@ func (m *GetMaxAndMinSeqReq) XXX_DiscardUnknown() { var xxx_messageInfo_GetMaxAndMinSeqReq proto.InternalMessageInfo -type GetMaxAndMinSeqResp struct { +func (m *GetMaxAndMinSeqReq) GetGroupIDList() []string { + if m != nil { + return m.GroupIDList + } + return nil +} + +func (m *GetMaxAndMinSeqReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetMaxAndMinSeqReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type MaxAndMinSeq struct { 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:"-"` @@ -1410,11 +1535,60 @@ type GetMaxAndMinSeqResp struct { XXX_sizecache int32 `json:"-"` } +func (m *MaxAndMinSeq) Reset() { *m = MaxAndMinSeq{} } +func (m *MaxAndMinSeq) String() string { return proto.CompactTextString(m) } +func (*MaxAndMinSeq) ProtoMessage() {} +func (*MaxAndMinSeq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_3940a0d922f4ad30, []int{18} +} +func (m *MaxAndMinSeq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MaxAndMinSeq.Unmarshal(m, b) +} +func (m *MaxAndMinSeq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MaxAndMinSeq.Marshal(b, m, deterministic) +} +func (dst *MaxAndMinSeq) XXX_Merge(src proto.Message) { + xxx_messageInfo_MaxAndMinSeq.Merge(dst, src) +} +func (m *MaxAndMinSeq) XXX_Size() int { + return xxx_messageInfo_MaxAndMinSeq.Size(m) +} +func (m *MaxAndMinSeq) XXX_DiscardUnknown() { + xxx_messageInfo_MaxAndMinSeq.DiscardUnknown(m) +} + +var xxx_messageInfo_MaxAndMinSeq proto.InternalMessageInfo + +func (m *MaxAndMinSeq) GetMaxSeq() uint32 { + if m != nil { + return m.MaxSeq + } + return 0 +} + +func (m *MaxAndMinSeq) GetMinSeq() uint32 { + if m != nil { + return m.MinSeq + } + return 0 +} + +type GetMaxAndMinSeqResp struct { + MaxSeq uint32 `protobuf:"varint,1,opt,name=maxSeq" json:"maxSeq,omitempty"` + MinSeq uint32 `protobuf:"varint,2,opt,name=minSeq" json:"minSeq,omitempty"` + ErrCode int32 `protobuf:"varint,3,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,4,opt,name=errMsg" json:"errMsg,omitempty"` + GroupMaxAndMinSeq map[string]*MaxAndMinSeq `protobuf:"bytes,5,rep,name=groupMaxAndMinSeq" json:"groupMaxAndMinSeq,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + 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_d27672f8ab95a331, []int{16} + return fileDescriptor_ws_3940a0d922f4ad30, []int{19} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -1448,6 +1622,27 @@ func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { return 0 } +func (m *GetMaxAndMinSeqResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetMaxAndMinSeqResp) GetGroupMaxAndMinSeq() map[string]*MaxAndMinSeq { + if m != nil { + return m.GroupMaxAndMinSeq + } + return nil +} + 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"` @@ -1461,7 +1656,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_d27672f8ab95a331, []int{17} + return fileDescriptor_ws_3940a0d922f4ad30, []int{20} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -1522,6 +1717,7 @@ type MsgData struct { 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"` AtUserIDList []string `protobuf:"bytes,20,rep,name=atUserIDList" json:"atUserIDList,omitempty"` + MsgDataList []byte `protobuf:"bytes,21,opt,name=msgDataList,proto3" json:"msgDataList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1531,7 +1727,7 @@ 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_d27672f8ab95a331, []int{18} + return fileDescriptor_ws_3940a0d922f4ad30, []int{21} } func (m *MsgData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgData.Unmarshal(m, b) @@ -1684,6 +1880,13 @@ func (m *MsgData) GetAtUserIDList() []string { return nil } +func (m *MsgData) GetMsgDataList() []byte { + if m != nil { + return m.MsgDataList + } + 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"` @@ -1699,7 +1902,7 @@ 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_d27672f8ab95a331, []int{19} + return fileDescriptor_ws_3940a0d922f4ad30, []int{22} } func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) @@ -1767,7 +1970,7 @@ 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_d27672f8ab95a331, []int{20} + return fileDescriptor_ws_3940a0d922f4ad30, []int{23} } func (m *TipsComm) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TipsComm.Unmarshal(m, b) @@ -1824,7 +2027,7 @@ 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_d27672f8ab95a331, []int{21} + return fileDescriptor_ws_3940a0d922f4ad30, []int{24} } func (m *GroupCreatedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupCreatedTips.Unmarshal(m, b) @@ -1893,7 +2096,7 @@ 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_d27672f8ab95a331, []int{22} + return fileDescriptor_ws_3940a0d922f4ad30, []int{25} } func (m *GroupInfoSetTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfoSetTips.Unmarshal(m, b) @@ -1948,7 +2151,7 @@ func (m *JoinGroupApplicationTips) Reset() { *m = JoinGroupApplicationTi func (m *JoinGroupApplicationTips) String() string { return proto.CompactTextString(m) } func (*JoinGroupApplicationTips) ProtoMessage() {} func (*JoinGroupApplicationTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{23} + return fileDescriptor_ws_3940a0d922f4ad30, []int{26} } func (m *JoinGroupApplicationTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupApplicationTips.Unmarshal(m, b) @@ -2004,7 +2207,7 @@ 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_d27672f8ab95a331, []int{24} + return fileDescriptor_ws_3940a0d922f4ad30, []int{27} } func (m *MemberQuitTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberQuitTips.Unmarshal(m, b) @@ -2059,7 +2262,7 @@ func (m *GroupApplicationAcceptedTips) Reset() { *m = GroupApplicationAc func (m *GroupApplicationAcceptedTips) String() string { return proto.CompactTextString(m) } func (*GroupApplicationAcceptedTips) ProtoMessage() {} func (*GroupApplicationAcceptedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{25} + return fileDescriptor_ws_3940a0d922f4ad30, []int{28} } func (m *GroupApplicationAcceptedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationAcceptedTips.Unmarshal(m, b) @@ -2114,7 +2317,7 @@ func (m *GroupApplicationRejectedTips) Reset() { *m = GroupApplicationRe func (m *GroupApplicationRejectedTips) String() string { return proto.CompactTextString(m) } func (*GroupApplicationRejectedTips) ProtoMessage() {} func (*GroupApplicationRejectedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{26} + return fileDescriptor_ws_3940a0d922f4ad30, []int{29} } func (m *GroupApplicationRejectedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationRejectedTips.Unmarshal(m, b) @@ -2170,7 +2373,7 @@ func (m *GroupOwnerTransferredTips) Reset() { *m = GroupOwnerTransferred func (m *GroupOwnerTransferredTips) String() string { return proto.CompactTextString(m) } func (*GroupOwnerTransferredTips) ProtoMessage() {} func (*GroupOwnerTransferredTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{27} + return fileDescriptor_ws_3940a0d922f4ad30, []int{30} } func (m *GroupOwnerTransferredTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupOwnerTransferredTips.Unmarshal(m, b) @@ -2233,7 +2436,7 @@ 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_d27672f8ab95a331, []int{28} + return fileDescriptor_ws_3940a0d922f4ad30, []int{31} } func (m *MemberKickedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberKickedTips.Unmarshal(m, b) @@ -2296,7 +2499,7 @@ 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_d27672f8ab95a331, []int{29} + return fileDescriptor_ws_3940a0d922f4ad30, []int{32} } func (m *MemberInvitedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberInvitedTips.Unmarshal(m, b) @@ -2358,7 +2561,7 @@ 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_d27672f8ab95a331, []int{30} + return fileDescriptor_ws_3940a0d922f4ad30, []int{33} } func (m *MemberEnterTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MemberEnterTips.Unmarshal(m, b) @@ -2412,7 +2615,7 @@ func (m *GroupDismissedTips) Reset() { *m = GroupDismissedTips{} } func (m *GroupDismissedTips) String() string { return proto.CompactTextString(m) } func (*GroupDismissedTips) ProtoMessage() {} func (*GroupDismissedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{31} + return fileDescriptor_ws_3940a0d922f4ad30, []int{34} } func (m *GroupDismissedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupDismissedTips.Unmarshal(m, b) @@ -2468,7 +2671,7 @@ func (m *GroupMemberMutedTips) Reset() { *m = GroupMemberMutedTips{} } func (m *GroupMemberMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberMutedTips) ProtoMessage() {} func (*GroupMemberMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{32} + return fileDescriptor_ws_3940a0d922f4ad30, []int{35} } func (m *GroupMemberMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberMutedTips.Unmarshal(m, b) @@ -2537,7 +2740,7 @@ func (m *GroupMemberCancelMutedTips) Reset() { *m = GroupMemberCancelMut func (m *GroupMemberCancelMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberCancelMutedTips) ProtoMessage() {} func (*GroupMemberCancelMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{33} + return fileDescriptor_ws_3940a0d922f4ad30, []int{36} } func (m *GroupMemberCancelMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberCancelMutedTips.Unmarshal(m, b) @@ -2598,7 +2801,7 @@ func (m *GroupMutedTips) Reset() { *m = GroupMutedTips{} } func (m *GroupMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupMutedTips) ProtoMessage() {} func (*GroupMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{34} + return fileDescriptor_ws_3940a0d922f4ad30, []int{37} } func (m *GroupMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMutedTips.Unmarshal(m, b) @@ -2652,7 +2855,7 @@ func (m *GroupCancelMutedTips) Reset() { *m = GroupCancelMutedTips{} } func (m *GroupCancelMutedTips) String() string { return proto.CompactTextString(m) } func (*GroupCancelMutedTips) ProtoMessage() {} func (*GroupCancelMutedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{35} + return fileDescriptor_ws_3940a0d922f4ad30, []int{38} } func (m *GroupCancelMutedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupCancelMutedTips.Unmarshal(m, b) @@ -2707,7 +2910,7 @@ func (m *GroupMemberInfoSetTips) Reset() { *m = GroupMemberInfoSetTips{} func (m *GroupMemberInfoSetTips) String() string { return proto.CompactTextString(m) } func (*GroupMemberInfoSetTips) ProtoMessage() {} func (*GroupMemberInfoSetTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{36} + return fileDescriptor_ws_3940a0d922f4ad30, []int{39} } func (m *GroupMemberInfoSetTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberInfoSetTips.Unmarshal(m, b) @@ -2767,7 +2970,7 @@ func (m *OrganizationChangedTips) Reset() { *m = OrganizationChangedTips func (m *OrganizationChangedTips) String() string { return proto.CompactTextString(m) } func (*OrganizationChangedTips) ProtoMessage() {} func (*OrganizationChangedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{37} + return fileDescriptor_ws_3940a0d922f4ad30, []int{40} } func (m *OrganizationChangedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrganizationChangedTips.Unmarshal(m, b) @@ -2814,7 +3017,7 @@ 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_d27672f8ab95a331, []int{38} + return fileDescriptor_ws_3940a0d922f4ad30, []int{41} } func (m *FriendApplication) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplication.Unmarshal(m, b) @@ -2867,7 +3070,7 @@ 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_d27672f8ab95a331, []int{39} + return fileDescriptor_ws_3940a0d922f4ad30, []int{42} } func (m *FromToUserID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FromToUserID.Unmarshal(m, b) @@ -2913,7 +3116,7 @@ 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_d27672f8ab95a331, []int{40} + return fileDescriptor_ws_3940a0d922f4ad30, []int{43} } func (m *FriendApplicationTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationTips.Unmarshal(m, b) @@ -2953,7 +3156,7 @@ func (m *FriendApplicationApprovedTips) Reset() { *m = FriendApplication func (m *FriendApplicationApprovedTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationApprovedTips) ProtoMessage() {} func (*FriendApplicationApprovedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{41} + return fileDescriptor_ws_3940a0d922f4ad30, []int{44} } func (m *FriendApplicationApprovedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationApprovedTips.Unmarshal(m, b) @@ -3000,7 +3203,7 @@ func (m *FriendApplicationRejectedTips) Reset() { *m = FriendApplication func (m *FriendApplicationRejectedTips) String() string { return proto.CompactTextString(m) } func (*FriendApplicationRejectedTips) ProtoMessage() {} func (*FriendApplicationRejectedTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{42} + return fileDescriptor_ws_3940a0d922f4ad30, []int{45} } func (m *FriendApplicationRejectedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendApplicationRejectedTips.Unmarshal(m, b) @@ -3048,7 +3251,7 @@ 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_d27672f8ab95a331, []int{43} + return fileDescriptor_ws_3940a0d922f4ad30, []int{46} } func (m *FriendAddedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendAddedTips.Unmarshal(m, b) @@ -3101,7 +3304,7 @@ 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_d27672f8ab95a331, []int{44} + return fileDescriptor_ws_3940a0d922f4ad30, []int{47} } func (m *FriendDeletedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendDeletedTips.Unmarshal(m, b) @@ -3139,7 +3342,7 @@ 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_d27672f8ab95a331, []int{45} + return fileDescriptor_ws_3940a0d922f4ad30, []int{48} } func (m *BlackAddedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackAddedTips.Unmarshal(m, b) @@ -3177,7 +3380,7 @@ 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_d27672f8ab95a331, []int{46} + return fileDescriptor_ws_3940a0d922f4ad30, []int{49} } func (m *BlackDeletedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlackDeletedTips.Unmarshal(m, b) @@ -3215,7 +3418,7 @@ 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_d27672f8ab95a331, []int{47} + return fileDescriptor_ws_3940a0d922f4ad30, []int{50} } func (m *FriendInfoChangedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FriendInfoChangedTips.Unmarshal(m, b) @@ -3254,7 +3457,7 @@ 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_d27672f8ab95a331, []int{48} + return fileDescriptor_ws_3940a0d922f4ad30, []int{51} } func (m *UserInfoUpdatedTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfoUpdatedTips.Unmarshal(m, b) @@ -3293,7 +3496,7 @@ 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_d27672f8ab95a331, []int{49} + return fileDescriptor_ws_3940a0d922f4ad30, []int{52} } func (m *ConversationUpdateTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConversationUpdateTips.Unmarshal(m, b) @@ -3333,7 +3536,7 @@ func (m *ConversationSetPrivateTips) Reset() { *m = ConversationSetPriva func (m *ConversationSetPrivateTips) String() string { return proto.CompactTextString(m) } func (*ConversationSetPrivateTips) ProtoMessage() {} func (*ConversationSetPrivateTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{50} + return fileDescriptor_ws_3940a0d922f4ad30, []int{53} } func (m *ConversationSetPrivateTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ConversationSetPrivateTips.Unmarshal(m, b) @@ -3388,7 +3591,7 @@ func (m *DeleteMessageTips) Reset() { *m = DeleteMessageTips{} } func (m *DeleteMessageTips) String() string { return proto.CompactTextString(m) } func (*DeleteMessageTips) ProtoMessage() {} func (*DeleteMessageTips) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{51} + return fileDescriptor_ws_3940a0d922f4ad30, []int{54} } func (m *DeleteMessageTips) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteMessageTips.Unmarshal(m, b) @@ -3442,7 +3645,7 @@ 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_d27672f8ab95a331, []int{52} + return fileDescriptor_ws_3940a0d922f4ad30, []int{55} } func (m *RequestPagination) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RequestPagination.Unmarshal(m, b) @@ -3488,7 +3691,7 @@ 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_d27672f8ab95a331, []int{53} + return fileDescriptor_ws_3940a0d922f4ad30, []int{56} } func (m *ResponsePagination) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResponsePagination.Unmarshal(m, b) @@ -3541,7 +3744,7 @@ func (m *SignalReq) Reset() { *m = SignalReq{} } func (m *SignalReq) String() string { return proto.CompactTextString(m) } func (*SignalReq) ProtoMessage() {} func (*SignalReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{54} + return fileDescriptor_ws_3940a0d922f4ad30, []int{57} } func (m *SignalReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalReq.Unmarshal(m, b) @@ -3808,7 +4011,7 @@ func (m *SignalResp) Reset() { *m = SignalResp{} } func (m *SignalResp) String() string { return proto.CompactTextString(m) } func (*SignalResp) ProtoMessage() {} func (*SignalResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{55} + return fileDescriptor_ws_3940a0d922f4ad30, []int{58} } func (m *SignalResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalResp.Unmarshal(m, b) @@ -4077,7 +4280,7 @@ func (m *InvitationInfo) Reset() { *m = InvitationInfo{} } func (m *InvitationInfo) String() string { return proto.CompactTextString(m) } func (*InvitationInfo) ProtoMessage() {} func (*InvitationInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{56} + return fileDescriptor_ws_3940a0d922f4ad30, []int{59} } func (m *InvitationInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InvitationInfo.Unmarshal(m, b) @@ -4180,7 +4383,7 @@ func (m *ParticipantMetaData) Reset() { *m = ParticipantMetaData{} } func (m *ParticipantMetaData) String() string { return proto.CompactTextString(m) } func (*ParticipantMetaData) ProtoMessage() {} func (*ParticipantMetaData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{57} + return fileDescriptor_ws_3940a0d922f4ad30, []int{60} } func (m *ParticipantMetaData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ParticipantMetaData.Unmarshal(m, b) @@ -4235,7 +4438,7 @@ func (m *SignalInviteReq) Reset() { *m = SignalInviteReq{} } func (m *SignalInviteReq) String() string { return proto.CompactTextString(m) } func (*SignalInviteReq) ProtoMessage() {} func (*SignalInviteReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{58} + return fileDescriptor_ws_3940a0d922f4ad30, []int{61} } func (m *SignalInviteReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteReq.Unmarshal(m, b) @@ -4296,7 +4499,7 @@ func (m *SignalInviteReply) Reset() { *m = SignalInviteReply{} } func (m *SignalInviteReply) String() string { return proto.CompactTextString(m) } func (*SignalInviteReply) ProtoMessage() {} func (*SignalInviteReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{59} + return fileDescriptor_ws_3940a0d922f4ad30, []int{62} } func (m *SignalInviteReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteReply.Unmarshal(m, b) @@ -4351,7 +4554,7 @@ func (m *SignalInviteInGroupReq) Reset() { *m = SignalInviteInGroupReq{} func (m *SignalInviteInGroupReq) String() string { return proto.CompactTextString(m) } func (*SignalInviteInGroupReq) ProtoMessage() {} func (*SignalInviteInGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{60} + return fileDescriptor_ws_3940a0d922f4ad30, []int{63} } func (m *SignalInviteInGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteInGroupReq.Unmarshal(m, b) @@ -4412,7 +4615,7 @@ func (m *SignalInviteInGroupReply) Reset() { *m = SignalInviteInGroupRep func (m *SignalInviteInGroupReply) String() string { return proto.CompactTextString(m) } func (*SignalInviteInGroupReply) ProtoMessage() {} func (*SignalInviteInGroupReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{61} + return fileDescriptor_ws_3940a0d922f4ad30, []int{64} } func (m *SignalInviteInGroupReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalInviteInGroupReply.Unmarshal(m, b) @@ -4467,7 +4670,7 @@ func (m *SignalCancelReq) Reset() { *m = SignalCancelReq{} } func (m *SignalCancelReq) String() string { return proto.CompactTextString(m) } func (*SignalCancelReq) ProtoMessage() {} func (*SignalCancelReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{62} + return fileDescriptor_ws_3940a0d922f4ad30, []int{65} } func (m *SignalCancelReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalCancelReq.Unmarshal(m, b) @@ -4525,7 +4728,7 @@ func (m *SignalCancelReply) Reset() { *m = SignalCancelReply{} } func (m *SignalCancelReply) String() string { return proto.CompactTextString(m) } func (*SignalCancelReply) ProtoMessage() {} func (*SignalCancelReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{63} + return fileDescriptor_ws_3940a0d922f4ad30, []int{66} } func (m *SignalCancelReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalCancelReply.Unmarshal(m, b) @@ -4560,7 +4763,7 @@ func (m *SignalAcceptReq) Reset() { *m = SignalAcceptReq{} } func (m *SignalAcceptReq) String() string { return proto.CompactTextString(m) } func (*SignalAcceptReq) ProtoMessage() {} func (*SignalAcceptReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{64} + return fileDescriptor_ws_3940a0d922f4ad30, []int{67} } func (m *SignalAcceptReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalAcceptReq.Unmarshal(m, b) @@ -4628,7 +4831,7 @@ func (m *SignalAcceptReply) Reset() { *m = SignalAcceptReply{} } func (m *SignalAcceptReply) String() string { return proto.CompactTextString(m) } func (*SignalAcceptReply) ProtoMessage() {} func (*SignalAcceptReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{65} + return fileDescriptor_ws_3940a0d922f4ad30, []int{68} } func (m *SignalAcceptReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalAcceptReply.Unmarshal(m, b) @@ -4682,7 +4885,7 @@ func (m *SignalHungUpReq) Reset() { *m = SignalHungUpReq{} } func (m *SignalHungUpReq) String() string { return proto.CompactTextString(m) } func (*SignalHungUpReq) ProtoMessage() {} func (*SignalHungUpReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{66} + return fileDescriptor_ws_3940a0d922f4ad30, []int{69} } func (m *SignalHungUpReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalHungUpReq.Unmarshal(m, b) @@ -4733,7 +4936,7 @@ func (m *SignalHungUpReply) Reset() { *m = SignalHungUpReply{} } func (m *SignalHungUpReply) String() string { return proto.CompactTextString(m) } func (*SignalHungUpReply) ProtoMessage() {} func (*SignalHungUpReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{67} + return fileDescriptor_ws_3940a0d922f4ad30, []int{70} } func (m *SignalHungUpReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalHungUpReply.Unmarshal(m, b) @@ -4768,7 +4971,7 @@ func (m *SignalRejectReq) Reset() { *m = SignalRejectReq{} } func (m *SignalRejectReq) String() string { return proto.CompactTextString(m) } func (*SignalRejectReq) ProtoMessage() {} func (*SignalRejectReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{68} + return fileDescriptor_ws_3940a0d922f4ad30, []int{71} } func (m *SignalRejectReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalRejectReq.Unmarshal(m, b) @@ -4833,7 +5036,7 @@ func (m *SignalRejectReply) Reset() { *m = SignalRejectReply{} } func (m *SignalRejectReply) String() string { return proto.CompactTextString(m) } func (*SignalRejectReply) ProtoMessage() {} func (*SignalRejectReply) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{69} + return fileDescriptor_ws_3940a0d922f4ad30, []int{72} } func (m *SignalRejectReply) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SignalRejectReply.Unmarshal(m, b) @@ -4867,7 +5070,7 @@ func (m *DelMsgListReq) Reset() { *m = DelMsgListReq{} } func (m *DelMsgListReq) String() string { return proto.CompactTextString(m) } func (*DelMsgListReq) ProtoMessage() {} func (*DelMsgListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{70} + return fileDescriptor_ws_3940a0d922f4ad30, []int{73} } func (m *DelMsgListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelMsgListReq.Unmarshal(m, b) @@ -4927,7 +5130,7 @@ func (m *DelMsgListResp) Reset() { *m = DelMsgListResp{} } func (m *DelMsgListResp) String() string { return proto.CompactTextString(m) } func (*DelMsgListResp) ProtoMessage() {} func (*DelMsgListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_d27672f8ab95a331, []int{71} + return fileDescriptor_ws_3940a0d922f4ad30, []int{74} } func (m *DelMsgListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DelMsgListResp.Unmarshal(m, b) @@ -4975,10 +5178,16 @@ func init() { proto.RegisterType((*DepartmentMember)(nil), "server_api_params.DepartmentMember") proto.RegisterType((*UserDepartmentMember)(nil), "server_api_params.UserDepartmentMember") proto.RegisterType((*UserInDepartment)(nil), "server_api_params.UserInDepartment") - proto.RegisterType((*PullMessageBySeqListResp)(nil), "server_api_params.PullMessageBySeqListResp") proto.RegisterType((*PullMessageBySeqListReq)(nil), "server_api_params.PullMessageBySeqListReq") + proto.RegisterMapType((map[string]*SeqList)(nil), "server_api_params.PullMessageBySeqListReq.GroupSeqListEntry") + proto.RegisterType((*SeqList)(nil), "server_api_params.seqList") + proto.RegisterType((*MsgDataList)(nil), "server_api_params.MsgDataList") + proto.RegisterType((*PullMessageBySeqListResp)(nil), "server_api_params.PullMessageBySeqListResp") + proto.RegisterMapType((map[string]*MsgDataList)(nil), "server_api_params.PullMessageBySeqListResp.GroupMsgDataListEntry") proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "server_api_params.GetMaxAndMinSeqReq") + proto.RegisterType((*MaxAndMinSeq)(nil), "server_api_params.MaxAndMinSeq") proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "server_api_params.GetMaxAndMinSeqResp") + proto.RegisterMapType((map[string]*MaxAndMinSeq)(nil), "server_api_params.GetMaxAndMinSeqResp.GroupMaxAndMinSeqEntry") 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") @@ -5037,200 +5246,215 @@ func init() { proto.RegisterType((*DelMsgListResp)(nil), "server_api_params.DelMsgListResp") } -func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_d27672f8ab95a331) } +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_3940a0d922f4ad30) } -var fileDescriptor_ws_d27672f8ab95a331 = []byte{ - // 3071 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3b, 0xcd, 0x8b, 0x24, 0x59, - 0xf1, 0xbf, 0xcc, 0xea, 0xaa, 0xee, 0x8a, 0xea, 0xcf, 0x9c, 0xf9, 0xf5, 0x96, 0xed, 0xec, 0xd8, - 0xa6, 0xcd, 0xba, 0xae, 0x3a, 0x2b, 0xbb, 0x08, 0xba, 0xab, 0x23, 0xd3, 0xdd, 0xf3, 0xb5, 0x4e, - 0xf7, 0xf4, 0x66, 0xcd, 0xb8, 0xa2, 0xc2, 0x92, 0x5d, 0xf9, 0xba, 0x3a, 0xb7, 0xb3, 0xf2, 0x65, - 0xe5, 0x47, 0xcf, 0x8c, 0x08, 0x82, 0x82, 0x78, 0xf3, 0xa4, 0x07, 0x2f, 0x82, 0x17, 0x51, 0x96, - 0x45, 0x44, 0xc1, 0x83, 0x88, 0x07, 0xff, 0x01, 0xc1, 0x8b, 0x78, 0x11, 0xcf, 0x5e, 0x3d, 0x08, - 0x82, 0xf2, 0x22, 0x5e, 0x66, 0xbe, 0x97, 0x59, 0xd5, 0x5d, 0xd3, 0x34, 0x3b, 0xb3, 0x8c, 0xb7, - 0x8a, 0xc8, 0x17, 0xf1, 0xe2, 0x45, 0xc4, 0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 0x25, 0xa9, - 0x9b, 0x66, 0x49, 0x17, 0xd6, 0x8d, 0x17, 0x9b, 0x8e, 0x84, 0xac, 0x0d, 0x58, 0x40, 0xbe, 0x3c, - 0x97, 0xa6, 0x83, 0x24, 0x3a, 0xb2, 0xd0, 0xd8, 0xbd, 0x47, 0x11, 0xeb, 0xce, 0x23, 0x83, 0x12, - 0x61, 0xff, 0xc5, 0x84, 0x0b, 0xa8, 0xf7, 0x1d, 0x14, 0xe0, 0x46, 0x16, 0x04, 0xa7, 0x58, 0x60, - 0x15, 0x5a, 0x19, 0x4d, 0x47, 0xea, 0x97, 0x90, 0x98, 0x27, 0xe6, 0x01, 0xbb, 0xc3, 0x8e, 0x59, - 0x80, 0x8a, 0x6f, 0x3a, 0x25, 0xc2, 0x5a, 0x83, 0xb9, 0x77, 0xb8, 0x1f, 0xa2, 0x4e, 0x66, 0xf0, - 0x63, 0x01, 0x8b, 0x6f, 0xa1, 0xdf, 0x3f, 0x0a, 0x85, 0x49, 0x49, 0xdd, 0x05, 0xac, 0x5a, 0xa2, - 0xa5, 0x5b, 0xe2, 0x05, 0x58, 0x74, 0xa3, 0x68, 0xc7, 0x0d, 0x07, 0x2c, 0xa6, 0x49, 0x67, 0x91, - 0x6f, 0x05, 0x2b, 0xec, 0x21, 0x66, 0xea, 0xf1, 0x2c, 0xee, 0x33, 0x54, 0x77, 0xd3, 0x51, 0x30, - 0x82, 0x0f, 0x8f, 0x58, 0xac, 0xa8, 0x91, 0x34, 0x5f, 0xc1, 0x4a, 0xab, 0x40, 0x61, 0x15, 0x61, - 0xc7, 0x2c, 0x65, 0xd7, 0x43, 0x0f, 0x17, 0xd5, 0x91, 0x76, 0x2c, 0x51, 0xf6, 0xf7, 0x0c, 0x58, - 0xdc, 0xcb, 0xf6, 0x03, 0xbf, 0x8f, 0x2c, 0x84, 0x5a, 0x4b, 0xe5, 0x19, 0x9a, 0xf2, 0x54, 0x15, - 0x98, 0x93, 0x55, 0xd0, 0xd0, 0x55, 0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14, 0x8e, 0x4e, 0xa7, 0x2f, - 0x77, 0xe6, 0xf4, 0xe5, 0x36, 0x4f, 0x58, 0x6e, 0xab, 0x58, 0xee, 0x9f, 0x4c, 0x98, 0xc7, 0x40, - 0xe7, 0xb0, 0x51, 0xc6, 0x92, 0xd4, 0xfa, 0x22, 0xcc, 0x65, 0xb9, 0xa8, 0xc6, 0xb4, 0xa2, 0x16, - 0x24, 0xd6, 0x6b, 0x32, 0xac, 0x22, 0xbd, 0x89, 0xf4, 0x97, 0xc6, 0xd0, 0x17, 0x39, 0xcd, 0x29, - 0x87, 0x8b, 0x14, 0x74, 0xe8, 0x86, 0x5e, 0xc0, 0x1c, 0x96, 0x64, 0x41, 0x2a, 0xa3, 0xa5, 0x86, - 0x23, 0x4f, 0x1b, 0xed, 0x24, 0x03, 0x99, 0xa0, 0x24, 0x24, 0xb4, 0x43, 0xe3, 0xc4, 0x27, 0x5a, - 0x7a, 0x89, 0x10, 0x1b, 0x35, 0x66, 0x23, 0xb4, 0x10, 0x6d, 0xab, 0x1c, 0x2c, 0xe7, 0x94, 0x5a, - 0x23, 0x47, 0xd0, 0x70, 0xc2, 0xc4, 0x04, 0x23, 0x03, 0xca, 0x4c, 0x0a, 0xa6, 0x9a, 0x98, 0xec, - 0xbf, 0x36, 0x60, 0x81, 0xb6, 0x4f, 0xae, 0xd4, 0xcb, 0xc2, 0xcf, 0xf9, 0x50, 0xf3, 0x22, 0x05, - 0x23, 0xa4, 0x10, 0xd0, 0xae, 0x1e, 0x68, 0x34, 0x9c, 0x70, 0x45, 0x01, 0xdf, 0xd0, 0x02, 0x8e, - 0x8a, 0xca, 0x67, 0xb9, 0xa9, 0x06, 0x1e, 0x05, 0x23, 0x42, 0x59, 0xca, 0x35, 0xef, 0x28, 0x60, - 0x41, 0x9b, 0xf2, 0x62, 0x7e, 0xf2, 0x0f, 0x05, 0x23, 0xf4, 0x9b, 0xf2, 0x7c, 0x6e, 0x52, 0x52, - 0x89, 0x20, 0xce, 0x72,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 0x8b, 0x08, 0x29, 0x4b, 0x38, 0x82, 0xac, 0x2b, 0x30, 0x13, 0x08, 0xb1, 0x1a, 0x28, 0xd6, 0xda, - 0x18, 0xb1, 0x76, 0x92, 0xc1, 0xb6, 0x9b, 0xba, 0x0e, 0x8e, 0xb3, 0x87, 0xf0, 0xdc, 0xf8, 0xd9, - 0x47, 0x13, 0x1d, 0x58, 0x14, 0x59, 0x58, 0xa5, 0xf8, 0x3c, 0x2c, 0xfc, 0x57, 0x45, 0x09, 0xb1, - 0x13, 0xe2, 0x83, 0x72, 0x2c, 0x38, 0x39, 0x68, 0x5f, 0x04, 0xeb, 0x26, 0x4b, 0x77, 0xdc, 0x87, - 0xd7, 0x42, 0x6f, 0xc7, 0x0f, 0x7b, 0x6c, 0xe4, 0xb0, 0x91, 0x7d, 0x1d, 0x2e, 0xd4, 0xb0, 0x49, - 0x84, 0x1b, 0xdd, 0x7d, 0xd8, 0x63, 0x23, 0x14, 0x60, 0xc1, 0x91, 0x10, 0xe2, 0x71, 0x94, 0xac, - 0xdf, 0x24, 0x64, 0x8f, 0x60, 0x49, 0x98, 0xaa, 0xc7, 0x42, 0x6f, 0x27, 0x19, 0x20, 0x8b, 0x75, - 0xe8, 0x90, 0x06, 0x76, 0x92, 0x41, 0x59, 0x10, 0x2a, 0x28, 0x31, 0xa2, 0x1f, 0xf8, 0xc2, 0x24, - 0x38, 0x42, 0xae, 0x46, 0x41, 0x89, 0x6d, 0x97, 0x30, 0x79, 0x3e, 0x12, 0xfb, 0xb1, 0xe1, 0x14, - 0xb0, 0xfd, 0xb7, 0x26, 0xcc, 0x4a, 0x85, 0xe2, 0x56, 0x13, 0x35, 0x78, 0xa1, 0x2f, 0x82, 0x28, - 0x5b, 0xf6, 0x8f, 0xcb, 0xa3, 0x26, 0x41, 0xea, 0xe1, 0xb4, 0xa1, 0x1f, 0x4e, 0x2b, 0x32, 0xcd, - 0xd4, 0x65, 0xaa, 0xac, 0xab, 0x59, 0x5f, 0x97, 0x48, 0x0e, 0x18, 0x2f, 0xf7, 0x02, 0x37, 0x3d, - 0xe0, 0xf1, 0x50, 0x96, 0xd4, 0x4d, 0xa7, 0x86, 0x17, 0x09, 0x89, 0x70, 0x45, 0x45, 0x41, 0x81, - 0xa1, 0x82, 0x15, 0xf9, 0x9b, 0x30, 0x79, 0x65, 0x41, 0x67, 0x19, 0x1d, 0x49, 0xb2, 0x25, 0x89, - 0xcf, 0x43, 0xcc, 0x6d, 0x54, 0x40, 0xa8, 0x28, 0xb1, 0xf2, 0x61, 0x32, 0xb8, 0x11, 0xf3, 0xa1, - 0x3c, 0xd1, 0xe4, 0x20, 0xae, 0x9c, 0x87, 0x69, 0x9e, 0x17, 0x3b, 0x44, 0xab, 0xa0, 0x04, 0xad, - 0x04, 0xb1, 0x7a, 0x98, 0x77, 0x72, 0xd0, 0x5a, 0x86, 0x46, 0xc2, 0x46, 0xb2, 0x24, 0x10, 0x3f, - 0x35, 0xcb, 0x2d, 0xe9, 0x96, 0xab, 0xc4, 0xf8, 0x65, 0xfc, 0xaa, 0xc6, 0xf8, 0x32, 0x70, 0xae, - 0x68, 0x81, 0xf3, 0x1a, 0xcc, 0xf2, 0x48, 0xf8, 0x79, 0xd2, 0xb5, 0x70, 0x8f, 0x7d, 0x7c, 0xf2, - 0x1e, 0xbb, 0x72, 0x97, 0x46, 0x5e, 0x0f, 0xd3, 0xf8, 0x91, 0x93, 0xd3, 0x59, 0x77, 0x60, 0x89, - 0x1f, 0x1c, 0x04, 0x7e, 0xc8, 0xf6, 0xb2, 0xe4, 0x10, 0x4b, 0xef, 0x0b, 0x18, 0x9a, 0xec, 0x71, - 0xa1, 0x49, 0x1f, 0xe9, 0x54, 0x49, 0x45, 0x3e, 0x71, 0x53, 0x2a, 0x9d, 0x70, 0xc7, 0x5d, 0x5c, - 0x6f, 0x88, 0x7c, 0xa2, 0xe2, 0xd6, 0x5e, 0x83, 0x79, 0x55, 0x14, 0xa1, 0xaa, 0x23, 0xf6, 0x48, - 0xfa, 0xa9, 0xf8, 0x29, 0x32, 0xce, 0xb1, 0x1b, 0x64, 0x94, 0xc1, 0xe7, 0x1c, 0x02, 0x5e, 0x33, - 0x3f, 0x67, 0xd8, 0x3f, 0x34, 0x60, 0xa9, 0x22, 0x84, 0x18, 0x9d, 0xfa, 0x69, 0xc0, 0x24, 0x07, - 0x02, 0x44, 0x75, 0xe4, 0xb1, 0xa4, 0x2f, 0xdd, 0x1c, 0x7f, 0xcb, 0x3c, 0xd3, 0x28, 0xce, 0xbc, - 0x36, 0xcc, 0xfb, 0x77, 0x7b, 0x82, 0x51, 0x8f, 0x67, 0xa1, 0x57, 0xdc, 0x5b, 0x29, 0x38, 0xe1, - 0x66, 0xfe, 0xdd, 0xde, 0xa6, 0xeb, 0x0d, 0x18, 0xdd, 0x2e, 0x35, 0x51, 0x26, 0x1d, 0x69, 0x7b, - 0x30, 0x77, 0xcf, 0x8f, 0x92, 0x2d, 0x3e, 0x1c, 0x0a, 0x63, 0x79, 0x2c, 0x15, 0x79, 0xdc, 0x40, - 0x9f, 0x90, 0x90, 0x70, 0x27, 0x8f, 0x1d, 0xb8, 0x59, 0x90, 0x8a, 0xa1, 0xf9, 0xe6, 0x56, 0x50, - 0x78, 0xaf, 0x92, 0xf0, 0x70, 0x9b, 0xa8, 0x49, 0x4e, 0x05, 0x63, 0xff, 0xd1, 0x84, 0x65, 0x3c, - 0xfd, 0x6c, 0xa1, 0x6b, 0x78, 0x48, 0xf4, 0x0a, 0x34, 0x71, 0xab, 0xca, 0x8c, 0x72, 0xf2, 0x89, - 0x89, 0x86, 0x5a, 0x57, 0xa1, 0xc5, 0x23, 0x4c, 0x43, 0x94, 0xec, 0x5e, 0x98, 0x44, 0xa4, 0x5f, - 0x61, 0x39, 0x92, 0xca, 0xba, 0x01, 0x30, 0x2c, 0xb3, 0x0e, 0x85, 0xf7, 0x69, 0x79, 0x28, 0x94, - 0x42, 0xb9, 0x45, 0xa8, 0x2e, 0xee, 0xb1, 0x1a, 0x8e,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xd7, 0xd6, 0xae, 0xbc, 0x4c, 0xff, 0x0f, 0x7b, 0xbd, 0xa6, 0xc4, 0xfd, 0x16, 0xfe, 0x5f, 0xec, - 0xd5, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xf7, 0x16, 0x64, 0x42, 0x36, 0x00, 0x00, +var fileDescriptor_ws_3940a0d922f4ad30 = []byte{ + // 3298 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0x4d, 0x6c, 0x24, 0x57, + 0xf1, 0xff, 0x77, 0x8f, 0x67, 0xec, 0xa9, 0xf1, 0x67, 0xef, 0xc6, 0x99, 0xbf, 0xff, 0x9b, 0xfd, + 0x9b, 0x8e, 0x15, 0x42, 0x80, 0x4d, 0x94, 0x10, 0x09, 0xf2, 0xb1, 0xc8, 0x1f, 0xd9, 0x8f, 0x64, + 0xc7, 0x76, 0x7a, 0x76, 0x09, 0x22, 0x48, 0xa1, 0x3d, 0xfd, 0x3c, 0xee, 0xb8, 0xa7, 0xbb, 0xdd, + 0x1f, 0xde, 0x5d, 0x2e, 0x48, 0x41, 0x42, 0xdc, 0x38, 0x71, 0xe1, 0x82, 0xc4, 0x05, 0x81, 0xa2, + 0x08, 0x21, 0x90, 0x38, 0x20, 0x84, 0x10, 0x37, 0x2e, 0x20, 0x71, 0x41, 0xdc, 0x38, 0x73, 0xe5, + 0x80, 0x84, 0x04, 0x7a, 0x55, 0xaf, 0xbb, 0xdf, 0xeb, 0xee, 0xb1, 0x67, 0x2d, 0x2b, 0xbb, 0xd1, + 0x72, 0x9b, 0xaa, 0x7e, 0x55, 0xaf, 0x5e, 0xfd, 0xea, 0xbd, 0xaa, 0xf7, 0x31, 0xb0, 0x10, 0x3b, + 0x87, 0xef, 0xdd, 0x8d, 0x9f, 0xbf, 0x1b, 0x5f, 0x09, 0xa3, 0x20, 0x09, 0x8c, 0xa5, 0x98, 0x45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54, 0x27, 0x90, 0xa5, 0xca, 0xa9, 0xc3, 0x9d, 0x3a, 0x7d, 0xb8, 0xcd, 0x13, 0x86, 0xdb, 0xca, + 0x87, 0xfb, 0x27, 0x1d, 0x66, 0x71, 0x51, 0xb4, 0xd8, 0x51, 0xca, 0xe2, 0xc4, 0x78, 0x1d, 0x66, + 0xd2, 0xcc, 0x54, 0x6d, 0x52, 0x53, 0x73, 0x11, 0xe3, 0x15, 0xb1, 0x04, 0xa3, 0xbc, 0x8e, 0xf2, + 0x97, 0x6a, 0xe4, 0xf3, 0xfc, 0x67, 0x15, 0xcd, 0x79, 0xba, 0x3a, 0xb0, 0x7d, 0xc7, 0x63, 0x16, + 0x8b, 0x53, 0x2f, 0x11, 0x2b, 0xab, 0xc2, 0xa3, 0x48, 0x3b, 0xea, 0xc5, 0x43, 0x91, 0xcc, 0x04, + 0xc5, 0xbd, 0x43, 0xed, 0xf8, 0x27, 0x1a, 0x7a, 0xc1, 0xe0, 0x93, 0x3a, 0x62, 0x47, 0x88, 0x10, + 0x4d, 0xc1, 0x8c, 0x2c, 0xfa, 0x14, 0x5e, 0xa3, 0x40, 0x50, 0x78, 0x1c, 0x62, 0xa2, 0x51, 0x01, + 0x65, 0x31, 0x89, 0x53, 0x4e, 0x62, 0xe6, 0x5f, 0x1b, 0x30, 0x47, 0xd3, 0x27, 0x73, 0xea, 0x65, + 0x1e, 0xe7, 0xc1, 0x48, 0x89, 0x22, 0x89, 0xc3, 0xad, 0xe0, 0xd4, 0xb6, 0xba, 0x28, 0x29, 0x3c, + 0x1e, 0x8a, 0x9c, 0xbe, 0xa6, 0x2c, 0x4e, 0x32, 0x2b, 0xeb, 0xe5, 0xba, 0xbc, 0x48, 0x49, 0x1c, + 0xbe, 0xec, 0x25, 0x81, 0x12, 0x1d, 0x39, 0xcd, 0x65, 0x93, 0x20, 0xef, 0x9f, 0xe2, 0x43, 0xe2, + 0x70, 0xff, 0x26, 0x41, 0xd6, 0x37, 0x39, 0xa9, 0x60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 0x48, 0x3d, + 0xba, 0xb6, 0x84, 0x94, 0x71, 0x0d, 0x60, 0x54, 0x54, 0x90, 0x54, 0x08, 0x4c, 0xaa, 0x43, 0x92, + 0xe4, 0xce, 0xcd, 0x73, 0x5c, 0x7e, 0x7e, 0xdd, 0xb0, 0x54, 0xa6, 0xb1, 0x0d, 0xf3, 0x68, 0xf6, + 0x4e, 0x76, 0x0c, 0x86, 0x18, 0x4c, 0xde, 0x63, 0x49, 0xda, 0xfc, 0x91, 0x26, 0xdc, 0xc8, 0xbf, + 0xf6, 0x19, 0xf9, 0xbe, 0x70, 0x89, 0x76, 0x26, 0x97, 0xac, 0xc0, 0xcc, 0x28, 0x95, 0x4e, 0xe5, + 0x1a, 0x56, 0x4e, 0x17, 0x10, 0x35, 0x26, 0x86, 0xc8, 0xfc, 0xb1, 0x06, 0xdd, 0x37, 0x03, 0xd7, + 0xc7, 0x0f, 0xeb, 0x61, 0xe8, 0x89, 0x4b, 0x96, 0x33, 0x63, 0xfe, 0x65, 0x68, 0xdb, 0xa4, 0xc6, + 0x4f, 0x04, 0xec, 0x13, 0x9c, 0xb4, 0x15, 0x32, 0xd2, 0xa1, 0x49, 0x43, 0x3e, 0x34, 0x31, 0x3f, + 0xd2, 0x60, 0x9e, 0x9c, 0xf2, 0x76, 0xea, 0x26, 0x67, 0xb6, 0x6f, 0x03, 0x66, 0x8e, 0x52, 0x37, + 0x39, 0x43, 0x54, 0xe6, 0x72, 0xd5, 0x78, 0x6a, 0xd4, 0xc4, 0x93, 0xf9, 0x33, 0x0d, 0x2e, 0x95, + 0xdd, 0xba, 0x3e, 0x18, 0xb0, 0xf0, 0x61, 0x4e, 0x29, 0xe5, 0xd0, 0x68, 0xaa, 0x74, 0x68, 0x54, + 0x6b, 0xb2, 0xc5, 0xde, 0x67, 0x83, 0x47, 0xd7, 0xe4, 0x6f, 0xeb, 0xf0, 0xbf, 0xd7, 0xf3, 0x89, + 0x77, 0x3b, 0xb2, 0xfd, 0x78, 0x9f,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0xef, 0x57, 0xcf, 0x75, + 0x33, 0x59, 0x7e, 0xe5, 0x37, 0x55, 0x7d, 0xe5, 0xb7, 0x01, 0xf3, 0xb2, 0x01, 0x67, 0x79, 0x9f, + 0xb9, 0x71, 0xe9, 0x6b, 0x2b, 0x57, 0x9e, 0xa7, 0xff, 0x85, 0xbe, 0x5a, 0x71, 0xe2, 0x5e, 0x0b, + 0xff, 0x27, 0xfa, 0xd2, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xce, 0x12, 0x67, 0xe3, 0x3a, 0x3a, + 0x00, 0x00, } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index bf81901cd..c82785aac 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -54,6 +54,7 @@ message UserInfo{ string ex = 8; uint32 createTime = 9; int32 appMangerLevel = 10; + int32 globalRecvMsgOpt = 11; } message FriendInfo{ @@ -170,30 +171,54 @@ message UserInDepartment { ///////////////////////////////////base end///////////////////////////////////// +message PullMessageBySeqListReq{ + string userID = 1; + string operationID = 2; + repeated uint32 seqList = 3; + map groupSeqList = 4; +} + +message seqList { + repeated uint32 seqList = 1; +} + + +message MsgDataList { + repeated MsgData msgDataList = 1; +} message PullMessageBySeqListResp { int32 errCode = 1; string errMsg = 2; repeated MsgData list = 3; + map groupMsgDataList = 4; } -message PullMessageBySeqListReq{ - string userID = 1; - string operationID = 2; - repeated uint32 seqList = 3; -} + + + message GetMaxAndMinSeqReq { + repeated string groupIDList = 1; + string userID = 2; + string operationID =3; +} +message MaxAndMinSeq{ + uint32 maxSeq = 1; + uint32 minSeq = 2; } message GetMaxAndMinSeqResp { uint32 maxSeq = 1; uint32 minSeq = 2; + int32 errCode = 3; + string errMsg = 4; + map groupMaxAndMinSeq = 5; } message UserSendMsgResp { string serverMsgID = 1; string clientMsgID = 2; int64 sendTime = 3; - } + message MsgData { string sendID = 1; string recvID = 2; @@ -214,6 +239,7 @@ message MsgData { map options = 18; OfflinePushInfo offlinePushInfo = 19; repeated string atUserIDList = 20; + bytes msgDataList = 21; } message OfflinePushInfo{ diff --git a/pkg/proto/user/user.pb.go b/pkg/proto/user/user.pb.go index eeb501ebb..41e69b7f9 100644 --- a/pkg/proto/user/user.pb.go +++ b/pkg/proto/user/user.pb.go @@ -36,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_user_e11c6a5241e13fcd, []int{0} + return fileDescriptor_user_f1112695e0d68005, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -83,7 +83,7 @@ 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_e11c6a5241e13fcd, []int{1} + return fileDescriptor_user_f1112695e0d68005, []int{1} } func (m *DeleteUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersReq.Unmarshal(m, b) @@ -136,7 +136,7 @@ func (m *DeleteUsersResp) Reset() { *m = DeleteUsersResp{} } func (m *DeleteUsersResp) String() string { return proto.CompactTextString(m) } func (*DeleteUsersResp) ProtoMessage() {} func (*DeleteUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{2} + return fileDescriptor_user_f1112695e0d68005, []int{2} } func (m *DeleteUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersResp.Unmarshal(m, b) @@ -182,7 +182,7 @@ func (m *GetAllUserIDReq) Reset() { *m = GetAllUserIDReq{} } func (m *GetAllUserIDReq) String() string { return proto.CompactTextString(m) } func (*GetAllUserIDReq) ProtoMessage() {} func (*GetAllUserIDReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{3} + return fileDescriptor_user_f1112695e0d68005, []int{3} } func (m *GetAllUserIDReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUserIDReq.Unmarshal(m, b) @@ -228,7 +228,7 @@ func (m *GetAllUserIDResp) Reset() { *m = GetAllUserIDResp{} } func (m *GetAllUserIDResp) String() string { return proto.CompactTextString(m) } func (*GetAllUserIDResp) ProtoMessage() {} func (*GetAllUserIDResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{4} + return fileDescriptor_user_f1112695e0d68005, []int{4} } func (m *GetAllUserIDResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUserIDResp.Unmarshal(m, b) @@ -275,7 +275,7 @@ func (m *AccountCheckReq) Reset() { *m = AccountCheckReq{} } func (m *AccountCheckReq) String() string { return proto.CompactTextString(m) } func (*AccountCheckReq) ProtoMessage() {} func (*AccountCheckReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{5} + return fileDescriptor_user_f1112695e0d68005, []int{5} } func (m *AccountCheckReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountCheckReq.Unmarshal(m, b) @@ -328,7 +328,7 @@ func (m *AccountCheckResp) Reset() { *m = AccountCheckResp{} } func (m *AccountCheckResp) String() string { return proto.CompactTextString(m) } func (*AccountCheckResp) ProtoMessage() {} func (*AccountCheckResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{6} + return fileDescriptor_user_f1112695e0d68005, []int{6} } func (m *AccountCheckResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountCheckResp.Unmarshal(m, b) @@ -374,7 +374,7 @@ func (m *AccountCheckResp_SingleUserStatus) Reset() { *m = AccountCheckR func (m *AccountCheckResp_SingleUserStatus) String() string { return proto.CompactTextString(m) } func (*AccountCheckResp_SingleUserStatus) ProtoMessage() {} func (*AccountCheckResp_SingleUserStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{6, 0} + return fileDescriptor_user_f1112695e0d68005, []int{6, 0} } func (m *AccountCheckResp_SingleUserStatus) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AccountCheckResp_SingleUserStatus.Unmarshal(m, b) @@ -421,7 +421,7 @@ func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } func (*GetUserInfoReq) ProtoMessage() {} func (*GetUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{7} + return fileDescriptor_user_f1112695e0d68005, []int{7} } func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) @@ -474,7 +474,7 @@ func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } func (*GetUserInfoResp) ProtoMessage() {} func (*GetUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{8} + return fileDescriptor_user_f1112695e0d68005, []int{8} } func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) @@ -521,7 +521,7 @@ func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } func (*UpdateUserInfoReq) ProtoMessage() {} func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{9} + return fileDescriptor_user_f1112695e0d68005, []int{9} } func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) @@ -573,7 +573,7 @@ func (m *UpdateUserInfoResp) Reset() { *m = UpdateUserInfoResp{} } func (m *UpdateUserInfoResp) String() string { return proto.CompactTextString(m) } func (*UpdateUserInfoResp) ProtoMessage() {} func (*UpdateUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{10} + return fileDescriptor_user_f1112695e0d68005, []int{10} } func (m *UpdateUserInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInfoResp.Unmarshal(m, b) @@ -600,6 +600,98 @@ func (m *UpdateUserInfoResp) GetCommonResp() *CommonResp { return nil } +type SetGlobalRecvMessageOptReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + GlobalRecvMsgOpt int32 `protobuf:"varint,3,opt,name=globalRecvMsgOpt" json:"globalRecvMsgOpt,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetGlobalRecvMessageOptReq) Reset() { *m = SetGlobalRecvMessageOptReq{} } +func (m *SetGlobalRecvMessageOptReq) String() string { return proto.CompactTextString(m) } +func (*SetGlobalRecvMessageOptReq) ProtoMessage() {} +func (*SetGlobalRecvMessageOptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_f1112695e0d68005, []int{11} +} +func (m *SetGlobalRecvMessageOptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGlobalRecvMessageOptReq.Unmarshal(m, b) +} +func (m *SetGlobalRecvMessageOptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGlobalRecvMessageOptReq.Marshal(b, m, deterministic) +} +func (dst *SetGlobalRecvMessageOptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGlobalRecvMessageOptReq.Merge(dst, src) +} +func (m *SetGlobalRecvMessageOptReq) XXX_Size() int { + return xxx_messageInfo_SetGlobalRecvMessageOptReq.Size(m) +} +func (m *SetGlobalRecvMessageOptReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetGlobalRecvMessageOptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGlobalRecvMessageOptReq proto.InternalMessageInfo + +func (m *SetGlobalRecvMessageOptReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetGlobalRecvMessageOptReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *SetGlobalRecvMessageOptReq) GetGlobalRecvMsgOpt() int32 { + if m != nil { + return m.GlobalRecvMsgOpt + } + return 0 +} + +type SetGlobalRecvMessageOptResp 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 *SetGlobalRecvMessageOptResp) Reset() { *m = SetGlobalRecvMessageOptResp{} } +func (m *SetGlobalRecvMessageOptResp) String() string { return proto.CompactTextString(m) } +func (*SetGlobalRecvMessageOptResp) ProtoMessage() {} +func (*SetGlobalRecvMessageOptResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_f1112695e0d68005, []int{12} +} +func (m *SetGlobalRecvMessageOptResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGlobalRecvMessageOptResp.Unmarshal(m, b) +} +func (m *SetGlobalRecvMessageOptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGlobalRecvMessageOptResp.Marshal(b, m, deterministic) +} +func (dst *SetGlobalRecvMessageOptResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGlobalRecvMessageOptResp.Merge(dst, src) +} +func (m *SetGlobalRecvMessageOptResp) XXX_Size() int { + return xxx_messageInfo_SetGlobalRecvMessageOptResp.Size(m) +} +func (m *SetGlobalRecvMessageOptResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetGlobalRecvMessageOptResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGlobalRecvMessageOptResp proto.InternalMessageInfo + +func (m *SetGlobalRecvMessageOptResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + type Conversation struct { OwnerUserID string `protobuf:"bytes,1,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` ConversationID string `protobuf:"bytes,2,opt,name=ConversationID" json:"ConversationID,omitempty"` @@ -624,7 +716,7 @@ func (m *Conversation) Reset() { *m = Conversation{} } func (m *Conversation) String() string { return proto.CompactTextString(m) } func (*Conversation) ProtoMessage() {} func (*Conversation) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{11} + return fileDescriptor_user_f1112695e0d68005, []int{13} } func (m *Conversation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Conversation.Unmarshal(m, b) @@ -755,7 +847,7 @@ func (m *SetConversationReq) Reset() { *m = SetConversationReq{} } func (m *SetConversationReq) String() string { return proto.CompactTextString(m) } func (*SetConversationReq) ProtoMessage() {} func (*SetConversationReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{12} + return fileDescriptor_user_f1112695e0d68005, []int{14} } func (m *SetConversationReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetConversationReq.Unmarshal(m, b) @@ -807,7 +899,7 @@ func (m *SetConversationResp) Reset() { *m = SetConversationResp{} } func (m *SetConversationResp) String() string { return proto.CompactTextString(m) } func (*SetConversationResp) ProtoMessage() {} func (*SetConversationResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{13} + return fileDescriptor_user_f1112695e0d68005, []int{15} } func (m *SetConversationResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetConversationResp.Unmarshal(m, b) @@ -849,7 +941,7 @@ func (m *SetRecvMsgOptReq) Reset() { *m = SetRecvMsgOptReq{} } func (m *SetRecvMsgOptReq) String() string { return proto.CompactTextString(m) } func (*SetRecvMsgOptReq) ProtoMessage() {} func (*SetRecvMsgOptReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{14} + return fileDescriptor_user_f1112695e0d68005, []int{16} } func (m *SetRecvMsgOptReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetRecvMsgOptReq.Unmarshal(m, b) @@ -915,7 +1007,7 @@ func (m *SetRecvMsgOptResp) Reset() { *m = SetRecvMsgOptResp{} } func (m *SetRecvMsgOptResp) String() string { return proto.CompactTextString(m) } func (*SetRecvMsgOptResp) ProtoMessage() {} func (*SetRecvMsgOptResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{15} + return fileDescriptor_user_f1112695e0d68005, []int{17} } func (m *SetRecvMsgOptResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetRecvMsgOptResp.Unmarshal(m, b) @@ -955,7 +1047,7 @@ func (m *GetConversationReq) Reset() { *m = GetConversationReq{} } func (m *GetConversationReq) String() string { return proto.CompactTextString(m) } func (*GetConversationReq) ProtoMessage() {} func (*GetConversationReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{16} + return fileDescriptor_user_f1112695e0d68005, []int{18} } func (m *GetConversationReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationReq.Unmarshal(m, b) @@ -1008,7 +1100,7 @@ func (m *GetConversationResp) Reset() { *m = GetConversationResp{} } func (m *GetConversationResp) String() string { return proto.CompactTextString(m) } func (*GetConversationResp) ProtoMessage() {} func (*GetConversationResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{17} + return fileDescriptor_user_f1112695e0d68005, []int{19} } func (m *GetConversationResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationResp.Unmarshal(m, b) @@ -1055,7 +1147,7 @@ func (m *GetConversationsReq) Reset() { *m = GetConversationsReq{} } func (m *GetConversationsReq) String() string { return proto.CompactTextString(m) } func (*GetConversationsReq) ProtoMessage() {} func (*GetConversationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{18} + return fileDescriptor_user_f1112695e0d68005, []int{20} } func (m *GetConversationsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationsReq.Unmarshal(m, b) @@ -1108,7 +1200,7 @@ func (m *GetConversationsResp) Reset() { *m = GetConversationsResp{} } func (m *GetConversationsResp) String() string { return proto.CompactTextString(m) } func (*GetConversationsResp) ProtoMessage() {} func (*GetConversationsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{19} + return fileDescriptor_user_f1112695e0d68005, []int{21} } func (m *GetConversationsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetConversationsResp.Unmarshal(m, b) @@ -1154,7 +1246,7 @@ func (m *GetAllConversationsReq) Reset() { *m = GetAllConversationsReq{} func (m *GetAllConversationsReq) String() string { return proto.CompactTextString(m) } func (*GetAllConversationsReq) ProtoMessage() {} func (*GetAllConversationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{20} + return fileDescriptor_user_f1112695e0d68005, []int{22} } func (m *GetAllConversationsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllConversationsReq.Unmarshal(m, b) @@ -1200,7 +1292,7 @@ func (m *GetAllConversationsResp) Reset() { *m = GetAllConversationsResp func (m *GetAllConversationsResp) String() string { return proto.CompactTextString(m) } func (*GetAllConversationsResp) ProtoMessage() {} func (*GetAllConversationsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{21} + return fileDescriptor_user_f1112695e0d68005, []int{23} } func (m *GetAllConversationsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllConversationsResp.Unmarshal(m, b) @@ -1248,7 +1340,7 @@ func (m *BatchSetConversationsReq) Reset() { *m = BatchSetConversationsR func (m *BatchSetConversationsReq) String() string { return proto.CompactTextString(m) } func (*BatchSetConversationsReq) ProtoMessage() {} func (*BatchSetConversationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{22} + return fileDescriptor_user_f1112695e0d68005, []int{24} } func (m *BatchSetConversationsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BatchSetConversationsReq.Unmarshal(m, b) @@ -1309,7 +1401,7 @@ func (m *BatchSetConversationsResp) Reset() { *m = BatchSetConversations func (m *BatchSetConversationsResp) String() string { return proto.CompactTextString(m) } func (*BatchSetConversationsResp) ProtoMessage() {} func (*BatchSetConversationsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{23} + return fileDescriptor_user_f1112695e0d68005, []int{25} } func (m *BatchSetConversationsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BatchSetConversationsResp.Unmarshal(m, b) @@ -1362,7 +1454,7 @@ func (m *ResignUserReq) Reset() { *m = ResignUserReq{} } func (m *ResignUserReq) String() string { return proto.CompactTextString(m) } func (*ResignUserReq) ProtoMessage() {} func (*ResignUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{24} + return fileDescriptor_user_f1112695e0d68005, []int{26} } func (m *ResignUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResignUserReq.Unmarshal(m, b) @@ -1407,7 +1499,7 @@ func (m *ResignUserResp) Reset() { *m = ResignUserResp{} } func (m *ResignUserResp) String() string { return proto.CompactTextString(m) } func (*ResignUserResp) ProtoMessage() {} func (*ResignUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{25} + return fileDescriptor_user_f1112695e0d68005, []int{27} } func (m *ResignUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResignUserResp.Unmarshal(m, b) @@ -1446,7 +1538,7 @@ func (m *GetUserByIdReq) Reset() { *m = GetUserByIdReq{} } func (m *GetUserByIdReq) String() string { return proto.CompactTextString(m) } func (*GetUserByIdReq) ProtoMessage() {} func (*GetUserByIdReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{26} + return fileDescriptor_user_f1112695e0d68005, []int{28} } func (m *GetUserByIdReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserByIdReq.Unmarshal(m, b) @@ -1495,7 +1587,7 @@ func (m *User) Reset() { *m = User{} } func (m *User) String() string { return proto.CompactTextString(m) } func (*User) ProtoMessage() {} func (*User) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{27} + return fileDescriptor_user_f1112695e0d68005, []int{29} } func (m *User) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_User.Unmarshal(m, b) @@ -1562,7 +1654,7 @@ func (m *GetUserByIdResp) Reset() { *m = GetUserByIdResp{} } func (m *GetUserByIdResp) String() string { return proto.CompactTextString(m) } func (*GetUserByIdResp) ProtoMessage() {} func (*GetUserByIdResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{28} + return fileDescriptor_user_f1112695e0d68005, []int{30} } func (m *GetUserByIdResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserByIdResp.Unmarshal(m, b) @@ -1609,7 +1701,7 @@ func (m *GetUsersByNameReq) Reset() { *m = GetUsersByNameReq{} } func (m *GetUsersByNameReq) String() string { return proto.CompactTextString(m) } func (*GetUsersByNameReq) ProtoMessage() {} func (*GetUsersByNameReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{29} + return fileDescriptor_user_f1112695e0d68005, []int{31} } func (m *GetUsersByNameReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersByNameReq.Unmarshal(m, b) @@ -1663,7 +1755,7 @@ func (m *GetUsersByNameResp) Reset() { *m = GetUsersByNameResp{} } func (m *GetUsersByNameResp) String() string { return proto.CompactTextString(m) } func (*GetUsersByNameResp) ProtoMessage() {} func (*GetUsersByNameResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{30} + return fileDescriptor_user_f1112695e0d68005, []int{32} } func (m *GetUsersByNameResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersByNameResp.Unmarshal(m, b) @@ -1720,7 +1812,7 @@ func (m *AlterUserReq) Reset() { *m = AlterUserReq{} } func (m *AlterUserReq) String() string { return proto.CompactTextString(m) } func (*AlterUserReq) ProtoMessage() {} func (*AlterUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{31} + return fileDescriptor_user_f1112695e0d68005, []int{33} } func (m *AlterUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AlterUserReq.Unmarshal(m, b) @@ -1793,7 +1885,7 @@ func (m *AlterUserResp) Reset() { *m = AlterUserResp{} } func (m *AlterUserResp) String() string { return proto.CompactTextString(m) } func (*AlterUserResp) ProtoMessage() {} func (*AlterUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{32} + return fileDescriptor_user_f1112695e0d68005, []int{34} } func (m *AlterUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AlterUserResp.Unmarshal(m, b) @@ -1833,7 +1925,7 @@ func (m *GetUsersReq) Reset() { *m = GetUsersReq{} } func (m *GetUsersReq) String() string { return proto.CompactTextString(m) } func (*GetUsersReq) ProtoMessage() {} func (*GetUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{33} + return fileDescriptor_user_f1112695e0d68005, []int{35} } func (m *GetUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersReq.Unmarshal(m, b) @@ -1888,7 +1980,7 @@ func (m *GetUsersResp) Reset() { *m = GetUsersResp{} } func (m *GetUsersResp) String() string { return proto.CompactTextString(m) } func (*GetUsersResp) ProtoMessage() {} func (*GetUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{34} + return fileDescriptor_user_f1112695e0d68005, []int{36} } func (m *GetUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersResp.Unmarshal(m, b) @@ -1951,7 +2043,7 @@ func (m *AddUserReq) Reset() { *m = AddUserReq{} } func (m *AddUserReq) String() string { return proto.CompactTextString(m) } func (*AddUserReq) ProtoMessage() {} func (*AddUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{35} + return fileDescriptor_user_f1112695e0d68005, []int{37} } func (m *AddUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddUserReq.Unmarshal(m, b) @@ -2017,7 +2109,7 @@ func (m *AddUserResp) Reset() { *m = AddUserResp{} } func (m *AddUserResp) String() string { return proto.CompactTextString(m) } func (*AddUserResp) ProtoMessage() {} func (*AddUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{36} + return fileDescriptor_user_f1112695e0d68005, []int{38} } func (m *AddUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddUserResp.Unmarshal(m, b) @@ -2058,7 +2150,7 @@ func (m *BlockUserReq) Reset() { *m = BlockUserReq{} } func (m *BlockUserReq) String() string { return proto.CompactTextString(m) } func (*BlockUserReq) ProtoMessage() {} func (*BlockUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{37} + return fileDescriptor_user_f1112695e0d68005, []int{39} } func (m *BlockUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockUserReq.Unmarshal(m, b) @@ -2117,7 +2209,7 @@ func (m *BlockUserResp) Reset() { *m = BlockUserResp{} } func (m *BlockUserResp) String() string { return proto.CompactTextString(m) } func (*BlockUserResp) ProtoMessage() {} func (*BlockUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{38} + return fileDescriptor_user_f1112695e0d68005, []int{40} } func (m *BlockUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockUserResp.Unmarshal(m, b) @@ -2157,7 +2249,7 @@ func (m *UnBlockUserReq) Reset() { *m = UnBlockUserReq{} } func (m *UnBlockUserReq) String() string { return proto.CompactTextString(m) } func (*UnBlockUserReq) ProtoMessage() {} func (*UnBlockUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{39} + return fileDescriptor_user_f1112695e0d68005, []int{41} } func (m *UnBlockUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnBlockUserReq.Unmarshal(m, b) @@ -2209,7 +2301,7 @@ func (m *UnBlockUserResp) Reset() { *m = UnBlockUserResp{} } func (m *UnBlockUserResp) String() string { return proto.CompactTextString(m) } func (*UnBlockUserResp) ProtoMessage() {} func (*UnBlockUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{40} + return fileDescriptor_user_f1112695e0d68005, []int{42} } func (m *UnBlockUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnBlockUserResp.Unmarshal(m, b) @@ -2249,7 +2341,7 @@ func (m *GetBlockUsersReq) Reset() { *m = GetBlockUsersReq{} } func (m *GetBlockUsersReq) String() string { return proto.CompactTextString(m) } func (*GetBlockUsersReq) ProtoMessage() {} func (*GetBlockUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{41} + return fileDescriptor_user_f1112695e0d68005, []int{43} } func (m *GetBlockUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUsersReq.Unmarshal(m, b) @@ -2303,7 +2395,7 @@ func (m *BlockUser) Reset() { *m = BlockUser{} } func (m *BlockUser) String() string { return proto.CompactTextString(m) } func (*BlockUser) ProtoMessage() {} func (*BlockUser) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{42} + return fileDescriptor_user_f1112695e0d68005, []int{44} } func (m *BlockUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BlockUser.Unmarshal(m, b) @@ -2358,7 +2450,7 @@ func (m *GetBlockUsersResp) Reset() { *m = GetBlockUsersResp{} } func (m *GetBlockUsersResp) String() string { return proto.CompactTextString(m) } func (*GetBlockUsersResp) ProtoMessage() {} func (*GetBlockUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{43} + return fileDescriptor_user_f1112695e0d68005, []int{45} } func (m *GetBlockUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUsersResp.Unmarshal(m, b) @@ -2418,7 +2510,7 @@ func (m *GetBlockUserByIdReq) Reset() { *m = GetBlockUserByIdReq{} } func (m *GetBlockUserByIdReq) String() string { return proto.CompactTextString(m) } func (*GetBlockUserByIdReq) ProtoMessage() {} func (*GetBlockUserByIdReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{44} + return fileDescriptor_user_f1112695e0d68005, []int{46} } func (m *GetBlockUserByIdReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUserByIdReq.Unmarshal(m, b) @@ -2463,7 +2555,7 @@ func (m *GetBlockUserByIdResp) Reset() { *m = GetBlockUserByIdResp{} } func (m *GetBlockUserByIdResp) String() string { return proto.CompactTextString(m) } func (*GetBlockUserByIdResp) ProtoMessage() {} func (*GetBlockUserByIdResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{45} + return fileDescriptor_user_f1112695e0d68005, []int{47} } func (m *GetBlockUserByIdResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlockUserByIdResp.Unmarshal(m, b) @@ -2503,7 +2595,7 @@ func (m *DeleteUserReq) Reset() { *m = DeleteUserReq{} } func (m *DeleteUserReq) String() string { return proto.CompactTextString(m) } func (*DeleteUserReq) ProtoMessage() {} func (*DeleteUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{46} + return fileDescriptor_user_f1112695e0d68005, []int{48} } func (m *DeleteUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserReq.Unmarshal(m, b) @@ -2555,7 +2647,7 @@ func (m *DeleteUserResp) Reset() { *m = DeleteUserResp{} } func (m *DeleteUserResp) String() string { return proto.CompactTextString(m) } func (*DeleteUserResp) ProtoMessage() {} func (*DeleteUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_e11c6a5241e13fcd, []int{47} + return fileDescriptor_user_f1112695e0d68005, []int{49} } func (m *DeleteUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUserResp.Unmarshal(m, b) @@ -2595,6 +2687,8 @@ func init() { proto.RegisterType((*GetUserInfoResp)(nil), "user.GetUserInfoResp") proto.RegisterType((*UpdateUserInfoReq)(nil), "user.UpdateUserInfoReq") proto.RegisterType((*UpdateUserInfoResp)(nil), "user.UpdateUserInfoResp") + proto.RegisterType((*SetGlobalRecvMessageOptReq)(nil), "user.SetGlobalRecvMessageOptReq") + proto.RegisterType((*SetGlobalRecvMessageOptResp)(nil), "user.SetGlobalRecvMessageOptResp") proto.RegisterType((*Conversation)(nil), "user.Conversation") proto.RegisterType((*SetConversationReq)(nil), "user.SetConversationReq") proto.RegisterType((*SetConversationResp)(nil), "user.SetConversationResp") @@ -2647,6 +2741,7 @@ const _ = grpc.SupportPackageIsVersion4 type UserClient interface { GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) + SetGlobalRecvMessageOpt(ctx context.Context, in *SetGlobalRecvMessageOptReq, opts ...grpc.CallOption) (*SetGlobalRecvMessageOptResp, error) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts ...grpc.CallOption) (*GetAllUserIDResp, error) AccountCheck(ctx context.Context, in *AccountCheckReq, opts ...grpc.CallOption) (*AccountCheckResp, error) @@ -2695,6 +2790,15 @@ func (c *userClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, return out, nil } +func (c *userClient) SetGlobalRecvMessageOpt(ctx context.Context, in *SetGlobalRecvMessageOptReq, opts ...grpc.CallOption) (*SetGlobalRecvMessageOptResp, error) { + out := new(SetGlobalRecvMessageOptResp) + err := grpc.Invoke(ctx, "/user.user/SetGlobalRecvMessageOpt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + 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...) @@ -2880,6 +2984,7 @@ func (c *userClient) DeleteUser(ctx context.Context, in *DeleteUserReq, opts ... type UserServer interface { GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) + SetGlobalRecvMessageOpt(context.Context, *SetGlobalRecvMessageOptReq) (*SetGlobalRecvMessageOptResp, error) DeleteUsers(context.Context, *DeleteUsersReq) (*DeleteUsersResp, error) GetAllUserID(context.Context, *GetAllUserIDReq) (*GetAllUserIDResp, error) AccountCheck(context.Context, *AccountCheckReq) (*AccountCheckResp, error) @@ -2942,6 +3047,24 @@ func _User_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _User_SetGlobalRecvMessageOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetGlobalRecvMessageOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).SetGlobalRecvMessageOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/SetGlobalRecvMessageOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).SetGlobalRecvMessageOpt(ctx, req.(*SetGlobalRecvMessageOptReq)) + } + return interceptor(ctx, in, info, handler) +} + func _User_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteUsersReq) if err := dec(in); err != nil { @@ -3314,6 +3437,10 @@ var _User_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateUserInfo", Handler: _User_UpdateUserInfo_Handler, }, + { + MethodName: "SetGlobalRecvMessageOpt", + Handler: _User_SetGlobalRecvMessageOpt_Handler, + }, { MethodName: "DeleteUsers", Handler: _User_DeleteUsers_Handler, @@ -3399,125 +3526,129 @@ var _User_serviceDesc = grpc.ServiceDesc{ Metadata: "user/user.proto", } -func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_e11c6a5241e13fcd) } +func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_f1112695e0d68005) } -var fileDescriptor_user_e11c6a5241e13fcd = []byte{ - // 1857 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xdd, 0x4f, 0x24, 0x4b, - 0x15, 0x4f, 0xcf, 0xc7, 0x02, 0x67, 0x98, 0x61, 0x28, 0xb8, 0xd0, 0xb7, 0x55, 0xc4, 0xce, 0xf5, - 0x4a, 0x48, 0x04, 0x5d, 0x8d, 0x6b, 0xd6, 0xe8, 0x2e, 0x33, 0xb0, 0x64, 0x8c, 0x0b, 0x93, 0x9e, - 0x25, 0x31, 0xc6, 0x84, 0xf4, 0xce, 0x14, 0xd0, 0x61, 0xa6, 0xbb, 0xb7, 0xab, 0x87, 0x5d, 0x7c, - 0x59, 0xe3, 0xc7, 0x8b, 0xf1, 0xc5, 0xa7, 0x5d, 0x7d, 0xf0, 0xef, 0xf0, 0x5d, 0x9f, 0xfc, 0x0f, - 0xf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xe1, 0x97, 0xcb, 0x79, 0x6b, 0x25, 0x27, 0x23, - 0x21, 0xfa, 0x3e, 0xcc, 0x27, 0x20, 0xd0, 0xb2, 0x0a, 0x8a, 0xce, 0x41, 0xba, 0x88, 0x84, 0x68, - 0x07, 0xe6, 0x44, 0xd1, 0x84, 0x44, 0x6a, 0xc9, 0xaa, 0x3b, 0x6b, 0x59, 0x93, 0x70, 0x60, 0xd9, - 0x19, 0x88, 0xf4, 0xb4, 0x99, 0x01, 0x53, 0x8b, 0x81, 0xa7, 0xd0, 0x90, 0xea, 0x83, 0xc4, 0x11, - 0x6a, 0x69, 0x92, 0x38, 0x42, 0x2f, 0x24, 0x9e, 0x43, 0x53, 0x39, 0xf3, 0x50, 0x16, 0xf7, 0x4a, - 0xa9, 0x60, 0xad, 0x17, 0xca, 0xd3, 0xa8, 0x51, 0x0e, 0x02, 0x29, 0x6a, 0xf4, 0x23, 0x47, 0x8a, - 0x9a, 0xfc, 0xd9, 0xf1, 0x04, 0x20, 0xcb, 0x56, 0x89, 0x43, 0x95, 0xe3, 0xc1, 0x5a, 0xcd, 0x0b, - 0x49, 0xd8, 0x69, 0xfe, 0xaa, 0xb1, 0xc3, 0x3e, 0xfd, 0xfe, 0x84, 0xfe, 0x79, 0xfd, 0x88, 0x7d, - 0xd7, 0xfd, 0xc1, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x34, 0x9a, 0x78, 0xde, 0x13, 0x1e, 0x00, - 0x00, +var fileDescriptor_user_f1112695e0d68005 = []byte{ + // 1923 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0x57, 0xfb, 0x63, 0x92, 0x3c, 0xc7, 0x8e, 0x53, 0x93, 0x9d, 0xf4, 0xf6, 0xc2, 0xe0, 0x6d, + 0x2d, 0x4b, 0x34, 0x12, 0x09, 0x0c, 0x88, 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 0x42, 0x5b, 0xef, 0xa7, 0xd4, 0x5e, 0xc8, 0x0e, 0x14, 0x2d, 0xf4, 0x11, + 0x34, 0x5d, 0xbe, 0x38, 0x1f, 0x28, 0xe0, 0xab, 0x42, 0xdb, 0x87, 0x56, 0x1f, 0xc7, 0xcc, 0x20, + 0xfe, 0x65, 0x40, 0x6d, 0x7b, 0x1f, 0x60, 0xa1, 0x9b, 0x55, 0x92, 0xdc, 0xd2, 0xa2, 0xbf, 0x33, + 0x18, 0x09, 0xb3, 0x0f, 0x96, 0x32, 0xe8, 0xa7, 0xb0, 0x9d, 0xac, 0xc0, 0xb4, 0xac, 0x32, 0x93, + 0x7e, 0x70, 0x48, 0x70, 0xf4, 0x02, 0x47, 0x17, 0x6e, 0xe8, 0x5d, 0x84, 0x6e, 0xe4, 0xce, 0xc9, + 0x61, 0xfa, 0x21, 0x65, 0x82, 0xfd, 0x07, 0x03, 0x76, 0x9f, 0x85, 0x13, 0x57, 0x84, 0xb3, 0x80, + 0xfe, 0x08, 0x36, 0x93, 0xa6, 0x50, 0xe3, 0xc6, 0x25, 0xd3, 0xc1, 0xab, 0x6c, 0x12, 0xe4, 0x6d, + 0x22, 0x87, 0xd1, 0x63, 0x40, 0xba, 0x2e, 0x65, 0xac, 0x62, 0x7f, 0x69, 0x80, 0x35, 0xc2, 0x71, + 0x7f, 0x16, 0x3c, 0x77, 0x67, 0x0e, 0x1e, 0xbf, 0x78, 0x82, 0x09, 0x71, 0xa7, 0xf8, 0x3c, 0x8c, + 0x29, 0xba, 0x65, 0x44, 0x59, 0x19, 0xe7, 0x34, 0xc9, 0x4c, 0xb3, 0x45, 0xc9, 0xf4, 0x3c, 0x8c, + 0x19, 0x8e, 0xba, 0x93, 0x93, 0xdb, 0xe7, 0xf0, 0xc1, 0x52, 0x1d, 0x4a, 0xa1, 0xfa, 0x4f, 0x15, + 0xb6, 0x7b, 0x81, 0xff, 0x02, 0x47, 0x84, 0xe9, 0xc3, 0x48, 0xf6, 0xd2, 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0x02, 0x5b, + 0xcd, 0x5a, 0xd6, 0x45, 0x42, 0xf4, 0x73, 0x78, 0xaf, 0xf0, 0x48, 0x88, 0xee, 0x8b, 0x58, 0x5b, + 0x72, 0xea, 0xb5, 0xbe, 0x71, 0x63, 0x3f, 0x37, 0xe0, 0xa8, 0xd8, 0x80, 0xa3, 0xa5, 0x06, 0x2c, + 0xba, 0xb6, 0xfb, 0x0c, 0x9a, 0xca, 0xbd, 0x15, 0xba, 0x97, 0x8e, 0x55, 0x2e, 0xe6, 0xac, 0xfd, + 0x42, 0x39, 0x27, 0xa1, 0x74, 0xfe, 0xd1, 0xa2, 0x4c, 0x64, 0x30, 0x2d, 0xca, 0xd2, 0x2c, 0xd4, + 0x4b, 0x8f, 0x88, 0xe2, 0xec, 0x90, 0x44, 0x59, 0xee, 0xac, 0x63, 0x99, 0xc5, 0x1d, 0x24, 0x44, + 0x8f, 0xd8, 0x3b, 0x92, 0x38, 0xab, 0xa2, 0xbb, 0x7c, 0x9c, 0x72, 0x10, 0xb6, 0xf6, 0xf2, 0x42, + 0x12, 0xa2, 0xef, 0xc3, 0x56, 0x5a, 0x63, 0x23, 0x71, 0xa1, 0x20, 0x1f, 0x17, 0xac, 0xbb, 0x39, + 0x19, 0x09, 0xd1, 0x77, 0x61, 0x33, 0x51, 0x02, 0xed, 0xaa, 0x4a, 0xd1, 0x39, 0x48, 0x17, 0x91, + 0x10, 0x1d, 0xc2, 0x86, 0x28, 0xca, 0x90, 0x48, 0x5d, 0x59, 0xf5, 0x68, 0xed, 0x6a, 0x12, 0xae, + 0x58, 0xb6, 0xc7, 0x22, 0x3d, 0x2d, 0x67, 0x8a, 0xa9, 0xc5, 0xc6, 0x27, 0xd0, 0x90, 0xea, 0x8f, + 0xc4, 0x11, 0x6a, 0xe9, 0x93, 0x38, 0x42, 0x2f, 0x54, 0x3e, 0x83, 0xa6, 0xb2, 0xa7, 0xa2, 0x2c, + 0xee, 0x95, 0x52, 0xc4, 0xda, 0x2f, 0x94, 0xa7, 0x51, 0xa3, 0x6c, 0x34, 0x52, 0xd4, 0xe8, 0x5b, + 0x9a, 0x14, 0x35, 0xf9, 0xbd, 0xe9, 0x11, 0x40, 0x96, 0xad, 0x12, 0x87, 0x2a, 0xdb, 0x8f, 0xb5, + 0x97, 0x17, 0x92, 0xb0, 0xdb, 0xfc, 0x45, 0xe3, 0x90, 0x3d, 0x98, 0xff, 0x88, 0xfe, 0x79, 0x7e, + 0x87, 0xbd, 0x86, 0x7f, 0xef, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x32, 0x71, 0xc8, 0xa6, 0x49, + 0x1f, 0x00, 0x00, } diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index 3fbfd0162..fa7025b28 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -66,6 +66,14 @@ message UpdateUserInfoReq{ message UpdateUserInfoResp{ CommonResp commonResp = 1; } +message SetGlobalRecvMessageOptReq{ + string userID = 1; + string operationID = 2; + int32 globalRecvMsgOpt = 3; +} +message SetGlobalRecvMessageOptResp{ + CommonResp commonResp = 1; +} message Conversation{ string OwnerUserID = 1; @@ -293,6 +301,7 @@ message DeleteUserResp { service user { rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp); rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp); + rpc SetGlobalRecvMessageOpt(SetGlobalRecvMessageOptReq) returns(SetGlobalRecvMessageOptResp); rpc DeleteUsers(DeleteUsersReq)returns(DeleteUsersResp); rpc GetAllUserID(GetAllUserIDReq)returns(GetAllUserIDResp); @@ -315,8 +324,4 @@ service user { rpc GetBlockUsers(GetBlockUsersReq) returns (GetBlockUsersResp); rpc GetBlockUserById(GetBlockUserByIdReq) returns (GetBlockUserByIdResp); rpc DeleteUser(DeleteUserReq) returns (DeleteUserResp); - - - rpc GetUserInfoFromCache(GetUserInfoReq) returns(GetUserInfoResp); - } diff --git a/pkg/utils/base64.go b/pkg/utils/base64.go new file mode 100644 index 000000000..3f01c1488 --- /dev/null +++ b/pkg/utils/base64.go @@ -0,0 +1,12 @@ +package utils + +import "encoding/base64" + +func Base64Encode(data string) string { + return base64.StdEncoding.EncodeToString([]byte(data)) +} + +func Base64Decode(data string) string { + decodedByte, _ := base64.StdEncoding.DecodeString(data) + return string(decodedByte) +} diff --git a/pkg/utils/encryption .go b/pkg/utils/encryption .go new file mode 100644 index 000000000..a4862de2e --- /dev/null +++ b/pkg/utils/encryption .go @@ -0,0 +1,64 @@ +package utils + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "crypto/md5" + "encoding/hex" + "errors" +) + +func Md5(s string, salt ...string) string { + h := md5.New() + h.Write([]byte(s)) + if len(salt) > 0 { + h.Write([]byte(salt[0])) + } + cipher := h.Sum(nil) + return hex.EncodeToString(cipher) +} + +func AesEncrypt(data []byte, key []byte) ([]byte, error) { + block, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + blockSize := block.BlockSize() + encryptBytes := pkcs7Padding(data, blockSize) + crypted := make([]byte, len(encryptBytes)) + blockMode := cipher.NewCBCEncrypter(block, key[:blockSize]) + blockMode.CryptBlocks(crypted, encryptBytes) + return crypted, nil +} + +func AesDecrypt(data []byte, key []byte) ([]byte, error) { + block, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + blockSize := block.BlockSize() + blockMode := cipher.NewCBCDecrypter(block, key[:blockSize]) + crypted := make([]byte, len(data)) + blockMode.CryptBlocks(crypted, data) + crypted, err = pkcs7UnPadding(crypted) + if err != nil { + return nil, err + } + return crypted, nil +} + +func pkcs7Padding(data []byte, blockSize int) []byte { + padding := blockSize - len(data)%blockSize + padText := bytes.Repeat([]byte{byte(padding)}, padding) + return append(data, padText...) +} + +func pkcs7UnPadding(data []byte) ([]byte, error) { + length := len(data) + if length == 0 { + return nil, errors.New("encrypt error") + } + unPadding := int(data[length-1]) + return data[:(length - unPadding)], nil +} diff --git a/pkg/utils/md5.go b/pkg/utils/md5.go deleted file mode 100644 index 8e3531668..000000000 --- a/pkg/utils/md5.go +++ /dev/null @@ -1,13 +0,0 @@ -package utils - -import ( - "crypto/md5" - "encoding/hex" -) - -func Md5(s string) string { - h := md5.New() - h.Write([]byte(s)) - cipher := h.Sum(nil) - return hex.EncodeToString(cipher) -} diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go index a05ba927a..0e7c16106 100644 --- a/pkg/utils/strings.go +++ b/pkg/utils/strings.go @@ -51,7 +51,14 @@ func IsContainInt32(target int32, List []int32) bool { } return false } - +func IsContainInt(target int, List []int) bool { + for _, element := range List { + if target == element { + return true + } + } + return false +} func InterfaceArrayToStringArray(data []interface{}) (i []string) { for _, param := range data { i = append(i, param.(string)) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 5346292ac..8d144c7e8 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -149,7 +149,7 @@ func String2Pb(s string, pb proto.Message) error { return proto.Unmarshal([]byte(s), pb) } -func Map2Pb(m map[string]interface{}) (pb proto.Message, err error) { +func Map2Pb(m map[string]string) (pb proto.Message, err error) { b, err := json.Marshal(m) if err != nil { return nil, err @@ -165,7 +165,7 @@ func Pb2Map(pb proto.Message) (map[string]interface{}, error) { jsonbMarshaller := &jsonpb.Marshaler{ OrigName: true, EnumsAsInts: true, - EmitDefaults: true, + EmitDefaults: false, } _ = jsonbMarshaller.Marshal(&_buffer, pb) jsonCnt := _buffer.Bytes() diff --git a/script/batch_build_all_service.sh b/script/batch_build_all_service.sh new file mode 100644 index 000000000..bf780008f --- /dev/null +++ b/script/batch_build_all_service.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh + +bin_dir="../bin" +logs_dir="../logs" +sdk_db_dir="../db/sdk/" +#Automatically created when there is no bin, logs folder +if [ ! -d $bin_dir ]; then + mkdir -p $bin_dir +fi +if [ ! -d $logs_dir ]; then + mkdir -p $logs_dir +fi +if [ ! -d $sdk_db_dir ]; then + mkdir -p $sdk_db_dir +fi + +#begin path +begin_path=$PWD + + +build_pid_array=() + +for ((i = 0; i < ${#service_source_root[*]}; i++)); do + cd $begin_path + service_path=${service_source_root[$i]} + cd $service_path + make install > /dev/null & + build_pid=$! + build_pid_array[i]=$build_pid +done + + +echo "wait all build finish....." + +success_num=0 +for ((i = 0; i < ${#service_source_root[*]}; i++)); do + echo "wait pid: " ${build_pid_array[i]} ${service_names[$i]} + wait ${build_pid_array[i]} + stat=$? + echo ${service_names[$i]} "pid: " ${build_pid_array[i]} "stat: " $stat + if [ $stat == 0 ] + then + echo -e "${GREEN_PREFIX}${service_names[$i]} successfully be built ${COLOR_SUFFIX}\n" + let success_num=$success_num+1 + + else + echo -e "${RED_PREFIX}${service_names[$i]} build failed ${COLOR_SUFFIX}\n" + exit -1 + fi +done + +echo "success_num" $success_num "service num:" ${#service_source_root[*]} +if [ $success_num == ${#service_source_root[*]} ] +then + echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX} +fi diff --git a/script/batch_start_all.sh b/script/batch_start_all.sh new file mode 100644 index 000000000..c2d78c509 --- /dev/null +++ b/script/batch_start_all.sh @@ -0,0 +1,61 @@ +#!/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 + demo_svr_start.sh +) +time=`date +"%Y-%m-%d %H:%M:%S"` +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========server start time:${time}===========">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & + +build_pid_array=() +idx=0 +for i in ${need_to_start_server_shell[*]}; do + chmod +x $i + ./$i & + build_pid=$! + echo "build_pid " $build_pid + build_pid_array[idx]=$build_pid + let idx=idx+1 +done + +echo "wait all start finish....." + +exit 0 + +success_num=0 +for ((i = 0; i < ${#need_to_start_server_shell[*]}; i++)); do + echo "wait pid: " ${build_pid_array[i]} ${need_to_start_server_shell[$i]} + wait ${build_pid_array[i]} + stat=$? + echo ${build_pid_array[i]} " " $stat + if [ $stat == 0 ] + then + # echo -e "${GREEN_PREFIX}${need_to_start_server_shell[$i]} successfully be built ${COLOR_SUFFIX}\n" + let success_num=$success_num+1 + + else + #echo -e "${RED_PREFIX}${need_to_start_server_shell[$i]} build failed ${COLOR_SUFFIX}\n" + exit -1 + fi +done + +echo "success_num" $success_num "service num:" ${#need_to_start_server_shell[*]} +if [ $success_num == ${#need_to_start_server_shell[*]} ] +then + echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX} +fi + + diff --git a/script/path_info.cfg b/script/path_info.cfg index 0a47f51fd..17382cbfd 100644 --- a/script/path_info.cfg +++ b/script/path_info.cfg @@ -16,7 +16,7 @@ push_source_root="../cmd/open_im_push/" msg_transfer_name="open_im_msg_transfer" msg_transfer_binary_root="../bin/" msg_transfer_source_root="../cmd/open_im_msg_transfer/" -msg_transfer_service_num=2 +msg_transfer_service_num=4 sdk_server_name="open_im_sdk_server" diff --git a/script/start_all.sh b/script/start_all.sh index bf7170d68..9fcbd1c6a 100644 --- a/script/start_all.sh +++ b/script/start_all.sh @@ -5,10 +5,10 @@ #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 + msg_gateway_start.sh demo_svr_start.sh ) time=`date +"%Y-%m-%d %H:%M:%S"` diff --git a/test/mongo/cmd/main.go b/test/mongo/cmd/main.go index 2a8d41523..e2c6e99b8 100644 --- a/test/mongo/cmd/main.go +++ b/test/mongo/cmd/main.go @@ -17,11 +17,11 @@ func init() { uri = config.Config.Mongo.DBUri } else { if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" { - uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress[0], + uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } else { uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", - config.Config.Mongo.DBAddress[0], config.Config.Mongo.DBDatabase, + config.Config.Mongo.DBAddress, config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) } } diff --git a/test/mongo/mongo_utils.go b/test/mongo/mongo_utils.go index 591143d90..f53a6384c 100644 --- a/test/mongo/mongo_utils.go +++ b/test/mongo/mongo_utils.go @@ -48,7 +48,12 @@ func GetUserAllChat(uid string) { fmt.Println(err.Error(), msg) continue } - fmt.Println("seq: ", msgData.Seq, "status: ", msgData.Status, "sendID: ", msgData.SendID, "recvID: ", msgData.RecvID, "sendTime: ", msgData.SendTime) + fmt.Println("seq: ", msgData.Seq, "status: ", msgData.Status, + "sendID: ", msgData.SendID, "recvID: ", msgData.RecvID, + "sendTime: ", msgData.SendTime, + "clientMsgID: ", msgData.ClientMsgID, + "serverMsgID: ", msgData.ServerMsgID, + "content: ", string(msgData.Content)) } } }