Merge remote-tracking branch 'origin/v2.3.0release' into v2.3.0release

This commit is contained in:
Gordon 2023-02-01 17:37:47 +08:00
commit 396a87ab71
84 changed files with 8085 additions and 5713 deletions

View File

@ -36,75 +36,69 @@ By deployment of the Open-IM-Server on the customer's server, developers can int
> Open-IM relies on five open source high-performance components: ETCD, MySQL, MongoDB, Redis, and Kafka. Privatization deployment Before Open-IM-Server, please make sure that the above five components have been installed. If your server does not have the above components, you must first install Missing components. If you have the above components, it is recommended to use them directly. If not, it is recommended to use Docker-compose, no To install dependencies, one-click deployment, faster and more convenient. > Open-IM relies on five open source high-performance components: ETCD, MySQL, MongoDB, Redis, and Kafka. Privatization deployment Before Open-IM-Server, please make sure that the above five components have been installed. If your server does not have the above components, you must first install Missing components. If you have the above components, it is recommended to use them directly. If not, it is recommended to use Docker-compose, no To install dependencies, one-click deployment, faster and more convenient.
#### Source code deployment #### Deploy using Docker
1. Install [Go environment](https://golang.org/doc/install). Make sure Go version is at least 1.15. 1. Install [Go environment](https://golang.org/doc/install). Make sure Go version is at least 1.17
2. Clone the Open-IM project to your server. 2. Clone the Open-IM project to your server
``` ```
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive
``` ```
3. Build and start Service. 3. Deploy
1. Shell authorization 1. Modify env
``` ```
#cd Open-IM-server/script #cd Open-IM-server
USER=root
chmod +x *.sh PASSWORD=openIM123 #Password with more than 8 digits, excluding special characters
ENDPOINT=http://127.0.0.1:10005 #Replace 127.0.0.1 with Internet IP
DATA_DIR=./
``` ```
2. Execute the build shell 2. Deploy && Start
``` ```
./build_all_service.sh chmod +x install_im_server.sh;
``` ./install_im_server.sh;
3. Start service
```
./start_all.sh
``` ```
4. Check service 4. Check service
``` ```
./check_all.sh cd script;
./docker_check_service.sh./check_all.sh
``` ```
![OpenIMServersonSystempng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-System.png) ![OpenIMServersonSystempng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-System.png)
#### Docker deployment #### Deploy using source code
All images are available at https://hub.docker.com/r/lyt1123/open_im_server 1. Go 1.17 or above。
2. Clone
1. [Install Docker](https://docs.docker.com/install/) 1.13 or above. ```shell
2. [Install Docker Compose](https://docs.docker.com/compose/install/) 1.22 or above.
3. Clone the Open-IM project to your server.
```
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive
cd cmd/Open-IM-SDK-Core
git checkout main
``` ```
4. Start docker-compose with one click(Docker automatically pulls all images) 1. Set executable permissions
``` ```shell
cd Open-IM-Server cd ../../script/
docker-compose up -d chmod +x *.sh
``` ```
5. Check service 1. build
``` ```shell
./docker_check_service.sh ./batch_build_all_service.sh
./check_all.sh
``` ```
![OpenIMServersondockerpng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-docker.png) all services build success
### CONFIGURATION INSTRUCTIONS ### CONFIGURATION INSTRUCTIONS

@ -1 +1 @@
Subproject commit 1667b0f4e205fc4ed7c690ab55b662087d61c277 Subproject commit e7bf4b2a2066e8836dccd908d11b4d37c1c6a4ce

View File

@ -163,6 +163,11 @@ func main() {
chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg) chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg)
chatGroup.POST("/check_msg_is_send_success", manage.CheckMsgIsSendSuccess) chatGroup.POST("/check_msg_is_send_success", manage.CheckMsgIsSendSuccess)
chatGroup.POST("/set_msg_min_seq", apiChat.SetMsgMinSeq) chatGroup.POST("/set_msg_min_seq", apiChat.SetMsgMinSeq)
chatGroup.POST("/set_message_reaction_extensions", apiChat.SetMessageReactionExtensions)
chatGroup.POST("/get_message_list_reaction_extensions", apiChat.GetMessageListReactionExtensions)
chatGroup.POST("/add_message_reaction_extensions", apiChat.AddMessageReactionExtensions)
chatGroup.POST("/delete_message_reaction_extensions", apiChat.DeleteMessageReactionExtensions)
} }
//Conversation //Conversation
conversationGroup := r.Group("/conversation") conversationGroup := r.Group("/conversation")
@ -232,7 +237,7 @@ func main() {
if config.Config.Api.ListenIP != "" { if config.Config.Api.ListenIP != "" {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort) address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
} }
fmt.Println("start api server, address: ", address, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start api server, address: ", address, ", OpenIM version: ", constant.CurrentVersion)
err := r.Run(address) err := r.Run(address)
if err != nil { if err != nil {
log.Error("", "api run failed ", address, err.Error()) log.Error("", "api run failed ", address, err.Error())

View File

@ -25,6 +25,6 @@ func main() {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort) address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
} }
address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort) address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort)
fmt.Println("start cms api server, address: ", address, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start cms api server, address: ", address, ", OpenIM version: ", constant.CurrentVersion, "\n")
router.Run(address) router.Run(address)
} }

View File

@ -70,7 +70,7 @@ func main() {
address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort) address = config.Config.Api.ListenIP + ":" + strconv.Itoa(*ginPort)
} }
address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort) address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort)
fmt.Println("start demo api server address: ", address, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start demo api server address: ", address, ", OpenIM version: ", constant.CurrentVersion, "\n")
go register.OnboardingProcessRoutine() go register.OnboardingProcessRoutine()
go register.ImportFriendRoutine() go register.ImportFriendRoutine()
err := r.Run(address) err := r.Run(address)

View File

@ -21,7 +21,7 @@ func main() {
flag.Parse() flag.Parse()
var wg sync.WaitGroup var wg sync.WaitGroup
wg.Add(1) wg.Add(1)
fmt.Println("start rpc/msg_gateway server, port: ", *rpcPort, *wsPort, *prometheusPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start rpc/msg_gateway server, port: ", *rpcPort, *wsPort, *prometheusPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
gate.Init(*rpcPort, *wsPort) gate.Init(*rpcPort, *wsPort)
gate.Run(*prometheusPort) gate.Run(*prometheusPort)
wg.Wait() wg.Wait()

View File

@ -17,7 +17,7 @@ func main() {
flag.Parse() flag.Parse()
log.NewPrivateLog(constant.LogFileName) log.NewPrivateLog(constant.LogFileName)
logic.Init() logic.Init()
fmt.Println("start msg_transfer server ", "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start msg_transfer server ", ", OpenIM version: ", constant.CurrentVersion, "\n")
logic.Run(*prometheusPort) logic.Run(*prometheusPort)
wg.Wait() wg.Wait()
} }

View File

@ -18,7 +18,7 @@ func main() {
var wg sync.WaitGroup var wg sync.WaitGroup
wg.Add(1) wg.Add(1)
log.NewPrivateLog(constant.LogFileName) log.NewPrivateLog(constant.LogFileName)
fmt.Println("start push rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start push rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
logic.Init(*rpcPort) logic.Init(*rpcPort)
logic.Run(*prometheusPort) logic.Run(*prometheusPort)
wg.Wait() wg.Wait()

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.AdminCmsPrometheusPort[0], "adminCMSPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.AdminCmsPrometheusPort[0], "adminCMSPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start cms rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start cms rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort) rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800") rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.AuthPrometheusPort[0], "authPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.AuthPrometheusPort[0], "authPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start auth rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start auth rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort) rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -15,7 +15,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800") rpcPort := flag.Int("port", defaultPorts[0], "RpcToken default listen port 10800")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.CachePrometheusPort[0], "cachePrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.CachePrometheusPort[0], "cachePrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start cache rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start cache rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := rpcCache.NewCacheServer(*rpcPort) rpcServer := rpcCache.NewCacheServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "RpcConversation default listen port 11300") rpcPort := flag.Int("port", defaultPorts[0], "RpcConversation default listen port 11300")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.ConversationPrometheusPort[0], "conversationPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.ConversationPrometheusPort[0], "conversationPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start conversation rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start conversation rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := rpcConversation.NewRpcConversationServer(*rpcPort) rpcServer := rpcConversation.NewRpcConversationServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "get RpcFriendPort from cmd,default 12000 as port") rpcPort := flag.Int("port", defaultPorts[0], "get RpcFriendPort from cmd,default 12000 as port")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.FriendPrometheusPort[0], "friendPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.FriendPrometheusPort[0], "friendPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start friend rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start friend rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := friend.NewFriendServer(*rpcPort) rpcServer := friend.NewFriendServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "get RpcGroupPort from cmd,default 16000 as port") rpcPort := flag.Int("port", defaultPorts[0], "get RpcGroupPort from cmd,default 16000 as port")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.GroupPrometheusPort[0], "groupPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.GroupPrometheusPort[0], "groupPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start group rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start group rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := group.NewGroupServer(*rpcPort) rpcServer := group.NewGroupServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.MessagePrometheusPort[0], "msgPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.MessagePrometheusPort[0], "msgPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start msg rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start msg rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := msg.NewRpcChatServer(*rpcPort) rpcServer := msg.NewRpcChatServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OfficePrometheusPort[0], "officePrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OfficePrometheusPort[0], "officePrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start office rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start office rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := rpc.NewOfficeServer(*rpcPort) rpcServer := rpc.NewOfficeServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "get RpcOrganizationPort from cmd,default 11200 as port") rpcPort := flag.Int("port", defaultPorts[0], "get RpcOrganizationPort from cmd,default 11200 as port")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OrganizationPrometheusPort[0], "organizationPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OrganizationPrometheusPort[0], "organizationPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start organization rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start organization rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := organization.NewServer(*rpcPort) rpcServer := organization.NewServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -14,7 +14,7 @@ func main() {
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port") rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.UserPrometheusPort[0], "userPrometheusPort default listen port") prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.UserPrometheusPort[0], "userPrometheusPort default listen port")
flag.Parse() flag.Parse()
fmt.Println("start user rpc server, port: ", *rpcPort, "OpenIM version: ", constant.CurrentVersion, "\n") fmt.Println("start user rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n")
rpcServer := user.NewUserServer(*rpcPort) rpcServer := user.NewUserServer(*rpcPort)
go func() { go func() {
err := promePkg.StartPromeSrv(*prometheusPort) err := promePkg.StartPromeSrv(*prometheusPort)

View File

@ -36,7 +36,7 @@ mongo:
dbPassword: #mongo密码建议先不设置 dbPassword: #mongo密码建议先不设置
dbMaxPoolSize: 100 dbMaxPoolSize: 100
dbRetainChatRecords: 3650 #mongo保存离线消息时间根据需求修改 dbRetainChatRecords: 3650 #mongo保存离线消息时间根据需求修改
chatRecordsClearTime: "* * * * *" # 每天凌晨3点清除消息该配置和linux定时任务一样 清理操作建议设置在用户活跃少的时候 # 0 3 * * * chatRecordsClearTime: "0 3 * * *" # 每天凌晨3点清除消息该配置和linux定时任务一样 清理操作建议设置在用户活跃少的时候 # 0 3 * * *
redis: redis:
dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时填写一个地址即可使用redis集群时候填写集群中多个节点地址主从地址都可以填写增加容灾能力默认即可 dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时填写一个地址即可使用redis集群时候填写集群中多个节点地址主从地址都可以填写增加容灾能力默认即可
@ -62,12 +62,15 @@ kafka:
ms2pschat: ms2pschat:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可 addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "ms2ps_chat" #消息push topic: "ms2ps_chat" #消息push
msgtomodify:
addr: [ 127.0.0.1:9092 ] #kafka配置默认即可
topic: "msg_to_modify"
consumergroupid: consumergroupid:
msgToTransfer: mongo msgToTransfer: mongo
msgToMongo: mongo_ex msgToMongo: mongo_ex
msgToMySql: mysql msgToMySql: mysql
msgToPush: push msgToPush: push
msgToModify: modify
#---------------Internal service configuration---------------------# #---------------Internal service configuration---------------------#
@ -345,10 +348,15 @@ callback:
enable: false enable: false
callbackTimeOut: 2 callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续 callbackFailedContinue: true # 回调超时是否继续
callbackBeforeExtendMsgModify: callbackBeforeSetGroupMemberInfo:
enable: false enable: false
callbackTimeOut: 2 callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续 callbackFailedContinue: true # 回调超时是否继续
callbackSetMessageReactionExtensions:
enable: false
callbackTimeOut: 2
callbackFailedContinue: true # 回调超时是否继续
notification: notification:
groupCreated: groupCreated:

View File

@ -115,7 +115,7 @@ services:
open_im_server: open_im_server:
image: openim/open_im_server:v2.3.5 image: openim/open_im_server:v2.3.7
container_name: open_im_server container_name: open_im_server
volumes: volumes:
- ./logs:/Open-IM-Server/logs - ./logs:/Open-IM-Server/logs
@ -139,7 +139,7 @@ services:
max-file: "2" max-file: "2"
open_im_enterprise: open_im_enterprise:
image: openim/open_im_enterprise:v1.0.0 image: openim/open_im_enterprise:v1.0.3
container_name: open_im_enterprise container_name: open_im_enterprise
volumes: volumes:
- ./logs:/Open-IM-Enterprise/logs - ./logs:/Open-IM-Enterprise/logs

View File

@ -1,4 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
internet_ip=`curl ifconfig.me -s`
echo $internet_ip
source .env
echo $MINIO_ENDPOINT
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
fi
cd script ; cd script ;
chmod +x *.sh ; chmod +x *.sh ;

View File

@ -38,6 +38,7 @@ func SetOptions(options map[string]bool, value bool) {
func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq { func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
var newContent string var newContent string
options := make(map[string]bool, 5)
var err error var err error
switch params.ContentType { switch params.ContentType {
case constant.Text: case constant.Text:
@ -57,12 +58,13 @@ func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
case constant.CustomOnlineOnly: case constant.CustomOnlineOnly:
fallthrough fallthrough
case constant.AdvancedRevoke: case constant.AdvancedRevoke:
utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false)
newContent = utils.StructToJsonString(params.Content) newContent = utils.StructToJsonString(params.Content)
case constant.Revoke: case constant.Revoke:
utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false)
newContent = params.Content["revokeMsgClientID"].(string) newContent = params.Content["revokeMsgClientID"].(string)
default: default:
} }
options := make(map[string]bool, 5)
if params.IsOnlineOnly { if params.IsOnlineOnly {
SetOptions(options, false) SetOptions(options, false)
} }

View File

@ -0,0 +1,207 @@
package msg
import (
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
rpc "Open_IM/pkg/proto/msg"
"Open_IM/pkg/utils"
"context"
"github.com/gin-gonic/gin"
"net/http"
"strings"
)
func SetMessageReactionExtensions(c *gin.Context) {
var (
req api.SetMessageReactionExtensionsReq
resp api.SetMessageReactionExtensionsResp
reqPb rpc.SetMessageReactionExtensionsReq
)
if err := c.BindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req)
if err := utils.CopyStructFields(&reqPb, &req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error())
}
var ok bool
var errInfo string
ok, reqPb.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.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID)
if grpcConn == nil {
errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := rpc.NewMsgClient(grpcConn)
respPb, err := msgClient.SetMessageReactionExtensions(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()})
return
}
resp.ErrCode = respPb.ErrCode
resp.ErrMsg = respPb.ErrMsg
resp.Data.ResultKeyValue = respPb.Result
resp.Data.MsgFirstModifyTime = reqPb.MsgFirstModifyTime
resp.Data.IsReact = reqPb.IsReact
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp)
c.JSON(http.StatusOK, resp)
}
func GetMessageListReactionExtensions(c *gin.Context) {
var (
req api.GetMessageListReactionExtensionsReq
resp api.GetMessageListReactionExtensionsResp
reqPb rpc.GetMessageListReactionExtensionsReq
)
if err := c.BindJSON(&req); err != nil {
c.JSON(http.StatusOK, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req)
if err := utils.CopyStructFields(&reqPb, &req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error())
}
var ok bool
var errInfo string
ok, reqPb.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.StatusOK, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID)
if grpcConn == nil {
errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := rpc.NewMsgClient(grpcConn)
respPb, err := msgClient.GetMessageListReactionExtensions(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()})
return
}
resp.ErrCode = respPb.ErrCode
resp.ErrMsg = respPb.ErrMsg
resp.Data = respPb.SingleMessageResult
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp)
c.JSON(http.StatusOK, resp)
}
func AddMessageReactionExtensions(c *gin.Context) {
var (
req api.AddMessageReactionExtensionsReq
resp api.AddMessageReactionExtensionsResp
reqPb rpc.AddMessageReactionExtensionsReq
)
if err := c.BindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req)
if err := utils.CopyStructFields(&reqPb, &req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error())
}
var ok bool
var errInfo string
ok, reqPb.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.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID)
if grpcConn == nil {
errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := rpc.NewMsgClient(grpcConn)
respPb, err := msgClient.AddMessageReactionExtensions(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()})
return
}
resp.ErrCode = respPb.ErrCode
resp.ErrMsg = respPb.ErrMsg
resp.Data.ResultKeyValue = respPb.Result
resp.Data.MsgFirstModifyTime = respPb.MsgFirstModifyTime
resp.Data.IsReact = respPb.IsReact
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp)
c.JSON(http.StatusOK, resp)
}
func DeleteMessageReactionExtensions(c *gin.Context) {
var (
req api.DeleteMessageReactionExtensionsReq
resp api.DeleteMessageReactionExtensionsResp
reqPb rpc.DeleteMessageListReactionExtensionsReq
)
if err := c.BindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
return
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req)
if err := utils.CopyStructFields(&reqPb, &req); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error())
}
var ok bool
var errInfo string
ok, reqPb.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.StatusBadRequest, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, req.OperationID)
if grpcConn == nil {
errMsg := req.OperationID + " getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return
}
msgClient := rpc.NewMsgClient(grpcConn)
respPb, err := msgClient.DeleteMessageReactionExtensions(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()})
return
}
resp.ErrCode = respPb.ErrCode
resp.ErrMsg = respPb.ErrMsg
resp.Data = respPb.Result
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), resp)
c.JSON(http.StatusOK, resp)
}

View File

@ -7,11 +7,12 @@ import (
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
server_api_params "Open_IM/pkg/proto/sdk_ws" server_api_params "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
goRedis "github.com/go-redis/redis/v8"
"github.com/golang/protobuf/proto"
"math" "math"
"strconv" "strconv"
"strings" "strings"
goRedis "github.com/go-redis/redis/v8"
"github.com/golang/protobuf/proto"
) )
const oldestList = 0 const oldestList = 0
@ -105,59 +106,45 @@ func deleteMongoMsg(operationID string, ID string, index int64, delStruct *delMs
if len(msgs.Msg) > db.GetSingleGocMsgNum() { if len(msgs.Msg) > db.GetSingleGocMsgNum() {
log.NewWarn(operationID, utils.GetSelfFuncName(), "msgs too large", len(msgs.Msg), msgs.UID) log.NewWarn(operationID, utils.GetSelfFuncName(), "msgs too large", len(msgs.Msg), msgs.UID)
} }
var hasMsgDoNotNeedDel bool if msgs.Msg[len(msgs.Msg)-1].SendTime+(int64(config.Config.Mongo.DBRetainChatRecords)*24*60*60*1000) < utils.GetCurrentTimestampByMill() && msgListIsFull(msgs) {
for i, msg := range msgs.Msg { delStruct.delUidList = append(delStruct.delUidList, msgs.UID)
// 找到列表中不需要删除的消息了, 表示为递归到最后一个块
if utils.GetCurrentTimestampByMill() < msg.SendTime+(int64(config.Config.Mongo.DBRetainChatRecords)*24*60*60*1000) {
log.NewDebug(operationID, ID, "find uid", msgs.UID)
// 删除块失败 递归结束 返回0
hasMsgDoNotNeedDel = true
if err := delMongoMsgsPhysical(delStruct.delUidList); err != nil {
return 0, err
}
// unMarshall失败 块删除成功 设置为最小seq
msgPb := &server_api_params.MsgData{}
if err = proto.Unmarshal(msg.Msg, msgPb); err != nil {
return delStruct.getSetMinSeq(), utils.Wrap(err, "")
}
// 如果不是块中第一个,就把前面比他早插入的全部设置空 seq字段除外。
if i > 0 {
delStruct.minSeq, err = db.DB.ReplaceMsgToBlankByIndex(msgs.UID, i-1)
if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), msgs.UID, i)
return delStruct.getSetMinSeq(), utils.Wrap(err, "")
}
}
// 递归结束
return msgPb.Seq, nil
} else {
if !msgListIsFull(msgs) {
}
}
}
// 该列表中消息全部为老消息并且列表满了, 加入删除列表继续递归
lastMsgPb := &server_api_params.MsgData{} lastMsgPb := &server_api_params.MsgData{}
err = proto.Unmarshal(msgs.Msg[len(msgs.Msg)-1].Msg, lastMsgPb) err = proto.Unmarshal(msgs.Msg[len(msgs.Msg)-1].Msg, lastMsgPb)
if err != nil { if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), len(msgs.Msg)-1, msgs.UID) log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), len(msgs.Msg)-1, msgs.UID)
return 0, utils.Wrap(err, "proto.Unmarshal failed") return 0, utils.Wrap(err, "proto.Unmarshal failed")
} }
delStruct.minSeq = lastMsgPb.Seq delStruct.minSeq = lastMsgPb.Seq + 1
if msgListIsFull(msgs) { log.NewDebug(operationID, utils.GetSelfFuncName(), msgs.UID, "add to delUidList", "minSeq", lastMsgPb.Seq+1)
log.NewDebug(operationID, "msg list is full", msgs.UID)
delStruct.delUidList = append(delStruct.delUidList, msgs.UID)
} else { } else {
// 列表没有满且没有不需要被删除的消息 代表他是最新的消息块 var hasMarkDelFlag bool
if !hasMsgDoNotNeedDel { for index, msg := range msgs.Msg {
delStruct.minSeq, err = db.DB.ReplaceMsgToBlankByIndex(msgs.UID, len(msgs.Msg)-1) if msg.SendTime == 0 {
if err != nil { continue
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), msgs.UID, "Index:", len(msgs.Msg)-1)
err = delMongoMsgsPhysical(delStruct.delUidList)
if err != nil {
return delStruct.getSetMinSeq(), err
} }
return delStruct.getSetMinSeq(), nil msgPb := &server_api_params.MsgData{}
err = proto.Unmarshal(msg.Msg, msgPb)
if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), len(msgs.Msg)-1, msgs.UID)
return 0, utils.Wrap(err, "proto.Unmarshal failed")
}
if utils.GetCurrentTimestampByMill() > msg.SendTime+(int64(config.Config.Mongo.DBRetainChatRecords)*24*60*60*1000) {
msgPb.Status = constant.MsgDeleted
bytes, _ := proto.Marshal(msgPb)
msgs.Msg[index].Msg = bytes
msgs.Msg[index].SendTime = 0
hasMarkDelFlag = true
} else {
if err := delMongoMsgsPhysical(delStruct.delUidList); err != nil {
return 0, err
}
if hasMarkDelFlag {
log.NewInfo(operationID, ID, "hasMarkDelFlag", "index:", index, "msgPb:", msgPb, msgs.UID)
if err := db.DB.UpdateOneMsgList(msgs); err != nil {
return delStruct.getSetMinSeq(), utils.Wrap(err, "")
}
}
return msgPb.Seq, nil
} }
} }
} }
@ -180,14 +167,6 @@ func msgListIsFull(chat *db.UserChat) bool {
return false return false
} }
func CheckGroupUserMinSeq(operationID, groupID, userID string) error {
return nil
}
func CheckUserMinSeqWithMongo(operationID, userID string) error {
return nil
}
func checkMaxSeqWithMongo(operationID, ID string, diffusionType int) error { func checkMaxSeqWithMongo(operationID, ID string, diffusionType int) error {
var seqRedis uint64 var seqRedis uint64
var err error var err error

View File

@ -3,22 +3,31 @@ package cronTask
import ( import (
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
pbMsg "Open_IM/pkg/proto/msg"
server_api_params "Open_IM/pkg/proto/sdk_ws" server_api_params "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"os/exec" "context"
"fmt"
"strconv"
"github.com/go-redis/redis/v8"
"github.com/golang/protobuf/proto"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"gopkg.in/mgo.v2/bson"
"testing" "testing"
"time" "time"
) )
func getMsgListFake(num int) []*pbMsg.MsgDataToMQ { var (
var msgList []*pbMsg.MsgDataToMQ redisClient *redis.Client
for i := 1; i < num; i++ { mongoClient *mongo.Collection
msgList = append(msgList, &pbMsg.MsgDataToMQ{ )
Token: "tk",
OperationID: "operationID", func GenUserChat(startSeq, stopSeq, delSeq, index uint32, userID string) *db.UserChat {
MsgData: &server_api_params.MsgData{ chat := &db.UserChat{UID: userID + ":" + strconv.Itoa(int(index))}
for i := startSeq; i <= stopSeq; i++ {
msg := server_api_params.MsgData{
SendID: "sendID1", SendID: "sendID1",
RecvID: "recvID1", RecvID: "recvID1",
GroupID: "", GroupID: "",
@ -35,68 +44,183 @@ func getMsgListFake(num int) []*pbMsg.MsgDataToMQ {
SendTime: time.Now().Unix(), SendTime: time.Now().Unix(),
CreateTime: time.Now().Unix(), CreateTime: time.Now().Unix(),
Status: 1, Status: 1,
},
})
} }
return msgList bytes, _ := proto.Marshal(&msg)
var sendTime int64
if i <= delSeq {
sendTime = 10000
} else {
sendTime = utils.GetCurrentTimestampByMill()
}
chat.Msg = append(chat.Msg, db.MsgInfo{SendTime: int64(sendTime), Msg: bytes})
}
return chat
}
func SetUserMaxSeq(userID string, seq int) error {
return redisClient.Set(context.Background(), "REDIS_USER_INCR_SEQ"+userID, seq, 0).Err()
}
func GetUserMinSeq(userID string) (uint64, error) {
key := "REDIS_USER_MIN_SEQ:" + userID
seq, err := redisClient.Get(context.Background(), key).Result()
return uint64(utils.StringToInt(seq)), err
}
func CreateChat(userChat *db.UserChat) error {
_, err := mongoClient.InsertOne(context.Background(), userChat)
return err
}
func DelChat(uid string, index int) error {
_, err := mongoClient.DeleteOne(context.Background(), bson.M{"uid": uid + ":" + strconv.Itoa(index)})
return err
} }
func TestDeleteMongoMsgAndResetRedisSeq(t *testing.T) { func TestDeleteMongoMsgAndResetRedisSeq(t *testing.T) {
operationID := getCronTaskOperationID() operationID := getCronTaskOperationID()
redisClient = redis.NewClient(&redis.Options{
Addr: "127.0.0.1:16379",
Password: "openIM123", // no password set
DB: 0, // use default DB
})
mongoUri := fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d&authSource=admin",
"root", "openIM123", "127.0.0.1:37017",
"openIM", 100)
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(mongoUri))
mongoClient = client.Database("openIM").Collection("msg")
testUID1 := "test_del_id1" testUID1 := "test_del_id1"
//testUID2 := "test_del_id2" err = DelChat(testUID1, 0)
//testUID3 := "test_del_id3" err = SetUserMaxSeq(testUID1, 600)
//testUID4 := "test_del_id4" userChat := GenUserChat(1, 600, 200, 0, testUID1)
//testUID5 := "test_del_id5" err = CreateChat(userChat)
//testUID6 := "test_del_id6" if err := DeleteMongoMsgAndResetRedisSeq(operationID, testUID1); err != nil {
testUserIDList := []string{testUID1} t.Error("checkMaxSeqWithMongo failed", testUID1)
}
err := db.DB.SetUserMaxSeq(testUID1, 500) if err := checkMaxSeqWithMongo(operationID, testUID1, constant.WriteDiffusion); err != nil {
err = db.DB.BatchInsertChat2DB(testUID1, getMsgListFake(500), testUID1+"-"+operationID, 500) t.Error("checkMaxSeqWithMongo failed", testUID1)
}
minSeq, err := GetUserMinSeq(testUID1)
if err != nil { if err != nil {
t.Error(err.Error(), testUID1) t.Error("err is not nil", testUID1, err.Error())
} }
//db.DB.SetUserMaxSeq(testUID1, 6000) if minSeq != 201 {
//db.DB.BatchInsertChat2DB() t.Error("test1 is not the same", "minSeq:", minSeq, "targetSeq", 201)
// }
//db.DB.SetUserMaxSeq(testUID1, 4999)
//db.DB.BatchInsertChat2DB() testUID2 := "test_del_id2"
// err = DelChat(testUID2, 0)
//db.DB.SetUserMaxSeq(testUID1, 30000) err = DelChat(testUID2, 1)
//db.DB.BatchInsertChat2DB() err = SetUserMaxSeq(testUID2, 7000)
// userChat = GenUserChat(1, 4999, 5000, 0, testUID2)
//db.DB.SetUserMaxSeq(testUID1, 9999) userChat2 := GenUserChat(5000, 7000, 6000, 1, testUID2)
//db.DB.BatchInsertChat2DB() err = CreateChat(userChat)
cmd := exec.Command("/bin/bash", "unset $CONFIG_NAME") err = CreateChat(userChat2)
_, err = cmd.StdoutPipe()
if err := DeleteMongoMsgAndResetRedisSeq(operationID, testUID2); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID2)
}
if err := checkMaxSeqWithMongo(operationID, testUID2, constant.WriteDiffusion); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID2)
}
minSeq, err = GetUserMinSeq(testUID2)
if err != nil { if err != nil {
return t.Error("err is not nil", testUID2, err.Error())
}
if minSeq != 6001 {
t.Error("test2 is not the same", "minSeq:", minSeq, "targetSeq", 6001)
} }
//执行命令 testUID3 := "test_del_id3"
if err := cmd.Start(); err != nil { err = DelChat(testUID3, 0)
return err = SetUserMaxSeq(testUID3, 4999)
userChat = GenUserChat(1, 4999, 5000, 0, testUID3)
err = CreateChat(userChat)
if err := DeleteMongoMsgAndResetRedisSeq(operationID, testUID3); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID3)
} }
for _, userID := range testUserIDList { if err := checkMaxSeqWithMongo(operationID, testUID3, constant.WriteDiffusion); err != nil {
operationID = userID + "-" + operationID t.Error("checkMaxSeqWithMongo failed", testUID3)
if err := DeleteMongoMsgAndResetRedisSeq(operationID, userID); err != nil {
t.Error("checkMaxSeqWithMongo failed", userID)
} }
if err := checkMaxSeqWithMongo(operationID, userID, constant.WriteDiffusion); err != nil { minSeq, err = GetUserMinSeq(testUID3)
t.Error("checkMaxSeqWithMongo failed", userID) if err != nil {
t.Error("err is not nil", testUID3, err.Error())
} }
if minSeq != 5000 {
t.Error("test3 is not the same", "minSeq:", minSeq, "targetSeq", 5000)
} }
testWorkingGroupIDList := []string{"test_del_id1", "test_del_id2", "test_del_id3", "test_del_id4", "test_del_id5"} testUID4 := "test_del_id4"
for _, groupID := range testWorkingGroupIDList { err = DelChat(testUID4, 0)
operationID = groupID + "-" + operationID err = DelChat(testUID4, 1)
log.NewDebug(operationID, utils.GetSelfFuncName(), "groupID:", groupID, "userIDList:", testUserIDList) err = DelChat(testUID4, 2)
if err := ResetUserGroupMinSeq(operationID, groupID, testUserIDList); err != nil { err = SetUserMaxSeq(testUID4, 12000)
t.Error("checkMaxSeqWithMongo failed", groupID) userChat = GenUserChat(1, 4999, 5000, 0, testUID4)
} userChat2 = GenUserChat(5000, 9999, 10000, 1, testUID4)
if err := checkMaxSeqWithMongo(operationID, groupID, constant.ReadDiffusion); err != nil { userChat3 := GenUserChat(10000, 12000, 11000, 2, testUID4)
t.Error("checkMaxSeqWithMongo failed", groupID) err = CreateChat(userChat)
err = CreateChat(userChat2)
err = CreateChat(userChat3)
if err := DeleteMongoMsgAndResetRedisSeq(operationID, testUID4); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID4)
} }
if err := checkMaxSeqWithMongo(operationID, testUID4, constant.WriteDiffusion); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID4)
}
minSeq, err = GetUserMinSeq(testUID4)
if err != nil {
t.Error("err is not nil", testUID4, err.Error())
}
if minSeq != 11001 {
t.Error("test4 is not the same", "minSeq:", minSeq, "targetSeq", 11001)
}
testUID5 := "test_del_id5"
err = DelChat(testUID5, 0)
err = DelChat(testUID5, 1)
err = SetUserMaxSeq(testUID5, 9999)
userChat = GenUserChat(1, 4999, 5000, 0, testUID5)
userChat2 = GenUserChat(5000, 9999, 10000, 1, testUID5)
err = CreateChat(userChat)
err = CreateChat(userChat2)
if err := DeleteMongoMsgAndResetRedisSeq(operationID, testUID5); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID4)
}
if err := checkMaxSeqWithMongo(operationID, testUID5, constant.WriteDiffusion); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID5)
}
minSeq, err = GetUserMinSeq(testUID5)
if err != nil {
t.Error("err is not nil", testUID5, err.Error())
}
if minSeq != 10000 {
t.Error("test5 is not the same", "minSeq:", minSeq, "targetSeq", 10000)
}
testUID6 := "test_del_id6"
err = DelChat(testUID5, 0)
err = DelChat(testUID5, 1)
err = DelChat(testUID5, 2)
err = DelChat(testUID5, 3)
userChat = GenUserChat(1, 4999, 5000, 0, testUID6)
userChat2 = GenUserChat(5000, 9999, 10000, 1, testUID6)
userChat3 = GenUserChat(10000, 14999, 13000, 2, testUID6)
userChat4 := GenUserChat(15000, 19999, 0, 3, testUID6)
err = CreateChat(userChat)
err = CreateChat(userChat2)
err = CreateChat(userChat3)
err = CreateChat(userChat4)
if err := DeleteMongoMsgAndResetRedisSeq(operationID, testUID6); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID6)
}
if err := checkMaxSeqWithMongo(operationID, testUID6, constant.WriteDiffusion); err != nil {
t.Error("checkMaxSeqWithMongo failed", testUID6)
}
minSeq, err = GetUserMinSeq(testUID6)
if err != nil {
t.Error("err is not nil", testUID6, err.Error())
}
if minSeq != 13001 {
t.Error("test3 is not the same", "minSeq:", minSeq, "targetSeq", 13001)
} }
} }

View File

@ -8,8 +8,9 @@ import (
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"fmt" "fmt"
"github.com/robfig/cron/v3"
"time" "time"
"github.com/robfig/cron/v3"
) )
const cronTaskOperationID = "cronTaskOperationID-" const cronTaskOperationID = "cronTaskOperationID-"
@ -57,6 +58,7 @@ func ClearAll() {
} else { } else {
log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) log.NewError(operationID, utils.GetSelfFuncName(), err.Error())
} }
// working group msg clear // working group msg clear
workingGroupIDList, err := im_mysql_model.GetGroupIDListByGroupType(constant.WorkingGroup) workingGroupIDList, err := im_mysql_model.GetGroupIDListByGroupType(constant.WorkingGroup)
if err == nil { if err == nil {
@ -77,9 +79,6 @@ func StartClearMsg(operationID string, userIDList []string) {
if err := checkMaxSeqWithMongo(operationID, userID, constant.WriteDiffusion); err != nil { if err := checkMaxSeqWithMongo(operationID, userID, constant.WriteDiffusion); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), userID, err) log.NewError(operationID, utils.GetSelfFuncName(), userID, err)
} }
if err := CheckUserMinSeqWithMongo(operationID, userID); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), userID, err)
}
} }
} }
@ -98,10 +97,5 @@ func StartClearWorkingGroupMsg(operationID string, workingGroupIDList []string)
if err := checkMaxSeqWithMongo(operationID, groupID, constant.ReadDiffusion); err != nil { if err := checkMaxSeqWithMongo(operationID, groupID, constant.ReadDiffusion); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), groupID, err) log.NewError(operationID, utils.GetSelfFuncName(), groupID, err)
} }
for _, userID := range userIDList {
if err := CheckGroupUserMinSeq(operationID, groupID, userID); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), groupID, err)
}
}
} }
} }

View File

@ -1,6 +0,0 @@
package main
//
//func main() {
// db.DB.BatchInsertChat()
//}

View File

@ -186,8 +186,10 @@ func (ws *WServer) pullMsgBySeqListResp(conn *UserConn, m *Req, pb *sdk_ws.PullM
} }
func (ws *WServer) userLogoutReq(conn *UserConn, m *Req) { func (ws *WServer) userLogoutReq(conn *UserConn, m *Req) {
log.NewInfo(m.OperationID, "Ws call success to userLogoutReq start", m.SendID, m.ReqIdentifier, m.MsgIncr, string(m.Data)) log.NewInfo(m.OperationID, "Ws call success to userLogoutReq start", m.SendID, m.ReqIdentifier, m.MsgIncr, string(m.Data))
rpcReq := push.DelUserPushTokenReq{} rpcReq := push.DelUserPushTokenReq{}
rpcReq.UserID = m.SendID rpcReq.UserID = m.SendID
rpcReq.PlatformID = conn.PlatformID
rpcReq.OperationID = m.OperationID rpcReq.OperationID = m.OperationID
grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName, m.OperationID) grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName, m.OperationID)
if grpcConn == nil { if grpcConn == nil {

View File

@ -225,6 +225,54 @@ func (r *RPCServer) SuperGroupOnlineBatchPushOneMsg(_ context.Context, req *pbRe
SinglePushResult: singleUserResult, SinglePushResult: singleUserResult,
}, nil }, nil
} }
func (r *RPCServer) SuperGroupBackgroundOnlinePush(_ 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 && userConn.IsBackground {
temp := &pbRelay.SingleMsgToUserPlatform{
RecvID: v,
RecvPlatFormID: int32(platform),
}
if constant.PlatformIDToClass(int(userConn.PlatformID)) == constant.TerminalPC || userConn.PlatformID == constant.WebPlatformID {
resultCode := sendMsgBatchToUser(userConn, replyBytes.Bytes(), req, platform, v)
if resultCode == 0 && utils.IsContainInt(platform, r.pushTerminal) {
tempT.OnlinePush = true
promePkg.PromeInc(promePkg.MsgOnlinePushSuccessCounter)
log.Info(req.OperationID, "PushSuperMsgToUser is success By Ws", "args", req.String(), "recvPlatForm", constant.PlatformIDToName(platform), "recvID", v)
temp.ResultCode = resultCode
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) { func (r *RPCServer) OnlineBatchPushOneMsg(_ context.Context, req *pbRelay.OnlineBatchPushOneMsgReq) (*pbRelay.OnlineBatchPushOneMsgResp, error) {
log.NewInfo(req.OperationID, "BatchPushMsgToUser is arriving", req.String()) log.NewInfo(req.OperationID, "BatchPushMsgToUser is arriving", req.String())
var singleUserResult []*pbRelay.SingelMsgToUserResultList var singleUserResult []*pbRelay.SingelMsgToUserResultList
@ -328,7 +376,7 @@ func (r *RPCServer) KickUserOffline(_ context.Context, req *pbRelay.KickUserOffl
oldConnMap := ws.getUserAllCons(v) oldConnMap := ws.getUserAllCons(v)
if conn, ok := oldConnMap[int(req.PlatformID)]; ok { // user->map[platform->conn] if conn, ok := oldConnMap[int(req.PlatformID)]; ok { // user->map[platform->conn]
log.NewWarn(req.OperationID, "send kick msg, close connection ", req.PlatformID, v) log.NewWarn(req.OperationID, "send kick msg, close connection ", req.PlatformID, v)
ws.sendKickMsg(conn) ws.sendKickMsg(conn, req.OperationID)
conn.Close() conn.Close()
} }
} }

View File

@ -253,7 +253,7 @@ func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn
if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn] if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn]
if oldConn, ok := oldConnMap[platformID]; ok { if oldConn, ok := oldConnMap[platformID]; ok {
log.NewDebug(operationID, uid, platformID, "kick old conn") log.NewDebug(operationID, uid, platformID, "kick old conn")
ws.sendKickMsg(oldConn) ws.sendKickMsg(oldConn, operationID)
m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID)) m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID))
if err != nil && err != go_redis.Nil { if err != nil && err != go_redis.Nil {
log.NewError(operationID, "get token from redis err", err.Error(), uid, constant.PlatformIDToName(platformID)) log.NewError(operationID, "get token from redis err", err.Error(), uid, constant.PlatformIDToName(platformID))
@ -302,11 +302,12 @@ func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn
case constant.WebAndOther: case constant.WebAndOther:
} }
} }
func (ws *WServer) sendKickMsg(oldConn *UserConn) { func (ws *WServer) sendKickMsg(oldConn *UserConn, operationID string) {
mReply := Resp{ mReply := Resp{
ReqIdentifier: constant.WSKickOnlineMsg, ReqIdentifier: constant.WSKickOnlineMsg,
ErrCode: constant.ErrTokenInvalid.ErrCode, ErrCode: constant.ErrTokenInvalid.ErrCode,
ErrMsg: constant.ErrTokenInvalid.ErrMsg, ErrMsg: constant.ErrTokenInvalid.ErrMsg,
OperationID: operationID,
} }
var b bytes.Buffer var b bytes.Buffer
enc := gob.NewEncoder(&b) enc := gob.NewEncoder(&b)
@ -388,7 +389,10 @@ func (ws *WServer) delUserConn(conn *UserConn) {
if err != nil { if err != nil {
log.Error(operationID, " close err", "", "uid", uid, "platform", platform) log.Error(operationID, " close err", "", "uid", uid, "platform", platform)
} }
callbackResp := callbackUserOffline(operationID, conn.userID, platform, conn.connID) if conn.PlatformID == 0 || conn.connID == "" {
log.NewWarn(operationID, utils.GetSelfFuncName(), "PlatformID or connID is null", conn.PlatformID, conn.connID)
}
callbackResp := callbackUserOffline(operationID, conn.userID, int(conn.PlatformID), conn.connID)
if callbackResp.ErrCode != 0 { if callbackResp.ErrCode != 0 {
log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp)
} }

View File

@ -22,7 +22,9 @@ var (
persistentCH PersistentConsumerHandler persistentCH PersistentConsumerHandler
historyCH OnlineHistoryRedisConsumerHandler historyCH OnlineHistoryRedisConsumerHandler
historyMongoCH OnlineHistoryMongoConsumerHandler historyMongoCH OnlineHistoryMongoConsumerHandler
modifyCH ModifyMsgConsumerHandler
producer *kafka.Producer producer *kafka.Producer
producerToModify *kafka.Producer
producerToMongo *kafka.Producer producerToMongo *kafka.Producer
cmdCh chan Cmd2Value cmdCh chan Cmd2Value
onlineTopicStatus int onlineTopicStatus int
@ -43,11 +45,13 @@ func Init() {
persistentCH.Init() // ws2mschat save mysql persistentCH.Init() // ws2mschat save mysql
historyCH.Init(cmdCh) // historyCH.Init(cmdCh) //
historyMongoCH.Init() historyMongoCH.Init()
modifyCH.Init()
onlineTopicStatus = OnlineTopicVacancy onlineTopicStatus = OnlineTopicVacancy
//offlineHistoryCH.Init(cmdCh) //offlineHistoryCH.Init(cmdCh)
statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval) 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) 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) producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic)
producerToModify = kafka.NewKafkaProducer(config.Config.Kafka.MsgToModify.Addr, config.Config.Kafka.MsgToModify.Topic)
producerToMongo = kafka.NewKafkaProducer(config.Config.Kafka.MsgToMongo.Addr, config.Config.Kafka.MsgToMongo.Topic) producerToMongo = kafka.NewKafkaProducer(config.Config.Kafka.MsgToMongo.Addr, config.Config.Kafka.MsgToMongo.Topic)
} }
func Run(promethuesPort int) { func Run(promethuesPort int) {
@ -59,6 +63,7 @@ func Run(promethuesPort int) {
} }
go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH) go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH)
go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH) go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH)
go modifyCH.modifyMsgConsumerGroup.RegisterHandleAndConsumer(&modifyCH)
//go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH) //go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH)
go func() { go func() {
err := promePkg.StartPromeSrv(promethuesPort) err := promePkg.StartPromeSrv(promethuesPort)

View File

@ -0,0 +1,121 @@
package logic
import (
"Open_IM/pkg/base_info"
"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/msg"
server_api_params "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"encoding/json"
"github.com/Shopify/sarama"
"github.com/golang/protobuf/proto"
)
type ModifyMsgConsumerHandler struct {
msgHandle map[string]fcb
modifyMsgConsumerGroup *kfk.MConsumerGroup
}
func (mmc *ModifyMsgConsumerHandler) Init() {
mmc.msgHandle = make(map[string]fcb)
mmc.msgHandle[config.Config.Kafka.MsgToModify.Topic] = mmc.ModifyMsg
mmc.modifyMsgConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V2_0_0_0,
OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.MsgToModify.Topic},
config.Config.Kafka.MsgToModify.Addr, config.Config.Kafka.ConsumerGroupID.MsgToModify)
}
func (ModifyMsgConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil }
func (ModifyMsgConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil }
func (mmc *ModifyMsgConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
claim sarama.ConsumerGroupClaim) error {
for msg := range claim.Messages() {
log.NewDebug("", "kafka get info to mysql", "ModifyMsgConsumerHandler", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value), "key", string(msg.Key))
if len(msg.Value) != 0 {
mmc.msgHandle[msg.Topic](msg, string(msg.Key), sess)
} else {
log.Error("", "msg get from kafka but is nil", msg.Key)
}
sess.MarkMessage(msg, "")
}
return nil
}
func (mmc *ModifyMsgConsumerHandler) ModifyMsg(cMsg *sarama.ConsumerMessage, msgKey string, _ sarama.ConsumerGroupSession) {
log.NewInfo("msg come here ModifyMsg!!!", "", "msg", string(cMsg.Value), msgKey)
msgFromMQ := pbMsg.MsgDataToModifyByMQ{}
err := proto.Unmarshal(cMsg.Value, &msgFromMQ)
if err != nil {
log.NewError(msgFromMQ.TriggerID, "msg_transfer Unmarshal msg err", "msg", string(cMsg.Value), "err", err.Error())
return
}
log.Debug(msgFromMQ.TriggerID, "proto.Unmarshal MsgDataToMQ", msgFromMQ.String())
for _, msgDataToMQ := range msgFromMQ.MessageList {
isReactionFromCache := utils.GetSwitchFromOptions(msgDataToMQ.MsgData.Options, constant.IsReactionFromCache)
if !isReactionFromCache {
continue
}
if msgDataToMQ.MsgData.ContentType == constant.ReactionMessageModifier {
notification := &base_info.ReactionMessageModifierNotification{}
if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil {
continue
}
if notification.IsExternalExtensions {
log.NewInfo(msgDataToMQ.OperationID, "msg:", notification, "this is external extensions")
continue
}
if !notification.IsReact {
// first time to modify
var reactionExtensionList = make(map[string]db.KeyValue)
extendMsg := db.ExtendMsg{
ReactionExtensionList: reactionExtensionList,
ClientMsgID: notification.ClientMsgID,
MsgFirstModifyTime: notification.MsgFirstModifyTime,
}
for _, v := range notification.SuccessReactionExtensionList {
reactionExtensionList[v.TypeKey] = db.KeyValue{
TypeKey: v.TypeKey,
Value: v.Value,
LatestUpdateTime: v.LatestUpdateTime,
}
}
if err := db.DB.InsertExtendMsg(notification.SourceID, notification.SessionType, &extendMsg); err != nil {
log.NewError(msgDataToMQ.OperationID, "MsgFirstModify InsertExtendMsg failed", notification.SourceID, notification.SessionType, extendMsg, err.Error())
continue
}
} else {
var reactionExtensionList = make(map[string]*server_api_params.KeyValue)
for _, v := range notification.SuccessReactionExtensionList {
reactionExtensionList[v.TypeKey] = &server_api_params.KeyValue{
TypeKey: v.TypeKey,
Value: v.Value,
LatestUpdateTime: v.LatestUpdateTime,
}
}
// is already modify
if err := db.DB.InsertOrUpdateReactionExtendMsgSet(notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, reactionExtensionList); err != nil {
log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed")
}
}
} else if msgDataToMQ.MsgData.ContentType == constant.ReactionMessageDeleter {
notification := &base_info.ReactionMessageDeleteNotification{}
if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil {
continue
}
if err := db.DB.DeleteReactionExtendMsgSet(notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, notification.SuccessReactionExtensionList); err != nil {
log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed")
}
}
}
}
func UnMarshallSetReactionMsgContent(content []byte) (notification *base_info.ReactionMessageModifierNotification, err error) {
return notification, nil
}

View File

@ -72,6 +72,7 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) {
storageMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) storageMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80)
notStoragePushMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80) notStoragePushMsgList := make([]*pbMsg.MsgDataToMQ, 0, 80)
log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.aggregationID, len(msgList)) log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.aggregationID, len(msgList))
var modifyMsgList []*pbMsg.MsgDataToMQ
for _, v := range msgList { for _, v := range msgList {
log.Debug(triggerID, "msg come to storage center", v.String()) log.Debug(triggerID, "msg come to storage center", v.String())
isHistory := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsHistory) isHistory := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsHistory)
@ -83,11 +84,15 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) {
if !(!isSenderSync && msgChannelValue.aggregationID == v.MsgData.SendID) { if !(!isSenderSync && msgChannelValue.aggregationID == v.MsgData.SendID) {
notStoragePushMsgList = append(notStoragePushMsgList, v) notStoragePushMsgList = append(notStoragePushMsgList, v)
} }
} }
if v.MsgData.ContentType == constant.ReactionMessageModifier || v.MsgData.ContentType == constant.ReactionMessageDeleter {
modifyMsgList = append(modifyMsgList, v)
}
}
if len(modifyMsgList) > 0 {
sendMessageToModifyMQ(msgChannelValue.aggregationID, triggerID, modifyMsgList)
} }
//switch msgChannelValue.msg.MsgData.SessionType { //switch msgChannelValue.msg.MsgData.SessionType {
//case constant.SingleChatType: //case constant.SingleChatType:
//case constant.GroupChatType: //case constant.GroupChatType:
@ -107,6 +112,7 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) {
singleMsgSuccessCount += uint64(len(storageMsgList)) singleMsgSuccessCount += uint64(len(storageMsgList))
singleMsgSuccessCountMutex.Unlock() singleMsgSuccessCountMutex.Unlock()
och.SendMessageToMongoCH(msgChannelValue.aggregationID, triggerID, storageMsgList, lastSeq) och.SendMessageToMongoCH(msgChannelValue.aggregationID, triggerID, storageMsgList, lastSeq)
for _, v := range storageMsgList { for _, v := range storageMsgList {
sendMessageToPushMQ(v, msgChannelValue.aggregationID) sendMessageToPushMQ(v, msgChannelValue.aggregationID)
} }
@ -552,6 +558,17 @@ func sendMessageToPushMQ(message *pbMsg.MsgDataToMQ, pushToUserID string) {
return return
} }
func sendMessageToModifyMQ(aggregationID string, triggerID string, messages []*pbMsg.MsgDataToMQ) {
if len(messages) > 0 {
pid, offset, err := producerToModify.SendMessage(&pbMsg.MsgDataToModifyByMQ{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)
}
}
}
// String hashes a string to a unique hashcode. // String hashes a string to a unique hashcode.
// //
// crc32 returns a uint32, but for our use we need // crc32 returns a uint32, but for our use we need

View File

@ -61,7 +61,6 @@ func (mc *OnlineHistoryMongoConsumerHandler) handleChatWs2Mongo(cMsg *sarama.Con
if unexistSeqList, err := db.DB.DelMsgBySeqList(DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID); err != nil { 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) log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList)
} }
//if v.MsgData.ContentType == ? {}
} }
} }
} }

View File

@ -28,6 +28,8 @@ var (
const ( const (
PushURL = "/push/single/alias" PushURL = "/push/single/alias"
AuthURL = "/auth" AuthURL = "/auth"
TaskURL = "/push/list/message"
BatchPushURL = "/push/list/alias"
) )
func init() { func init() {
@ -53,22 +55,41 @@ type AuthResp struct {
Token string `json:"token"` Token string `json:"token"`
} }
type PushReq struct { type TaskResp struct {
RequestID string `json:"request_id"` TaskID string `json:"taskID"`
Audience struct { }
type Settings struct {
TTL *int64 `json:"ttl"`
}
type Audience struct {
Alias []string `json:"alias"` Alias []string `json:"alias"`
} `json:"audience"` }
PushMessage struct {
Notification Notification `json:"notification,omitempty"` type PushMessage struct {
Transmission string `json:"transmission,omitempty"` Notification *Notification `json:"notification,omitempty"`
} `json:"push_message"` Transmission *string `json:"transmission,omitempty"`
PushChannel struct { }
Ios Ios `json:"ios"`
Android Android `json:"android"` type PushChannel struct {
} `json:"push_channel"` Ios *Ios `json:"ios"`
Android *Android `json:"android"`
}
type PushReq struct {
RequestID *string `json:"request_id"`
Settings *Settings `json:"settings"`
Audience *Audience `json:"audience"`
PushMessage *PushMessage `json:"push_message"`
PushChannel *PushChannel `json:"push_channel"`
IsAsync *bool `json:"is_async"`
Taskid *string `json:"taskid"`
} }
type Ios struct { type Ios struct {
NotiType *string `json:"type"`
AutoBadge *string `json:"auto_badge"`
Aps struct { Aps struct {
Sound string `json:"sound"` Sound string `json:"sound"`
Alert Alert `json:"alert"` Alert Alert `json:"alert"`
@ -119,9 +140,9 @@ func newGetuiClient() *Getui {
func (g *Getui) Push(userIDList []string, title, detailContent, operationID string, opts push.PushOpts) (resp string, err error) { func (g *Getui) Push(userIDList []string, title, detailContent, operationID string, opts push.PushOpts) (resp string, err error) {
token, err := db.DB.GetGetuiToken() token, err := db.DB.GetGetuiToken()
log.NewDebug(operationID, utils.GetSelfFuncName(), "token", token) log.NewDebug(operationID, utils.GetSelfFuncName(), "token", token, userIDList)
if err != nil { if err != nil {
log.NewError(operationID, utils.OperationIDGenerator(), "GetGetuiToken failed", err.Error()) log.NewError(operationID, utils.GetSelfFuncName(), "GetGetuiToken failed", err.Error())
} }
if token == "" || err != nil { if token == "" || err != nil {
token, err = g.getTokenAndSave2Redis(operationID) token, err = g.getTokenAndSave2Redis(operationID)
@ -130,47 +151,32 @@ func (g *Getui) Push(userIDList []string, title, detailContent, operationID stri
return "", utils.Wrap(err, "") return "", utils.Wrap(err, "")
} }
} }
pushReq := PushReq{
RequestID: utils.OperationIDGenerator(), pushReq := PushReq{PushMessage: &PushMessage{Notification: &Notification{
Audience: struct {
Alias []string `json:"alias"`
}{Alias: []string{userIDList[0]}},
}
pushReq.PushMessage.Notification = Notification{
Title: title, Title: title,
Body: detailContent, Body: detailContent,
ClickType: "startapp", ClickType: "startapp",
ChannelID: config.Config.Push.Getui.ChannelID, ChannelID: config.Config.Push.Getui.ChannelID,
ChannelName: config.Config.Push.Getui.ChannelName, ChannelName: config.Config.Push.Getui.ChannelName,
} }}}
pushReq.PushChannel.Ios.Aps.Sound = "default" pushReq.setPushChannel(title, detailContent)
pushReq.PushChannel.Ios.Aps.Alert = Alert{
Title: title,
Body: title,
}
pushReq.PushChannel.Android.Ups.Notification = Notification{
Title: title,
Body: title,
ClickType: "startapp",
}
pushReq.PushChannel.Android.Ups.Options = Options{
HW: struct {
DefaultSound bool `json:"/message/android/notification/default_sound"`
ChannelID string `json:"/message/android/notification/channel_id"`
Sound string `json:"/message/android/notification/sound"`
Importance string `json:"/message/android/notification/importance"`
}{ChannelID: "RingRing4", Sound: "/raw/ring001", Importance: "NORMAL"},
XM: struct {
ChannelID string `json:"/extra.channel_id"`
}{ChannelID: "high_system"},
VV: struct {
Classification int "json:\"/classification\""
}{
Classification: 1,
},
}
pushResp := PushResp{} pushResp := PushResp{}
if len(userIDList) > 1 {
taskID, err := g.GetTaskID(operationID, token, pushReq)
if err != nil {
return "", utils.Wrap(err, "GetTaskIDAndSave2Redis failed")
}
pushReq = PushReq{Audience: &Audience{Alias: userIDList}}
var IsAsync = true
pushReq.IsAsync = &IsAsync
pushReq.Taskid = &taskID
err = g.request(BatchPushURL, pushReq, token, &pushResp, operationID)
} else {
reqID := utils.OperationIDGenerator()
pushReq.RequestID = &reqID
pushReq.Audience = &Audience{Alias: []string{userIDList[0]}}
err = g.request(PushURL, pushReq, token, &pushResp, operationID) err = g.request(PushURL, pushReq, token, &pushResp, operationID)
}
switch err { switch err {
case TokenExpireError: case TokenExpireError:
token, err = g.getTokenAndSave2Redis(operationID) token, err = g.getTokenAndSave2Redis(operationID)
@ -209,6 +215,17 @@ func (g *Getui) Auth(operationID string, timeStamp int64) (token string, expireT
return respAuth.Token, int64(expire), err return respAuth.Token, int64(expire), err
} }
func (g *Getui) GetTaskID(operationID, token string, pushReq PushReq) (string, error) {
respTask := TaskResp{}
ttl := int64(1000 * 60 * 5)
pushReq.Settings = &Settings{TTL: &ttl}
err := g.request(TaskURL, pushReq, token, &respTask, operationID)
if err != nil {
return "", utils.Wrap(err, "")
}
return respTask.TaskID, nil
}
func (g *Getui) request(url string, content interface{}, token string, returnStruct interface{}, operationID string) error { func (g *Getui) request(url string, content interface{}, token string, returnStruct interface{}, operationID string) error {
con, err := json.Marshal(content) con, err := json.Marshal(content)
if err != nil { if err != nil {
@ -245,6 +262,41 @@ func (g *Getui) request(url string, content interface{}, token string, returnStr
return nil return nil
} }
func (pushReq *PushReq) setPushChannel(title string, body string) {
pushReq.PushChannel = &PushChannel{}
autoBadge := "+1"
pushReq.PushChannel.Ios = &Ios{AutoBadge: &autoBadge}
notify := "notify"
pushReq.PushChannel.Ios.NotiType = &notify
pushReq.PushChannel.Ios.Aps.Sound = "default"
pushReq.PushChannel.Ios.Aps.Alert = Alert{
Title: title,
Body: body,
}
pushReq.PushChannel.Android = &Android{}
pushReq.PushChannel.Android.Ups.Notification = Notification{
Title: title,
Body: body,
ClickType: "startapp",
}
pushReq.PushChannel.Android.Ups.Options = Options{
HW: struct {
DefaultSound bool `json:"/message/android/notification/default_sound"`
ChannelID string `json:"/message/android/notification/channel_id"`
Sound string `json:"/message/android/notification/sound"`
Importance string `json:"/message/android/notification/importance"`
}{ChannelID: "RingRing4", Sound: "/raw/ring001", Importance: "NORMAL"},
XM: struct {
ChannelID string `json:"/extra.channel_id"`
}{ChannelID: "high_system"},
VV: struct {
Classification int "json:\"/classification\""
}{
Classification: 1,
},
}
}
func (g *Getui) getTokenAndSave2Redis(operationID string) (token string, err error) { func (g *Getui) getTokenAndSave2Redis(operationID string) (token string, err error) {
token, expireTime, err := g.Auth(operationID, time.Now().UnixNano()/1e6) token, expireTime, err := g.Auth(operationID, time.Now().UnixNano()/1e6)
if err != nil { if err != nil {
@ -257,3 +309,17 @@ func (g *Getui) getTokenAndSave2Redis(operationID string) (token string, err err
} }
return token, nil return token, nil
} }
func (g *Getui) GetTaskIDAndSave2Redis(operationID, token string, pushReq PushReq) (taskID string, err error) {
ttl := int64(1000 * 60 * 60 * 24)
pushReq.Settings = &Settings{TTL: &ttl}
taskID, err = g.GetTaskID(operationID, token, pushReq)
if err != nil {
return "", utils.Wrap(err, "GetTaskIDAndSave2Redis failed")
}
err = db.DB.SetGetuiTaskID(taskID, 60*60*23)
if err != nil {
return "", utils.Wrap(err, "Auth failed")
}
return token, nil
}

View File

@ -93,10 +93,11 @@ func (r *RPCServer) PushMsg(_ context.Context, pbData *pbPush.PushMsgReq) (*pbPu
} }
func (r *RPCServer) DelUserPushToken(c context.Context, req *pbPush.DelUserPushTokenReq) (*pbPush.DelUserPushTokenResp, error) { func (r *RPCServer) DelUserPushToken(c context.Context, req *pbPush.DelUserPushTokenReq) (*pbPush.DelUserPushTokenResp, error) {
log.Debug(req.OperationID, utils.GetSelfFuncName(), "req", req.String())
var resp pbPush.DelUserPushTokenResp var resp pbPush.DelUserPushTokenResp
err := db.DB.DelFcmToken(req.UserID, int(req.PlatformID)) err := db.DB.DelFcmToken(req.UserID, int(req.PlatformID))
if err != nil { if err != nil {
errMsg := req.OperationID + " " + "SetFcmToken failed " + err.Error() errMsg := req.OperationID + " " + "DelFcmToken failed " + err.Error()
log.NewError(req.OperationID, errMsg) log.NewError(req.OperationID, errMsg)
resp.ErrCode = 500 resp.ErrCode = 500
resp.ErrMsg = errMsg resp.ErrMsg = errMsg

View File

@ -210,11 +210,25 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
successCount++ successCount++
if isOfflinePush { if isOfflinePush {
var onlineSuccessUserIDList []string var onlineSuccessUserIDList []string
var WebAndPcBackgroundUserIDList []string
onlineSuccessUserIDList = append(onlineSuccessUserIDList, pushMsg.MsgData.SendID) onlineSuccessUserIDList = append(onlineSuccessUserIDList, pushMsg.MsgData.SendID)
for _, v := range wsResult { for _, v := range wsResult {
if v.OnlinePush && v.UserID != pushMsg.MsgData.SendID { if v.OnlinePush && v.UserID != pushMsg.MsgData.SendID {
onlineSuccessUserIDList = append(onlineSuccessUserIDList, v.UserID) onlineSuccessUserIDList = append(onlineSuccessUserIDList, v.UserID)
} }
if !v.OnlinePush {
if len(v.Resp) != 0 {
for _, singleResult := range v.Resp {
if singleResult.ResultCode == -2 {
if constant.PlatformIDToClass(int(singleResult.RecvPlatFormID)) == constant.TerminalPC ||
singleResult.RecvPlatFormID == constant.WebPlatformID {
WebAndPcBackgroundUserIDList = append(WebAndPcBackgroundUserIDList, v.UserID)
}
}
}
}
}
} }
onlineFailedUserIDList := utils.DifferenceString(onlineSuccessUserIDList, pushToUserIDList) onlineFailedUserIDList := utils.DifferenceString(onlineSuccessUserIDList, pushToUserIDList)
//Use offline push messaging //Use offline push messaging
@ -240,7 +254,17 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
} else { } else {
needOfflinePushUserIDList = onlineFailedUserIDList needOfflinePushUserIDList = onlineFailedUserIDList
} }
if pushMsg.MsgData.ContentType != constant.SignalingNotification {
notNotificationUserIDList, err := db.DB.GetSuperGroupUserReceiveNotNotifyMessageIDList(pushMsg.MsgData.GroupID)
if err != nil {
log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetSuperGroupUserReceiveNotNotifyMessageIDList failed", pushMsg.MsgData.GroupID)
} else {
log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), notNotificationUserIDList)
}
needOfflinePushUserIDList = utils.RemoveFromSlice(notNotificationUserIDList, needOfflinePushUserIDList)
log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), needOfflinePushUserIDList)
}
if offlinePusher == nil { if offlinePusher == nil {
return return
} }
@ -248,7 +272,7 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
if err != nil { if err != nil {
log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error()) log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "GetOfflinePushOpts failed", pushMsg, err.Error())
} }
log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), onlineFailedUserIDList, title, detailContent, "opts:", opts) log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), needOfflinePushUserIDList, title, detailContent, "opts:", opts)
if title == "" { if title == "" {
switch pushMsg.MsgData.ContentType { switch pushMsg.MsgData.ContentType {
case constant.Text: case constant.Text:
@ -285,6 +309,22 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
promePkg.PromeInc(promePkg.MsgOfflinePushSuccessCounter) promePkg.PromeInc(promePkg.MsgOfflinePushSuccessCounter)
log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData)
} }
needBackgroupPushUserID := utils.IntersectString(needOfflinePushUserIDList, WebAndPcBackgroundUserIDList)
grpcCons := getcdv3.GetDefaultGatewayConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), pushMsg.OperationID)
if len(needBackgroupPushUserID) > 0 {
//Online push message
log.Debug(pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String())
for _, v := range grpcCons {
msgClient := pbRelay.NewRelayClient(v)
_, err := msgClient.SuperGroupBackgroundOnlinePush(context.Background(), &pbRelay.OnlineBatchPushOneMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData,
PushToUserIDList: needBackgroupPushUserID})
if err != nil {
log.NewError("push data to client rpc err", pushMsg.OperationID, "err", err)
continue
}
}
}
} }
} }
} }

View File

@ -2,7 +2,7 @@ package push
import "Open_IM/pkg/common/constant" import "Open_IM/pkg/common/constant"
var PushTerminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID} var PushTerminal = []int{constant.IOSPlatformID, constant.AndroidPlatformID, constant.WebPlatformID}
type OfflinePusher interface { type OfflinePusher interface {
Push(userIDList []string, title, detailContent, operationID string, opts PushOpts) (resp string, err error) Push(userIDList []string, title, detailContent, operationID string, opts PushOpts) (resp string, err error)

View File

@ -61,6 +61,21 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo
resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
return resp, nil return resp, nil
} }
if req.Conversation.ConversationType == constant.SuperGroupChatType {
if req.Conversation.RecvMsgOpt == constant.ReceiveNotNotifyMessage {
if err = db.DB.SetSuperGroupUserReceiveNotNotifyMessage(req.Conversation.GroupID, v); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), req.Conversation.GroupID, v)
resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
return resp, nil
}
} else {
if err = db.DB.SetSuperGroupUserReceiveNotifyMessage(req.Conversation.GroupID, v); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), req.Conversation.GroupID, v)
resp.CommonResp = &pbConversation.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
return resp, nil
}
}
}
} }
err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt}) err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt})
case constant.FieldGroupAtType: case constant.FieldGroupAtType:

View File

@ -10,6 +10,8 @@ import (
pbGroup "Open_IM/pkg/proto/group" pbGroup "Open_IM/pkg/proto/group"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
http2 "net/http" http2 "net/http"
"google.golang.org/protobuf/types/known/wrapperspb"
) )
func callbackBeforeCreateGroup(req *pbGroup.CreateGroupReq) cbApi.CommonCallbackResp { func callbackBeforeCreateGroup(req *pbGroup.CreateGroupReq) cbApi.CommonCallbackResp {
@ -126,3 +128,56 @@ func CallbackBeforeMemberJoinGroup(operationID string, groupMember *db.GroupMemb
} }
return callbackResp return callbackResp
} }
func CallbackBeforeSetGroupMemberInfo(req *pbGroup.SetGroupMemberInfoReq) cbApi.CommonCallbackResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: req.OperationID}
if !config.Config.Callback.CallbackBeforeSetGroupMemberInfo.Enable {
return callbackResp
}
callbackReq := cbApi.CallbackBeforeSetGroupMemberInfoReq{
CallbackCommand: constant.CallbackBeforeSetGroupMemberInfoCommand,
OperationID: req.OperationID,
GroupID: req.GroupID,
UserID: req.UserID,
}
if req.Nickname != nil {
callbackReq.Nickname = req.Nickname.Value
}
if req.FaceURL != nil {
callbackReq.FaceURL = req.FaceURL.Value
}
if req.RoleLevel != nil {
callbackReq.RoleLevel = req.RoleLevel.Value
}
if req.Ex != nil {
callbackReq.Ex = req.Ex.Value
}
resp := &cbApi.CallbackBeforeSetGroupMemberInfoResp{
CommonCallbackResp: &callbackResp,
}
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeSetGroupMemberInfoCommand, callbackReq, resp, config.Config.Callback.CallbackBeforeSetGroupMemberInfo.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError
callbackResp.ErrMsg = err.Error()
if !config.Config.Callback.CallbackBeforeSetGroupMemberInfo.CallbackFailedContinue {
callbackResp.ActionCode = constant.ActionForbidden
return callbackResp
} else {
callbackResp.ActionCode = constant.ActionAllow
return callbackResp
}
}
if resp.FaceURL != nil {
req.FaceURL = &wrapperspb.StringValue{Value: *resp.FaceURL}
}
if resp.Nickname != nil {
req.Nickname = &wrapperspb.StringValue{Value: *resp.Nickname}
}
if resp.RoleLevel != nil {
req.RoleLevel = &wrapperspb.Int32Value{Value: *resp.RoleLevel}
}
if resp.Ex != nil {
req.Ex = &wrapperspb.StringValue{Value: *resp.Ex}
}
return callbackResp
}

View File

@ -30,6 +30,7 @@ import (
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus" grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/protobuf/types/known/wrapperspb"
"gorm.io/gorm" "gorm.io/gorm"
) )
@ -364,6 +365,14 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
var resp pbGroup.InviteUserToGroupResp var resp pbGroup.InviteUserToGroupResp
joinReq := pbGroup.JoinGroupReq{} joinReq := pbGroup.JoinGroupReq{}
for _, v := range req.InvitedUserIDList { for _, v := range req.InvitedUserIDList {
if imdb.IsExistGroupMember(req.GroupID, v) {
log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v)
var resultNode pbGroup.Id2Result
resultNode.Result = -1
resultNode.UserID = v
resp.Id2ResultList = append(resp.Id2ResultList, &resultNode)
continue
}
var groupRequest db.GroupRequest var groupRequest db.GroupRequest
groupRequest.UserID = v groupRequest.UserID = v
groupRequest.GroupID = req.GroupID groupRequest.GroupID = req.GroupID
@ -451,8 +460,19 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) resp.Id2ResultList = append(resp.Id2ResultList, &resultNode)
} }
} else { } else {
okUserIDList = req.InvitedUserIDList for _, v := range req.InvitedUserIDList {
if err := db.DB.AddUserToSuperGroup(req.GroupID, req.InvitedUserIDList); err != nil { if imdb.IsExistGroupMember(req.GroupID, v) {
log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v)
var resultNode pbGroup.Id2Result
resultNode.Result = -1
resp.Id2ResultList = append(resp.Id2ResultList, &resultNode)
continue
} else {
okUserIDList = append(okUserIDList, v)
}
}
//okUserIDList = req.InvitedUserIDList
if err := db.DB.AddUserToSuperGroup(req.GroupID, okUserIDList); err != nil {
log.NewError(req.OperationID, "AddUserToSuperGroup failed ", req.GroupID, err) log.NewError(req.OperationID, "AddUserToSuperGroup failed ", req.GroupID, err)
return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}, nil return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}, nil
} }
@ -723,6 +743,33 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
resp.ErrMsg = constant.ErrDB.ErrMsg resp.ErrMsg = constant.ErrDB.ErrMsg
return &resp, nil return &resp, nil
} }
if err := rocksCache.DelGroupMemberListHashFromCache(req.GroupID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, err.Error())
}
if err := rocksCache.DelGroupMemberIDListFromCache(req.GroupID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.GroupID)
}
reqPb := pbConversation.ModifyConversationFieldReq{Conversation: &pbConversation.Conversation{}}
reqPb.OperationID = req.OperationID
reqPb.UserIDList = okUserIDList
reqPb.FieldType = constant.FieldUnread
reqPb.Conversation.GroupID = req.GroupID
reqPb.Conversation.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.SuperGroupChatType)
reqPb.Conversation.ConversationType = int32(constant.SuperGroupChatType)
reqPb.Conversation.UpdateUnreadCountTime = utils.GetCurrentTimestampByMill()
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
}
client := pbConversation.NewConversationClient(etcdConn)
respPb, err := client.ModifyConversationField(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "ModifyConversationField rpc failed, ", reqPb.String(), err.Error())
} else {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "ModifyConversationField success", respPb.String())
}
} }
if groupInfo.GroupType != constant.SuperGroup { if groupInfo.GroupType != constant.SuperGroup {
@ -756,7 +803,15 @@ func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetG
var resp pbGroup.GetGroupMembersInfoResp var resp pbGroup.GetGroupMembersInfoResp
resp.MemberList = []*open_im_sdk.GroupMemberFullInfo{} resp.MemberList = []*open_im_sdk.GroupMemberFullInfo{}
for _, userID := range req.MemberList { for _, userID := range req.MemberList {
groupMember, err := rocksCache.GetGroupMemberInfoFromCache(req.GroupID, userID) var (
groupMember *db.GroupMember
err error
)
if req.NoCache {
groupMember, err = imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, userID)
} else {
groupMember, err = rocksCache.GetGroupMemberInfoFromCache(req.GroupID, userID)
}
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, userID, err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, userID, err.Error())
continue continue
@ -861,6 +916,10 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G
log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), req.FromUserID) log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), req.FromUserID)
return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
} }
if imdb.IsExistGroupMember(req.GroupID, req.FromUserID) {
log.NewInfo(req.OperationID, "GroupApplicationResponse user in group", req.GroupID, req.FromUserID)
return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}, nil
}
member := db.GroupMember{} member := db.GroupMember{}
member.GroupID = req.GroupID member.GroupID = req.GroupID
member.UserID = req.FromUserID member.UserID = req.FromUserID
@ -976,12 +1035,15 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G
func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq) (*pbGroup.JoinGroupResp, error) { func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq) (*pbGroup.JoinGroupResp, error) {
log.NewInfo(req.OperationID, "JoinGroup args ", req.String()) log.NewInfo(req.OperationID, "JoinGroup args ", req.String())
if imdb.IsExistGroupMember(req.GroupID, req.OpUserID) {
log.NewInfo(req.OperationID, "IsExistGroupMember", req.GroupID, req.OpUserID)
return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{}}, nil
}
_, err := imdb.GetUserByUserID(req.OpUserID) _, err := imdb.GetUserByUserID(req.OpUserID)
if err != nil { if err != nil {
log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OpUserID) log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OpUserID)
return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
} }
groupInfo, err := rocksCache.GetGroupInfoFromCache(req.GroupID) groupInfo, err := rocksCache.GetGroupInfoFromCache(req.GroupID)
if err != nil { if err != nil {
log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.GroupID, err) log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.GroupID, err)
@ -1274,7 +1336,8 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
} }
log.NewInfo(req.OperationID, "SetGroupInfo rpc return ", pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}) log.NewInfo(req.OperationID, "SetGroupInfo rpc return ", pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}})
if changedType != 0 { if changedType != 0 {
chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfoForSet.GroupID, groupName, notification, introduction, faceURL, req.GroupInfoForSet.NeedVerification) chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfoForSet.GroupID, groupName, notification,
introduction, faceURL, req.GroupInfoForSet.NeedVerification, req.GroupInfoForSet.ApplyMemberFriend, req.GroupInfoForSet.LookMemberInfo)
} }
if req.GroupInfoForSet.Notification != "" { if req.GroupInfoForSet.Notification != "" {
//get group member user id //get group member user id
@ -1765,11 +1828,35 @@ func (s *groupServer) SetGroupMemberNickname(ctx context.Context, req *pbGroup.S
log.Error(req.OperationID, errMsg) log.Error(req.OperationID, errMsg)
return &pbGroup.SetGroupMemberNicknameResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil return &pbGroup.SetGroupMemberNicknameResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
} }
cbReq := &pbGroup.SetGroupMemberInfoReq{
GroupID: req.GroupID,
UserID: req.UserID,
OperationID: req.OperationID,
OpUserID: req.OpUserID,
Nickname: &wrapperspb.StringValue{Value: req.Nickname},
}
callbackResp := CallbackBeforeSetGroupMemberInfo(cbReq)
if callbackResp.ErrCode != 0 {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CallbackBeforeMemberJoinGroup resp: ", callbackResp)
}
if callbackResp.ActionCode != constant.ActionAllow {
if callbackResp.ErrCode == 0 {
callbackResp.ErrCode = 201
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CallbackBeforeMemberJoinGroup result", "end rpc and return", callbackResp)
return &pbGroup.SetGroupMemberNicknameResp{
CommonResp: &pbGroup.CommonResp{
ErrCode: int32(callbackResp.ErrCode),
ErrMsg: callbackResp.ErrMsg,
},
}, nil
}
nickName := cbReq.Nickname.Value
groupMemberInfo := db.GroupMember{} groupMemberInfo := db.GroupMember{}
groupMemberInfo.UserID = req.UserID groupMemberInfo.UserID = req.UserID
groupMemberInfo.GroupID = req.GroupID groupMemberInfo.GroupID = req.GroupID
if req.Nickname == "" { if nickName == "" {
userNickname, err := imdb.GetUserNameByUserID(groupMemberInfo.UserID) userNickname, err := imdb.GetUserNameByUserID(groupMemberInfo.UserID)
if err != nil { if err != nil {
errMsg := req.OperationID + " GetUserNameByUserID failed " + err.Error() errMsg := req.OperationID + " GetUserNameByUserID failed " + err.Error()
@ -1778,7 +1865,7 @@ func (s *groupServer) SetGroupMemberNickname(ctx context.Context, req *pbGroup.S
} }
groupMemberInfo.Nickname = userNickname groupMemberInfo.Nickname = userNickname
} else { } else {
groupMemberInfo.Nickname = req.Nickname groupMemberInfo.Nickname = nickName
} }
if err := rocksCache.DelGroupMemberInfoFromCache(req.GroupID, req.UserID); err != nil { if err := rocksCache.DelGroupMemberInfoFromCache(req.GroupID, req.UserID); err != nil {
@ -1805,6 +1892,23 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGr
resp.CommonResp.ErrMsg = err.Error() resp.CommonResp.ErrMsg = err.Error()
return resp, nil return resp, nil
} }
callbackResp := CallbackBeforeSetGroupMemberInfo(req)
if callbackResp.ErrCode != 0 {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CallbackBeforeMemberJoinGroup resp: ", callbackResp)
}
if callbackResp.ActionCode != constant.ActionAllow {
if callbackResp.ErrCode == 0 {
callbackResp.ErrCode = 201
}
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CallbackBeforeMemberJoinGroup result", "end rpc and return", callbackResp)
return &pbGroup.SetGroupMemberInfoResp{
CommonResp: &pbGroup.CommonResp{
ErrCode: int32(callbackResp.ErrCode),
ErrMsg: callbackResp.ErrMsg,
},
}, nil
}
groupMember := db.GroupMember{ groupMember := db.GroupMember{
GroupID: req.GroupID, GroupID: req.GroupID,
UserID: req.UserID, UserID: req.UserID,
@ -1913,3 +2017,53 @@ func (s *groupServer) DelGroupAndUserCache(operationID, groupID string, userIDLi
} }
return nil return nil
} }
func (s *groupServer) GroupIsExist(c context.Context, req *pbGroup.GroupIsExistReq) (*pbGroup.GroupIsExistResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp := &pbGroup.GroupIsExistResp{CommonResp: &pbGroup.CommonResp{}}
groups, err := imdb.GetGroupInfoByGroupIDList(req.GroupIDList)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), "args:", req.GroupIDList)
resp.CommonResp.ErrMsg = err.Error()
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
return resp, nil
}
var m = make(map[string]bool)
for _, groupID := range req.GroupIDList {
m[groupID] = false
for _, group := range groups {
if groupID == group.GroupID {
m[groupID] = true
break
}
}
}
resp.IsExistMap = m
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", req.String())
return resp, nil
}
func (s *groupServer) UserIsInGroup(c context.Context, req *pbGroup.UserIsInGroupReq) (*pbGroup.UserIsInGroupResp, error) {
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
resp := &pbGroup.UserIsInGroupResp{}
groupMemberList, err := imdb.GetGroupMemberByUserIDList(req.GroupID, req.UserIDList)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), "args:", req.GroupID, req.UserIDList)
resp.CommonResp.ErrMsg = err.Error()
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
return resp, nil
}
var m = make(map[string]bool)
for _, userID := range req.UserIDList {
m[userID] = false
for _, user := range groupMemberList {
if userID == user.UserID {
m[userID] = true
break
}
}
}
resp.IsExistMap = m
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", req.String())
return resp, nil
}

View File

@ -221,9 +221,3 @@ func callbackMsgModify(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content))
return callbackResp return callbackResp
} }
func CallbackBeforeExtendMsgModify() cbApi.CommonCallbackResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: ""}
return callbackResp
}

View File

@ -5,8 +5,8 @@ import (
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify" "Open_IM/pkg/common/token_verify"
commonPb "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/proto/msg" "Open_IM/pkg/proto/msg"
commonPb "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"time" "time"
@ -44,7 +44,7 @@ func (rpc *rpcChat) DelSuperGroupMsg(_ context.Context, req *msg.DelSuperGroupMs
resp.ErrMsg = err.Error() resp.ErrMsg = err.Error()
return resp, nil return resp, nil
} }
err = db.DB.SetGroupUserMinSeq(req.GroupID,req.UserID, groupMaxSeq) err = db.DB.SetGroupUserMinSeq(req.GroupID, req.UserID, groupMaxSeq+1)
if err != nil { if err != nil {
log.NewError(req.OperationID, "SetGroupUserMinSeq false ", req.OpUserID, req.UserID, req.GroupID) log.NewError(req.OperationID, "SetGroupUserMinSeq false ", req.OpUserID, req.UserID, req.GroupID)
resp.ErrCode = constant.ErrDB.ErrCode resp.ErrCode = constant.ErrDB.ErrCode

View File

@ -1 +1,477 @@
package msg package msg
import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db"
"Open_IM/pkg/common/log"
"Open_IM/pkg/proto/msg"
"Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
go_redis "github.com/go-redis/redis/v8"
"time"
)
func (rpc *rpcChat) SetMessageReactionExtensions(ctx context.Context, req *msg.SetMessageReactionExtensionsReq) (resp *msg.SetMessageReactionExtensionsResp, err error) {
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String())
var rResp msg.SetMessageReactionExtensionsResp
rResp.ClientMsgID = req.ClientMsgID
rResp.MsgFirstModifyTime = req.MsgFirstModifyTime
callbackResp := callbackSetMessageReactionExtensions(req)
if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 {
rResp.ErrCode = int32(callbackResp.ErrCode)
rResp.ErrMsg = callbackResp.ErrMsg
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = callbackResp.ErrMsg
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
//if ExternalExtension
if req.IsExternalExtensions {
var isHistory bool
if req.IsReact {
isHistory = false
} else {
isHistory = true
}
rResp.MsgFirstModifyTime = callbackResp.MsgFirstModifyTime
rResp.Result = callbackResp.ResultReactionExtensionList
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, isHistory, false)
return &rResp, nil
}
for _, v := range callbackResp.ResultReactionExtensionList {
if v.ErrCode == 0 {
req.ReactionExtensionList[v.KeyValue.TypeKey] = v.KeyValue
} else {
delete(req.ReactionExtensionList, v.KeyValue.TypeKey)
rResp.Result = append(rResp.Result, v)
}
}
isExists, err := db.DB.JudgeMessageReactionEXISTS(req.ClientMsgID, req.SessionType)
if err != nil {
rResp.ErrCode = 100
rResp.ErrMsg = err.Error()
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
if !isExists {
if !req.IsReact {
log.Debug(req.OperationID, "redis handle firstly", req.String())
rResp.MsgFirstModifyTime = utils.GetCurrentTimestampByMill()
for k, v := range req.ReactionExtensionList {
err := rpc.dMessageLocker.LockMessageTypeKey(req.ClientMsgID, k)
if err != nil {
setKeyResultInfo(&rResp, 100, err.Error(), req.ClientMsgID, k, v)
continue
}
v.LatestUpdateTime = utils.GetCurrentTimestampByMill()
newerr := db.DB.SetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, k, utils.StructToJsonString(v))
if newerr != nil {
setKeyResultInfo(&rResp, 201, newerr.Error(), req.ClientMsgID, k, v)
continue
}
setKeyResultInfo(&rResp, 0, "", req.ClientMsgID, k, v)
}
rResp.IsReact = true
_, err := db.DB.SetMessageReactionExpire(req.ClientMsgID, req.SessionType, time.Duration(24*3)*time.Hour)
if err != nil {
log.Error(req.OperationID, "SetMessageReactionExpire err:", err.Error(), req.String())
}
} else {
err := rpc.dMessageLocker.LockGlobalMessage(req.ClientMsgID)
if err != nil {
rResp.ErrCode = 100
rResp.ErrMsg = err.Error()
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime)
if err != nil {
rResp.ErrCode = 200
rResp.ErrMsg = err.Error()
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
setValue := make(map[string]*server_api_params.KeyValue)
for k, v := range req.ReactionExtensionList {
temp := new(server_api_params.KeyValue)
if vv, ok := mongoValue.ReactionExtensionList[k]; ok {
utils.CopyStructFields(temp, &vv)
if v.LatestUpdateTime != vv.LatestUpdateTime {
setKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, k, temp)
continue
}
}
temp.TypeKey = k
temp.Value = v.Value
temp.LatestUpdateTime = utils.GetCurrentTimestampByMill()
setValue[k] = temp
}
err = db.DB.InsertOrUpdateReactionExtendMsgSet(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue)
if err != nil {
for _, value := range setValue {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
} else {
for _, value := range setValue {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
rResp.Result = append(rResp.Result, temp)
}
}
lockErr := rpc.dMessageLocker.UnLockGlobalMessage(req.ClientMsgID)
if lockErr != nil {
log.Error(req.OperationID, "UnLockGlobalMessage err:", lockErr.Error())
}
}
} else {
log.Debug(req.OperationID, "redis handle secondly", req.String())
for k, v := range req.ReactionExtensionList {
err := rpc.dMessageLocker.LockMessageTypeKey(req.ClientMsgID, k)
if err != nil {
setKeyResultInfo(&rResp, 100, err.Error(), req.ClientMsgID, k, v)
continue
}
redisValue, err := db.DB.GetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, k)
if err != nil && err != go_redis.Nil {
setKeyResultInfo(&rResp, 200, err.Error(), req.ClientMsgID, k, v)
continue
}
temp := new(server_api_params.KeyValue)
utils.JsonStringToStruct(redisValue, temp)
if v.LatestUpdateTime != temp.LatestUpdateTime {
setKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, k, temp)
continue
} else {
v.LatestUpdateTime = utils.GetCurrentTimestampByMill()
newerr := db.DB.SetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, k, utils.StructToJsonString(v))
if newerr != nil {
setKeyResultInfo(&rResp, 201, newerr.Error(), req.ClientMsgID, k, temp)
continue
}
setKeyResultInfo(&rResp, 0, "", req.ClientMsgID, k, v)
}
}
}
if !isExists {
if !req.IsReact {
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, true, true)
} else {
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false)
}
} else {
ExtendMessageUpdatedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, true)
}
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String())
return &rResp, nil
}
func setKeyResultInfo(r *msg.SetMessageReactionExtensionsResp, errCode int32, errMsg, clientMsgID, typeKey string, keyValue *server_api_params.KeyValue) {
temp := new(msg.KeyValueResp)
temp.KeyValue = keyValue
temp.ErrCode = errCode
temp.ErrMsg = errMsg
r.Result = append(r.Result, temp)
_ = db.DB.UnLockMessageTypeKey(clientMsgID, typeKey)
}
func setDeleteKeyResultInfo(r *msg.DeleteMessageListReactionExtensionsResp, errCode int32, errMsg, clientMsgID, typeKey string, keyValue *server_api_params.KeyValue) {
temp := new(msg.KeyValueResp)
temp.KeyValue = keyValue
temp.ErrCode = errCode
temp.ErrMsg = errMsg
r.Result = append(r.Result, temp)
_ = db.DB.UnLockMessageTypeKey(clientMsgID, typeKey)
}
func (rpc *rpcChat) GetMessageListReactionExtensions(ctx context.Context, req *msg.GetMessageListReactionExtensionsReq) (resp *msg.GetMessageListReactionExtensionsResp, err error) {
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String())
var rResp msg.GetMessageListReactionExtensionsResp
if req.IsExternalExtensions {
callbackResp := callbackGetMessageListReactionExtensions(req)
if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 {
rResp.ErrCode = int32(callbackResp.ErrCode)
rResp.ErrMsg = callbackResp.ErrMsg
return &rResp, nil
} else {
rResp.SingleMessageResult = callbackResp.MessageResultList
return &rResp, nil
}
}
for _, messageValue := range req.MessageReactionKeyList {
var oneMessage msg.SingleMessageExtensionResult
oneMessage.ClientMsgID = messageValue.ClientMsgID
isExists, err := db.DB.JudgeMessageReactionEXISTS(messageValue.ClientMsgID, req.SessionType)
if err != nil {
rResp.ErrCode = 100
rResp.ErrMsg = err.Error()
return &rResp, nil
}
if isExists {
redisValue, err := db.DB.GetOneMessageAllReactionList(messageValue.ClientMsgID, req.SessionType)
if err != nil {
oneMessage.ErrCode = 100
oneMessage.ErrMsg = err.Error()
rResp.SingleMessageResult = append(rResp.SingleMessageResult, &oneMessage)
continue
}
keyMap := make(map[string]*server_api_params.KeyValue)
for k, v := range redisValue {
temp := new(server_api_params.KeyValue)
utils.JsonStringToStruct(v, temp)
keyMap[k] = temp
}
oneMessage.ReactionExtensionList = keyMap
} else {
mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, messageValue.ClientMsgID, messageValue.MsgFirstModifyTime)
if err != nil {
oneMessage.ErrCode = 100
oneMessage.ErrMsg = err.Error()
rResp.SingleMessageResult = append(rResp.SingleMessageResult, &oneMessage)
continue
}
keyMap := make(map[string]*server_api_params.KeyValue)
for k, v := range mongoValue.ReactionExtensionList {
temp := new(server_api_params.KeyValue)
temp.TypeKey = v.TypeKey
temp.Value = v.Value
temp.LatestUpdateTime = v.LatestUpdateTime
keyMap[k] = temp
}
oneMessage.ReactionExtensionList = keyMap
}
rResp.SingleMessageResult = append(rResp.SingleMessageResult, &oneMessage)
}
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String())
return &rResp, nil
}
func (rpc *rpcChat) AddMessageReactionExtensions(ctx context.Context, req *msg.AddMessageReactionExtensionsReq) (resp *msg.AddMessageReactionExtensionsResp, err error) {
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String())
var rResp msg.AddMessageReactionExtensionsResp
rResp.ClientMsgID = req.ClientMsgID
rResp.MsgFirstModifyTime = req.MsgFirstModifyTime
callbackResp := callbackAddMessageReactionExtensions(req)
if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 {
rResp.ErrCode = int32(callbackResp.ErrCode)
rResp.ErrMsg = callbackResp.ErrMsg
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = callbackResp.ErrMsg
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
//if !req.IsExternalExtensions {
// rResp.ErrCode = 200
// rResp.ErrMsg = "only extenalextensions message can be used"
// for _, value := range req.ReactionExtensionList {
// temp := new(msg.KeyValueResp)
// temp.KeyValue = value
// temp.ErrMsg = callbackResp.ErrMsg
// temp.ErrCode = 100
// rResp.Result = append(rResp.Result, temp)
// }
// return &rResp, nil
//}
//if ExternalExtension
var isHistory bool
if req.IsReact {
isHistory = false
} else {
isHistory = true
}
rResp.MsgFirstModifyTime = callbackResp.MsgFirstModifyTime
rResp.Result = callbackResp.ResultReactionExtensionList
rResp.IsReact = callbackResp.IsReact
ExtendMessageAddedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, isHistory, false)
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", resp.String())
return &rResp, nil
}
func (rpc *rpcChat) DeleteMessageReactionExtensions(ctx context.Context, req *msg.DeleteMessageListReactionExtensionsReq) (resp *msg.DeleteMessageListReactionExtensionsResp, err error) {
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc args is:", req.String())
var rResp msg.DeleteMessageListReactionExtensionsResp
callbackResp := callbackDeleteMessageReactionExtensions(req)
if callbackResp.ActionCode != constant.ActionAllow || callbackResp.ErrCode != 0 {
rResp.ErrCode = int32(callbackResp.ErrCode)
rResp.ErrMsg = callbackResp.ErrMsg
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = callbackResp.ErrMsg
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
//if ExternalExtension
if req.IsExternalExtensions {
rResp.Result = callbackResp.ResultReactionExtensionList
ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, false)
return &rResp, nil
}
for _, v := range callbackResp.ResultReactionExtensionList {
if v.ErrCode != 0 {
func(req *[]*server_api_params.KeyValue, typeKey string) {
for i := 0; i < len(*req); i++ {
if (*req)[i].TypeKey == typeKey {
*req = append((*req)[:i], (*req)[i+1:]...)
}
}
}(&req.ReactionExtensionList, v.KeyValue.TypeKey)
rResp.Result = append(rResp.Result, v)
}
}
isExists, err := db.DB.JudgeMessageReactionEXISTS(req.ClientMsgID, req.SessionType)
if err != nil {
rResp.ErrCode = 100
rResp.ErrMsg = err.Error()
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
if isExists {
log.Debug(req.OperationID, "redis handle this delete", req.String())
for _, v := range req.ReactionExtensionList {
err := rpc.dMessageLocker.LockMessageTypeKey(req.ClientMsgID, v.TypeKey)
if err != nil {
setDeleteKeyResultInfo(&rResp, 100, err.Error(), req.ClientMsgID, v.TypeKey, v)
continue
}
redisValue, err := db.DB.GetMessageTypeKeyValue(req.ClientMsgID, req.SessionType, v.TypeKey)
if err != nil && err != go_redis.Nil {
setDeleteKeyResultInfo(&rResp, 200, err.Error(), req.ClientMsgID, v.TypeKey, v)
continue
}
temp := new(server_api_params.KeyValue)
utils.JsonStringToStruct(redisValue, temp)
if v.LatestUpdateTime != temp.LatestUpdateTime {
setDeleteKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, v.TypeKey, temp)
continue
} else {
newErr := db.DB.DeleteOneMessageKey(req.ClientMsgID, req.SessionType, v.TypeKey)
if newErr != nil {
setDeleteKeyResultInfo(&rResp, 201, newErr.Error(), req.ClientMsgID, v.TypeKey, temp)
continue
}
setDeleteKeyResultInfo(&rResp, 0, "", req.ClientMsgID, v.TypeKey, v)
}
}
} else {
err := rpc.dMessageLocker.LockGlobalMessage(req.ClientMsgID)
if err != nil {
rResp.ErrCode = 100
rResp.ErrMsg = err.Error()
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
mongoValue, err := db.DB.GetExtendMsg(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime)
if err != nil {
rResp.ErrCode = 200
rResp.ErrMsg = err.Error()
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
setValue := make(map[string]*server_api_params.KeyValue)
for _, v := range req.ReactionExtensionList {
temp := new(server_api_params.KeyValue)
if vv, ok := mongoValue.ReactionExtensionList[v.TypeKey]; ok {
utils.CopyStructFields(temp, &vv)
if v.LatestUpdateTime != vv.LatestUpdateTime {
setDeleteKeyResultInfo(&rResp, 300, "message have update", req.ClientMsgID, v.TypeKey, temp)
continue
}
} else {
setDeleteKeyResultInfo(&rResp, 400, "key not in", req.ClientMsgID, v.TypeKey, v)
continue
}
temp.TypeKey = v.TypeKey
setValue[v.TypeKey] = temp
}
err = db.DB.DeleteReactionExtendMsgSet(req.SourceID, req.SessionType, req.ClientMsgID, req.MsgFirstModifyTime, setValue)
if err != nil {
for _, value := range setValue {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = err.Error()
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
} else {
for _, value := range setValue {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
rResp.Result = append(rResp.Result, temp)
}
}
lockErr := rpc.dMessageLocker.UnLockGlobalMessage(req.ClientMsgID)
if lockErr != nil {
log.Error(req.OperationID, "UnLockGlobalMessage err:", lockErr.Error())
}
}
ExtendMessageDeleteNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, false, isExists)
log.Debug(req.OperationID, utils.GetSelfFuncName(), "rpc return is:", rResp.String())
return &rResp, nil
}

View File

@ -0,0 +1,131 @@
package msg
import (
"Open_IM/pkg/base_info"
"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/msg"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
"strings"
)
func ExtendMessageUpdatedNotification(operationID, sendID string, sourceID string, sessionType int32,
req *msg.SetMessageReactionExtensionsReq, resp *msg.SetMessageReactionExtensionsResp, isHistory bool, isReactionFromCache bool) {
var m base_info.ReactionMessageModifierNotification
m.SourceID = req.SourceID
m.OpUserID = req.OpUserID
m.Operation = constant.SetMessageExtensions
m.SessionType = req.SessionType
keyMap := make(map[string]*open_im_sdk.KeyValue)
for _, valueResp := range resp.Result {
if valueResp.ErrCode == 0 {
keyMap[valueResp.KeyValue.TypeKey] = valueResp.KeyValue
}
}
if len(keyMap) == 0 {
log.NewWarn(operationID, "all key set failed can not send notification", *req)
return
}
m.SuccessReactionExtensionList = keyMap
m.ClientMsgID = req.ClientMsgID
m.IsReact = resp.IsReact
m.IsExternalExtensions = req.IsExternalExtensions
m.MsgFirstModifyTime = resp.MsgFirstModifyTime
messageReactionSender(operationID, sendID, sourceID, sessionType, constant.ReactionMessageModifier, utils.StructToJsonString(m), isHistory, isReactionFromCache)
}
func ExtendMessageAddedNotification(operationID, sendID string, sourceID string, sessionType int32,
req *msg.AddMessageReactionExtensionsReq, resp *msg.AddMessageReactionExtensionsResp, isHistory bool, isReactionFromCache bool) {
var m base_info.ReactionMessageModifierNotification
m.SourceID = req.SourceID
m.OpUserID = req.OpUserID
m.Operation = constant.AddMessageExtensions
m.SessionType = req.SessionType
keyMap := make(map[string]*open_im_sdk.KeyValue)
for _, valueResp := range resp.Result {
if valueResp.ErrCode == 0 {
keyMap[valueResp.KeyValue.TypeKey] = valueResp.KeyValue
}
}
if len(keyMap) == 0 {
log.NewWarn(operationID, "all key set failed can not send notification", *req)
return
}
m.SuccessReactionExtensionList = keyMap
m.ClientMsgID = req.ClientMsgID
m.IsReact = resp.IsReact
m.IsExternalExtensions = req.IsExternalExtensions
m.MsgFirstModifyTime = resp.MsgFirstModifyTime
messageReactionSender(operationID, sendID, sourceID, sessionType, constant.ReactionMessageModifier, utils.StructToJsonString(m), isHistory, isReactionFromCache)
}
func ExtendMessageDeleteNotification(operationID, sendID string, sourceID string, sessionType int32,
req *msg.DeleteMessageListReactionExtensionsReq, resp *msg.DeleteMessageListReactionExtensionsResp, isHistory bool, isReactionFromCache bool) {
var m base_info.ReactionMessageDeleteNotification
m.SourceID = req.SourceID
m.OpUserID = req.OpUserID
m.SessionType = req.SessionType
keyMap := make(map[string]*open_im_sdk.KeyValue)
for _, valueResp := range resp.Result {
if valueResp.ErrCode == 0 {
keyMap[valueResp.KeyValue.TypeKey] = valueResp.KeyValue
}
}
if len(keyMap) == 0 {
log.NewWarn(operationID, "all key set failed can not send notification", *req)
return
}
m.SuccessReactionExtensionList = keyMap
m.ClientMsgID = req.ClientMsgID
m.MsgFirstModifyTime = req.MsgFirstModifyTime
messageReactionSender(operationID, sendID, sourceID, sessionType, constant.ReactionMessageDeleter, utils.StructToJsonString(m), isHistory, isReactionFromCache)
}
func messageReactionSender(operationID, sendID string, sourceID string, sessionType, contentType int32, content string, isHistory bool, isReactionFromCache bool) {
options := make(map[string]bool, 5)
utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false)
utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false)
utils.SetSwitchFromOptions(options, constant.IsSenderConversationUpdate, false)
utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false)
utils.SetSwitchFromOptions(options, constant.IsReactionFromCache, isReactionFromCache)
if !isHistory {
utils.SetSwitchFromOptions(options, constant.IsHistory, false)
utils.SetSwitchFromOptions(options, constant.IsPersistent, false)
}
pbData := msg.SendMsgReq{
OperationID: operationID,
MsgData: &open_im_sdk.MsgData{
SendID: sendID,
ClientMsgID: utils.GetMsgID(sendID),
SessionType: sessionType,
MsgFrom: constant.SysMsgType,
ContentType: contentType,
Content: []byte(content),
// ForceList: params.ForceList,
CreateTime: utils.GetCurrentTimestampByMill(),
Options: options,
},
}
switch sessionType {
case constant.SingleChatType, constant.NotificationChatType:
pbData.MsgData.RecvID = sourceID
case constant.GroupChatType, constant.SuperGroupChatType:
pbData.MsgData.GroupID = sourceID
}
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, operationID)
if etcdConn == nil {
errMsg := operationID + "getcdv3.GetDefaultConn == nil"
log.NewError(operationID, errMsg)
return
}
client := msg.NewMsgClient(etcdConn)
reply, err := client.SendMsg(context.Background(), &pbData)
if err != nil {
log.NewError(operationID, "SendMsg rpc failed, ", pbData.String(), err.Error())
} else if reply.ErrCode != 0 {
log.NewError(operationID, "SendMsg rpc failed, ", pbData.String(), reply.ErrCode, reply.ErrMsg)
}
}

View File

@ -0,0 +1,104 @@
package msg
import (
cbApi "Open_IM/pkg/call_back_struct"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
"Open_IM/pkg/proto/msg"
"Open_IM/pkg/utils"
http2 "net/http"
)
func callbackSetMessageReactionExtensions(setReq *msg.SetMessageReactionExtensionsReq) *cbApi.CallbackBeforeSetMessageReactionExtResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: setReq.OperationID}
log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), setReq.String())
req := cbApi.CallbackBeforeSetMessageReactionExtReq{
OperationID: setReq.OperationID,
CallbackCommand: constant.CallbackBeforeSetMessageReactionExtensionCommand,
SourceID: setReq.SourceID,
OpUserID: setReq.OpUserID,
SessionType: setReq.SessionType,
ReactionExtensionList: setReq.ReactionExtensionList,
ClientMsgID: setReq.ClientMsgID,
IsReact: setReq.IsReact,
IsExternalExtensions: setReq.IsExternalExtensions,
MsgFirstModifyTime: setReq.MsgFirstModifyTime,
}
resp := &cbApi.CallbackBeforeSetMessageReactionExtResp{CommonCallbackResp: &callbackResp}
defer log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), req, *resp)
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeSetMessageReactionExtensionCommand, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError
callbackResp.ErrMsg = err.Error()
}
return resp
}
func callbackDeleteMessageReactionExtensions(setReq *msg.DeleteMessageListReactionExtensionsReq) *cbApi.CallbackDeleteMessageReactionExtResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: setReq.OperationID}
log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), setReq.String())
req := cbApi.CallbackDeleteMessageReactionExtReq{
OperationID: setReq.OperationID,
CallbackCommand: constant.CallbackBeforeDeleteMessageReactionExtensionsCommand,
SourceID: setReq.SourceID,
OpUserID: setReq.OpUserID,
SessionType: setReq.SessionType,
ReactionExtensionList: setReq.ReactionExtensionList,
ClientMsgID: setReq.ClientMsgID,
IsExternalExtensions: setReq.IsExternalExtensions,
MsgFirstModifyTime: setReq.MsgFirstModifyTime,
}
resp := &cbApi.CallbackDeleteMessageReactionExtResp{CommonCallbackResp: &callbackResp}
defer log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), req, *resp)
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeDeleteMessageReactionExtensionsCommand, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError
callbackResp.ErrMsg = err.Error()
}
return resp
}
func callbackGetMessageListReactionExtensions(getReq *msg.GetMessageListReactionExtensionsReq) *cbApi.CallbackGetMessageListReactionExtResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: getReq.OperationID}
log.NewDebug(getReq.OperationID, utils.GetSelfFuncName(), getReq.String())
req := cbApi.CallbackGetMessageListReactionExtReq{
OperationID: getReq.OperationID,
CallbackCommand: constant.CallbackGetMessageListReactionExtensionsCommand,
SourceID: getReq.SourceID,
OpUserID: getReq.OpUserID,
SessionType: getReq.SessionType,
TypeKeyList: getReq.TypeKeyList,
MessageKeyList: getReq.MessageReactionKeyList,
}
resp := &cbApi.CallbackGetMessageListReactionExtResp{CommonCallbackResp: &callbackResp}
defer log.NewDebug(getReq.OperationID, utils.GetSelfFuncName(), req, *resp)
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackGetMessageListReactionExtensionsCommand, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError
callbackResp.ErrMsg = err.Error()
}
return resp
}
func callbackAddMessageReactionExtensions(setReq *msg.AddMessageReactionExtensionsReq) *cbApi.CallbackAddMessageReactionExtResp {
callbackResp := cbApi.CommonCallbackResp{OperationID: setReq.OperationID}
log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), setReq.String())
req := cbApi.CallbackAddMessageReactionExtReq{
OperationID: setReq.OperationID,
CallbackCommand: constant.CallbackAddMessageListReactionExtensionsCommand,
SourceID: setReq.SourceID,
OpUserID: setReq.OpUserID,
SessionType: setReq.SessionType,
ReactionExtensionList: setReq.ReactionExtensionList,
ClientMsgID: setReq.ClientMsgID,
IsReact: setReq.IsReact,
IsExternalExtensions: setReq.IsExternalExtensions,
MsgFirstModifyTime: setReq.MsgFirstModifyTime,
}
resp := &cbApi.CallbackAddMessageReactionExtResp{CommonCallbackResp: &callbackResp}
defer log.NewDebug(setReq.OperationID, utils.GetSelfFuncName(), req, *resp, *resp.CommonCallbackResp, resp.IsReact, resp.MsgFirstModifyTime)
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackAddMessageListReactionExtensionsCommand, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError
callbackResp.ErrMsg = err.Error()
}
return resp
}

View File

@ -245,12 +245,15 @@ func GroupCreatedNotification(operationID, opUserID, groupID string, initMemberL
// notification := "" // notification := ""
// introduction := "" // introduction := ""
// faceURL := "" // faceURL := ""
func GroupInfoSetNotification(operationID, opUserID, groupID string, groupName, notification, introduction, faceURL string, needVerification *wrapperspb.Int32Value) { func GroupInfoSetNotification(operationID, opUserID, groupID string, groupName, notification, introduction, faceURL string, needVerification, applyMemberFriend, lookMemberInfo *wrapperspb.Int32Value) {
GroupInfoChangedTips := open_im_sdk.GroupInfoSetTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} GroupInfoChangedTips := open_im_sdk.GroupInfoSetTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}}
if err := setGroupInfo(groupID, GroupInfoChangedTips.Group); err != nil { if err := setGroupInfo(groupID, GroupInfoChangedTips.Group); err != nil {
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
return return
} }
GroupInfoChangedTips.Group.NeedVerification = 0
GroupInfoChangedTips.Group.LookMemberInfo = 0
GroupInfoChangedTips.Group.ApplyMemberFriend = 0
GroupInfoChangedTips.Group.GroupName = groupName GroupInfoChangedTips.Group.GroupName = groupName
GroupInfoChangedTips.Group.Notification = notification GroupInfoChangedTips.Group.Notification = notification
GroupInfoChangedTips.Group.Introduction = introduction GroupInfoChangedTips.Group.Introduction = introduction
@ -258,6 +261,12 @@ func GroupInfoSetNotification(operationID, opUserID, groupID string, groupName,
if needVerification != nil { if needVerification != nil {
GroupInfoChangedTips.Group.NeedVerification = needVerification.Value GroupInfoChangedTips.Group.NeedVerification = needVerification.Value
} }
if applyMemberFriend != nil {
GroupInfoChangedTips.Group.ApplyMemberFriend = applyMemberFriend.Value
}
if lookMemberInfo != nil {
GroupInfoChangedTips.Group.LookMemberInfo = lookMemberInfo.Value
}
if err := setOpUserInfo(opUserID, groupID, GroupInfoChangedTips.OpUser); err != nil { if err := setOpUserInfo(opUserID, groupID, GroupInfoChangedTips.OpUser); err != nil {
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
@ -435,7 +444,20 @@ func GroupApplicationAcceptedNotification(req *pbGroup.GroupApplicationResponseR
log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser) log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser)
return return
} }
groupNotification(constant.GroupApplicationAcceptedNotification, &GroupApplicationAcceptedTips, req.OpUserID, "", req.FromUserID, req.OperationID) groupNotification(constant.GroupApplicationAcceptedNotification, &GroupApplicationAcceptedTips, req.OpUserID, "", req.FromUserID, req.OperationID)
adminList, err := imdb.GetOwnerManagerByGroupID(req.GroupID)
if err != nil {
log.Error(req.OperationID, "GetOwnerManagerByGroupID failed", req.GroupID)
return
}
for _, v := range adminList {
if v.UserID == req.OpUserID {
continue
}
GroupApplicationAcceptedTips.ReceiverAs = 1
groupNotification(constant.GroupApplicationAcceptedNotification, &GroupApplicationAcceptedTips, req.OpUserID, "", v.UserID, req.OperationID)
}
} }
func GroupApplicationRejectedNotification(req *pbGroup.GroupApplicationResponseReq) { func GroupApplicationRejectedNotification(req *pbGroup.GroupApplicationResponseReq) {
@ -449,6 +471,18 @@ func GroupApplicationRejectedNotification(req *pbGroup.GroupApplicationResponseR
return return
} }
groupNotification(constant.GroupApplicationRejectedNotification, &GroupApplicationRejectedTips, req.OpUserID, "", req.FromUserID, req.OperationID) groupNotification(constant.GroupApplicationRejectedNotification, &GroupApplicationRejectedTips, req.OpUserID, "", req.FromUserID, req.OperationID)
adminList, err := imdb.GetOwnerManagerByGroupID(req.GroupID)
if err != nil {
log.Error(req.OperationID, "GetOwnerManagerByGroupID failed", req.GroupID)
return
}
for _, v := range adminList {
if v.UserID == req.OpUserID {
continue
}
GroupApplicationRejectedTips.ReceiverAs = 1
groupNotification(constant.GroupApplicationRejectedNotification, &GroupApplicationRejectedTips, req.OpUserID, "", v.UserID, req.OperationID)
}
} }
func GroupOwnerTransferredNotification(req *pbGroup.TransferGroupOwnerReq) { func GroupOwnerTransferredNotification(req *pbGroup.TransferGroupOwnerReq) {

52
internal/rpc/msg/lock.go Normal file
View File

@ -0,0 +1,52 @@
package msg
import (
"Open_IM/pkg/common/db"
"time"
)
const GlOBLLOCK = "GLOBAL_LOCK"
type MessageLocker interface {
LockMessageTypeKey(clientMsgID, typeKey string) (err error)
UnLockMessageTypeKey(clientMsgID string, typeKey string) error
LockGlobalMessage(clientMsgID string) (err error)
UnLockGlobalMessage(clientMsgID string) (err error)
}
type LockerMessage struct{}
func NewLockerMessage() *LockerMessage {
return &LockerMessage{}
}
func (l *LockerMessage) LockMessageTypeKey(clientMsgID, typeKey string) (err error) {
for i := 0; i < 3; i++ {
err = db.DB.LockMessageTypeKey(clientMsgID, typeKey)
if err != nil {
time.Sleep(time.Millisecond * 100)
continue
} else {
break
}
}
return err
}
func (l *LockerMessage) LockGlobalMessage(clientMsgID string) (err error) {
for i := 0; i < 3; i++ {
err = db.DB.LockMessageTypeKey(clientMsgID, GlOBLLOCK)
if err != nil {
time.Sleep(time.Millisecond * 100)
continue
} else {
break
}
}
return err
}
func (l *LockerMessage) UnLockMessageTypeKey(clientMsgID string, typeKey string) error {
return db.DB.UnLockMessageTypeKey(clientMsgID, typeKey)
}
func (l *LockerMessage) UnLockGlobalMessage(clientMsgID string) error {
return db.DB.UnLockMessageTypeKey(clientMsgID, GlOBLLOCK)
}

View File

@ -32,6 +32,7 @@ type rpcChat struct {
messageWriter MessageWriter messageWriter MessageWriter
//offlineProducer *kafka.Producer //offlineProducer *kafka.Producer
delMsgCh chan deleteMsg delMsgCh chan deleteMsg
dMessageLocker MessageLocker
} }
type deleteMsg struct { type deleteMsg struct {
@ -48,6 +49,7 @@ func NewRpcChatServer(port int) *rpcChat {
rpcRegisterName: config.Config.RpcRegisterName.OpenImMsgName, rpcRegisterName: config.Config.RpcRegisterName.OpenImMsgName,
etcdSchema: config.Config.Etcd.EtcdSchema, etcdSchema: config.Config.Etcd.EtcdSchema,
etcdAddr: config.Config.Etcd.EtcdAddr, etcdAddr: config.Config.Etcd.EtcdAddr,
dMessageLocker: NewLockerMessage(),
} }
rc.messageWriter = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) rc.messageWriter = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic)
//rc.offlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.Ws2mschatOffline.Topic) //rc.offlineProducer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschatOffline.Addr, config.Config.Kafka.Ws2mschatOffline.Topic)
@ -143,14 +145,9 @@ func (rpc *rpcChat) runCh() {
select { select {
case msg := <-rpc.delMsgCh: case msg := <-rpc.delMsgCh:
log.NewInfo(msg.OperationID, utils.GetSelfFuncName(), "delmsgch recv new: ", msg) log.NewInfo(msg.OperationID, utils.GetSelfFuncName(), "delmsgch recv new: ", msg)
if len(msg.SeqList) > 0 {
db.DB.DelMsgFromCache(msg.UserID, msg.SeqList, msg.OperationID) db.DB.DelMsgFromCache(msg.UserID, msg.SeqList, msg.OperationID)
unexistSeqList, err := db.DB.DelMsgBySeqList(msg.UserID, msg.SeqList, msg.OperationID) DeleteMessageNotification(msg.OpUserID, msg.UserID, msg.SeqList, msg.OperationID)
if err != nil {
log.NewError(msg.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", msg.UserID, msg.SeqList, msg.OperationID, err.Error())
continue
}
if len(unexistSeqList) > 0 {
DeleteMessageNotification(msg.OpUserID, msg.UserID, unexistSeqList, msg.OperationID)
} }
} }
} }

View File

@ -25,6 +25,7 @@ import (
"time" "time"
promePkg "Open_IM/pkg/common/prometheus" promePkg "Open_IM/pkg/common/prometheus"
go_redis "github.com/go-redis/redis/v8" go_redis "github.com/go-redis/redis/v8"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
) )
@ -125,7 +126,7 @@ func (rpc *rpcChat) messageVerification(data *pbChat.SendMsgReq) (bool, int32, s
if utils.IsContain(data.MsgData.SendID, config.Config.Manager.AppManagerUid) { if utils.IsContain(data.MsgData.SendID, config.Config.Manager.AppManagerUid) {
return true, 0, "", nil return true, 0, "", nil
} }
if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin { if data.MsgData.ContentType <= constant.NotificationEnd && data.MsgData.ContentType >= constant.NotificationBegin && data.MsgData.ContentType != constant.SignalingNotification {
return true, 0, "", nil return true, 0, "", nil
} }
log.NewDebug(data.OperationID, *config.Config.MessageVerify.FriendVerify) log.NewDebug(data.OperationID, *config.Config.MessageVerify.FriendVerify)

View File

@ -163,6 +163,22 @@ func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.Batc
return resp, nil return resp, nil
} }
if v.ConversationType == constant.SuperGroupChatType {
if v.RecvMsgOpt == constant.ReceiveNotNotifyMessage {
if err := db.DB.SetSuperGroupUserReceiveNotNotifyMessage(v.GroupID, v.OwnerUserID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), v.GroupID, v.OwnerUserID)
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}
return resp, nil
}
} else {
if err := db.DB.SetSuperGroupUserReceiveNotifyMessage(v.GroupID, v.OwnerUserID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), v.GroupID, err.Error())
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}
return resp, nil
}
}
}
isUpdate, err := imdb.SetConversation(conversation) isUpdate, err := imdb.SetConversation(conversation)
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
@ -251,7 +267,7 @@ func (s *userServer) SetConversation(ctx context.Context, req *pbUser.SetConvers
if req.NotificationType == 0 { if req.NotificationType == 0 {
req.NotificationType = constant.ConversationOptChangeNotification req.NotificationType = constant.ConversationOptChangeNotification
} }
if req.Conversation.ConversationType == constant.GroupChatType { if req.Conversation.ConversationType == constant.GroupChatType || req.Conversation.ConversationType == constant.SuperGroupChatType {
groupInfo, err := imdb.GetGroupInfoByGroupID(req.Conversation.GroupID) groupInfo, err := imdb.GetGroupInfoByGroupID(req.Conversation.GroupID)
if err != nil { if err != nil {
log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.Conversation.GroupID, err.Error()) log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.Conversation.GroupID, err.Error())
@ -264,7 +280,24 @@ func (s *userServer) SetConversation(ctx context.Context, req *pbUser.SetConvers
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg} resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}
return resp, nil return resp, nil
} }
if req.Conversation.ConversationType == constant.SuperGroupChatType {
if req.Conversation.RecvMsgOpt == constant.ReceiveNotNotifyMessage {
if err = db.DB.SetSuperGroupUserReceiveNotNotifyMessage(req.Conversation.GroupID, req.Conversation.OwnerUserID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), req.Conversation.GroupID, req.Conversation.OwnerUserID)
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}
return resp, nil
} }
} else {
if err = db.DB.SetSuperGroupUserReceiveNotifyMessage(req.Conversation.GroupID, req.Conversation.OwnerUserID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), req.Conversation.GroupID, err.Error())
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}
return resp, nil
}
}
}
}
var conversation db.Conversation var conversation db.Conversation
if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil { if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req.Conversation, err.Error()) log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req.Conversation, err.Error())
@ -326,6 +359,21 @@ func (s *userServer) SetRecvMsgOpt(ctx context.Context, req *pbUser.SetRecvMsgOp
case "group": case "group":
conversation.GroupID = stringList[1] conversation.GroupID = stringList[1]
conversation.ConversationType = constant.GroupChatType conversation.ConversationType = constant.GroupChatType
case "super_group":
conversation.GroupID = stringList[1]
if req.RecvMsgOpt == constant.ReceiveNotNotifyMessage {
if err := db.DB.SetSuperGroupUserReceiveNotNotifyMessage(conversation.GroupID, req.OwnerUserID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), conversation.GroupID, req.OwnerUserID)
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
return resp, nil
}
} else {
if err := db.DB.SetSuperGroupUserReceiveNotifyMessage(conversation.GroupID, req.OwnerUserID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error(), conversation.GroupID, req.OwnerUserID)
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
return resp, nil
}
}
} }
} }
isUpdate, err := imdb.SetRecvMsgOpt(conversation) isUpdate, err := imdb.SetRecvMsgOpt(conversation)
@ -334,6 +382,7 @@ func (s *userServer) SetRecvMsgOpt(ctx context.Context, req *pbUser.SetRecvMsgOp
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
return resp, nil return resp, nil
} }
if isUpdate { if isUpdate {
err = rocksCache.DelConversationFromCache(conversation.OwnerUserID, conversation.ConversationID) err = rocksCache.DelConversationFromCache(conversation.OwnerUserID, conversation.ConversationID)
} else { } else {

View File

@ -29,6 +29,7 @@ type GetGroupMembersInfoReq struct {
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
MemberList []string `json:"memberList" binding:"required"` MemberList []string `json:"memberList" binding:"required"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
NoCache bool `json:"noCache"`
} }
type GetGroupMembersInfoResp struct { type GetGroupMembersInfoResp struct {
CommResp CommResp

View File

@ -1,5 +1,10 @@
package base_info package base_info
import (
"Open_IM/pkg/proto/msg"
sdk_ws "Open_IM/pkg/proto/sdk_ws"
)
type DelMsgReq struct { type DelMsgReq struct {
UserID string `json:"userID,omitempty" binding:"required"` UserID string `json:"userID,omitempty" binding:"required"`
SeqList []uint32 `json:"seqList,omitempty" binding:"required"` SeqList []uint32 `json:"seqList,omitempty" binding:"required"`
@ -18,6 +23,7 @@ type CleanUpMsgReq struct {
type CleanUpMsgResp struct { type CleanUpMsgResp struct {
CommResp CommResp
} }
type DelSuperGroupMsgReq struct { type DelSuperGroupMsgReq struct {
UserID string `json:"userID" binding:"required"` UserID string `json:"userID" binding:"required"`
GroupID string `json:"groupID" binding:"required"` GroupID string `json:"groupID" binding:"required"`
@ -29,23 +35,109 @@ type DelSuperGroupMsgReq struct {
type DelSuperGroupMsgResp struct { type DelSuperGroupMsgResp struct {
CommResp CommResp
} }
type MsgDeleteNotificationElem struct { type MsgDeleteNotificationElem struct {
GroupID string `json:"groupID"` GroupID string `json:"groupID"`
IsAllDelete bool `json:"isAllDelete"` IsAllDelete bool `json:"isAllDelete"`
SeqList []uint32 `json:"seqList"` SeqList []uint32 `json:"seqList"`
} }
//UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
// GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"`
// MinSeq uint32 `protobuf:"varint,3,opt,name=minSeq" json:"minSeq,omitempty"`
// OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"`
// OpUserID string `protobuf:"bytes,5,opt,name=opUserID" json:"opUserID,omitempty"`
type SetMsgMinSeqReq struct { type SetMsgMinSeqReq struct {
UserID string `json:"userID" binding:"required"` UserID string `json:"userID" binding:"required"`
GroupID string `json:"groupID"` GroupID string `json:"groupID"`
MinSeq uint32 `json:"minSeq" binding:"required"` MinSeq uint32 `json:"minSeq" binding:"required"`
OperationID string `json:"operationID" binding:"required"` OperationID string `json:"operationID" binding:"required"`
} }
type SetMsgMinSeqResp struct { type SetMsgMinSeqResp struct {
CommResp CommResp
} }
type ModifyMessageReactionExtensionsReq struct {
OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
Ex *string `json:"ex"`
AttachedInfo *string `json:"attachedInfo"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type ModifyMessageReactionExtensionsResp struct {
CommResp
Data struct {
ResultKeyValue []*msg.KeyValueResp `json:"result"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
IsReact bool `json:"isReact"`
} `json:"data"`
}
type OperateMessageListReactionExtensionsReq struct {
OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
IsExternalExtensions bool `json:"isExternalExtensions"`
TypeKeyList []string `json:"typeKeyList"`
MessageReactionKeyList []*msg.GetMessageListReactionExtensionsReq_MessageReactionKey `json:"messageReactionKeyList" binding:"required"`
}
type OperateMessageListReactionExtensionsResp struct {
CommResp
Data struct {
SuccessList []*msg.ExtendMsgResp `json:"successList"`
FailedList []*msg.ExtendMsgResp `json:"failedList"`
} `json:"data"`
}
type SetMessageReactionExtensionsReq ModifyMessageReactionExtensionsReq
type SetMessageReactionExtensionsResp ModifyMessageReactionExtensionsResp
type AddMessageReactionExtensionsReq ModifyMessageReactionExtensionsReq
type AddMessageReactionExtensionsResp ModifyMessageReactionExtensionsResp
type GetMessageListReactionExtensionsReq OperateMessageListReactionExtensionsReq
type GetMessageListReactionExtensionsResp struct {
CommResp
Data []*msg.SingleMessageExtensionResult `json:"data"`
}
type DeleteMessageReactionExtensionsReq struct {
OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime" binding:"required"`
ReactionExtensionList []*sdk_ws.KeyValue `json:"reactionExtensionList" binding:"required"`
}
type DeleteMessageReactionExtensionsResp struct {
CommResp
Data []*msg.KeyValueResp
}
type ReactionMessageModifierNotification struct {
Operation int `json:"operation" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
OpUserID string `json:"opUserID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
SuccessReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type ReactionMessageDeleteNotification struct {
SourceID string `json:"sourceID" binding:"required"`
OpUserID string `json:"opUserID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
SuccessReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}

View File

@ -46,3 +46,22 @@ type CallbackBeforeMemberJoinGroupResp struct {
MuteEndTime *int64 `json:"muteEndTime"` MuteEndTime *int64 `json:"muteEndTime"`
Ex *string `json:"ex"` Ex *string `json:"ex"`
} }
type CallbackBeforeSetGroupMemberInfoReq struct {
CallbackCommand string `json:"callbackCommand"`
OperationID string `json:"operationID"`
GroupID string `json:"groupID"`
UserID string `json:"userID"`
Nickname string `json:"nickName"`
FaceURL string `json:"faceURL"`
RoleLevel int32 `json:"roleLevel"`
Ex string `json:"ex"`
}
type CallbackBeforeSetGroupMemberInfoResp struct {
*CommonCallbackResp
Ex *string `json:"ex"`
Nickname *string `json:"nickName"`
FaceURL *string `json:"faceURL"`
RoleLevel *int32 `json:"roleLevel"`
}

View File

@ -1,6 +1,9 @@
package call_back_struct package call_back_struct
import sdk_ws "Open_IM/pkg/proto/sdk_ws" import (
"Open_IM/pkg/proto/msg"
sdk_ws "Open_IM/pkg/proto/sdk_ws"
)
type CallbackBeforeSendSingleMsgReq struct { type CallbackBeforeSendSingleMsgReq struct {
CommonCallbackReq CommonCallbackReq
@ -63,3 +66,68 @@ type CallbackMsgModifyCommandResp struct {
AttachedInfo *string `json:"attachedInfo"` AttachedInfo *string `json:"attachedInfo"`
Ex *string `json:"ex"` Ex *string `json:"ex"`
} }
type CallbackBeforeSetMessageReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList"`
ClientMsgID string `json:"clientMsgID"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackBeforeSetMessageReactionExtResp struct {
*CommonCallbackResp
ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackDeleteMessageReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
ReactionExtensionList []*sdk_ws.KeyValue `json:"reactionExtensionList"`
ClientMsgID string `json:"clientMsgID"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackDeleteMessageReactionExtResp struct {
*CommonCallbackResp
ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackGetMessageListReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
TypeKeyList []string `json:"typeKeyList"`
MessageKeyList []*msg.GetMessageListReactionExtensionsReq_MessageReactionKey `json:"messageKeyList"`
}
type CallbackGetMessageListReactionExtResp struct {
*CommonCallbackResp
MessageResultList []*msg.SingleMessageExtensionResult `json:"messageResultList"`
}
type CallbackAddMessageReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList"`
ClientMsgID string `json:"clientMsgID"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackAddMessageReactionExtResp struct {
*CommonCallbackResp
ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"`
IsReact bool `json:"isReact"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}

View File

@ -248,11 +248,16 @@ type config struct {
Addr []string `yaml:"addr"` Addr []string `yaml:"addr"`
Topic string `yaml:"topic"` Topic string `yaml:"topic"`
} }
MsgToModify struct {
Addr []string `yaml:"addr"`
Topic string `yaml:"topic"`
}
ConsumerGroupID struct { ConsumerGroupID struct {
MsgToRedis string `yaml:"msgToTransfer"` MsgToRedis string `yaml:"msgToTransfer"`
MsgToMongo string `yaml:"msgToMongo"` MsgToMongo string `yaml:"msgToMongo"`
MsgToMySql string `yaml:"msgToMySql"` MsgToMySql string `yaml:"msgToMySql"`
MsgToPush string `yaml:"msgToPush"` MsgToPush string `yaml:"msgToPush"`
MsgToModify string `yaml:"msgToModify"`
} }
} }
Secret string `yaml:"secret"` Secret string `yaml:"secret"`
@ -292,7 +297,7 @@ type config struct {
CallbackBeforeAddFriend callBackConfig `yaml:"callbackBeforeAddFriend"` CallbackBeforeAddFriend callBackConfig `yaml:"callbackBeforeAddFriend"`
CallbackBeforeCreateGroup callBackConfig `yaml:"callbackBeforeCreateGroup"` CallbackBeforeCreateGroup callBackConfig `yaml:"callbackBeforeCreateGroup"`
CallbackBeforeMemberJoinGroup callBackConfig `yaml:"callbackBeforeMemberJoinGroup"` CallbackBeforeMemberJoinGroup callBackConfig `yaml:"callbackBeforeMemberJoinGroup"`
CallbackBeforeExtendMsgModify callBackConfig `yaml:"callbackBeforeExtendMsgModify"` CallbackBeforeSetGroupMemberInfo callBackConfig `yaml:"callbackBeforeSetGroupMemberInfo"`
} `yaml:"callback"` } `yaml:"callback"`
Notification struct { Notification struct {
///////////////////////group///////////////////////////// ///////////////////////group/////////////////////////////
@ -648,7 +653,7 @@ func unmarshalConfig(config interface{}, configName string) {
} else { } else {
bytes, err := ioutil.ReadFile(fmt.Sprintf("../config/%s", configName)) bytes, err := ioutil.ReadFile(fmt.Sprintf("../config/%s", configName))
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error() + configName)
} }
if err = yaml.Unmarshal(bytes, config); err != nil { if err = yaml.Unmarshal(bytes, config); err != nil {
panic(err.Error()) panic(err.Error())

View File

@ -48,6 +48,8 @@ const (
AdvancedRevoke = 118 //影响前者消息 AdvancedRevoke = 118 //影响前者消息
CustomNotTriggerConversation = 119 CustomNotTriggerConversation = 119
CustomOnlineOnly = 120 CustomOnlineOnly = 120
ReactionMessageModifier = 121
ReactionMessageDeleter = 122
Common = 200 Common = 200
GroupMsg = 201 GroupMsg = 201
@ -169,6 +171,7 @@ const (
IsNotPrivate = "notPrivate" IsNotPrivate = "notPrivate"
IsSenderConversationUpdate = "senderConversationUpdate" IsSenderConversationUpdate = "senderConversationUpdate"
IsSenderNotificationPush = "senderNotificationPush" IsSenderNotificationPush = "senderNotificationPush"
IsReactionFromCache = "reactionFromCache"
//GroupStatus //GroupStatus
GroupOk = 0 GroupOk = 0
@ -216,6 +219,14 @@ const (
CallbackBeforeAddFriendCommand = "callbackBeforeAddFriendCommand" CallbackBeforeAddFriendCommand = "callbackBeforeAddFriendCommand"
CallbackBeforeCreateGroupCommand = "callbackBeforeCreateGroupCommand" CallbackBeforeCreateGroupCommand = "callbackBeforeCreateGroupCommand"
CallbackBeforeMemberJoinGroupCommand = "callbackBeforeMemberJoinGroupCommand" CallbackBeforeMemberJoinGroupCommand = "callbackBeforeMemberJoinGroupCommand"
CallbackBeforeSetGroupMemberInfoCommand = "CallbackBeforeSetGroupMemberInfoCommand"
CallbackBeforeSetMessageReactionExtensionCommand = "callbackBeforeSetMessageReactionExtensionCommand"
CallbackBeforeDeleteMessageReactionExtensionsCommand = "callbackBeforeDeleteMessageReactionExtensionsCommand"
CallbackGetMessageListReactionExtensionsCommand = "callbackGetMessageListReactionExtensionsCommand"
CallbackAddMessageListReactionExtensionsCommand = "callbackAddMessageListReactionExtensionsCommand"
SetMessageExtensions = 1
AddMessageExtensions = 2
//callback actionCode //callback actionCode
ActionAllow = 0 ActionAllow = 0

View File

@ -57,7 +57,7 @@ var PlatformName2ID = map[string]int{
IPadPlatformStr: IPadPlatformID, IPadPlatformStr: IPadPlatformID,
AdminPlatformStr: AdminPlatformID, AdminPlatformStr: AdminPlatformID,
} }
var Platform2class = map[string]string{ var PlatformName2class = map[string]string{
IOSPlatformStr: TerminalMobile, IOSPlatformStr: TerminalMobile,
AndroidPlatformStr: TerminalMobile, AndroidPlatformStr: TerminalMobile,
MiniWebPlatformStr: WebPlatformStr, MiniWebPlatformStr: WebPlatformStr,
@ -66,6 +66,15 @@ var Platform2class = map[string]string{
OSXPlatformStr: TerminalPC, OSXPlatformStr: TerminalPC,
LinuxPlatformStr: TerminalPC, LinuxPlatformStr: TerminalPC,
} }
var PlatformID2class = map[int]string{
IOSPlatformID: TerminalMobile,
AndroidPlatformID: TerminalMobile,
MiniWebPlatformID: WebPlatformStr,
WebPlatformID: WebPlatformStr,
WindowsPlatformID: TerminalPC,
OSXPlatformID: TerminalPC,
LinuxPlatformID: TerminalPC,
}
func PlatformIDToName(num int) string { func PlatformIDToName(num int) string {
return PlatformID2Name[num] return PlatformID2Name[num]
@ -74,5 +83,8 @@ func PlatformNameToID(name string) int {
return PlatformName2ID[name] return PlatformName2ID[name]
} }
func PlatformNameToClass(name string) string { func PlatformNameToClass(name string) string {
return Platform2class[name] return PlatformName2class[name]
}
func PlatformIDToClass(num int) string {
return PlatformID2class[num]
} }

View File

@ -28,6 +28,7 @@ const (
uidPidToken = "UID_PID_TOKEN_STATUS:" uidPidToken = "UID_PID_TOKEN_STATUS:"
conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:" conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:"
getuiToken = "GETUI_TOKEN" getuiToken = "GETUI_TOKEN"
getuiTaskID = "GETUI_TASK_ID"
messageCache = "MESSAGE_CACHE:" messageCache = "MESSAGE_CACHE:"
SignalCache = "SIGNAL_CACHE:" SignalCache = "SIGNAL_CACHE:"
SignalListCache = "SIGNAL_LIST_CACHE:" SignalListCache = "SIGNAL_LIST_CACHE:"
@ -38,6 +39,10 @@ const (
groupMinSeq = "GROUP_MIN_SEQ:" groupMinSeq = "GROUP_MIN_SEQ:"
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:" sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:"
userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:" userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:"
exTypeKeyLocker = "EX_LOCK:"
//temp
superGroupUserNotRecvOfflineMsgOptTemp = "SG_RECV_MSG_OPT_TEMP:"
) )
func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) {
@ -162,6 +167,23 @@ func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID strin
result, err := d.RDB.HGet(context.Background(), key, conversationID).Result() result, err := d.RDB.HGet(context.Background(), key, conversationID).Result()
return utils.StringToInt(result), err return utils.StringToInt(result), err
} }
func (d *DataBases) SetSuperGroupUserReceiveNotNotifyMessage(groupID, userID string) error {
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
return d.RDB.SAdd(context.Background(), key, userID).Err()
}
func (d *DataBases) SetSuperGroupUserReceiveNotifyMessage(groupID, userID string) error {
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
return d.RDB.SRem(context.Background(), key, userID).Err()
}
func (d *DataBases) GetSuperGroupUserReceiveNotNotifyMessageIDList(groupID string) ([]string, error) {
key := superGroupUserNotRecvOfflineMsgOptTemp + groupID
userIDs, _ := d.RDB.SMembers(context.Background(), key).Result()
return userIDs, nil
}
func (d *DataBases) SetUserGlobalMsgRecvOpt(userID string, opt int32) error { func (d *DataBases) SetUserGlobalMsgRecvOpt(userID string, opt int32) error {
key := conversationReceiveMessageOpt + userID key := conversationReceiveMessageOpt + userID
return d.RDB.HSet(context.Background(), key, GlobalMsgRecvOpt, opt).Err() return d.RDB.HSet(context.Background(), key, GlobalMsgRecvOpt, opt).Err()
@ -372,7 +394,7 @@ func (d *DataBases) DelMsgFromCache(uid string, seqList []uint32, operationID st
continue continue
} }
var msg pbCommon.MsgData var msg pbCommon.MsgData
if err := utils.String2Pb(result, &msg); err != nil { if err := jsonpb.UnmarshalString(result, &msg); err != nil {
log2.Error(operationID, utils.GetSelfFuncName(), "String2Pb failed", msg, result, key, err.Error()) log2.Error(operationID, utils.GetSelfFuncName(), "String2Pb failed", msg, result, key, err.Error())
continue continue
} }
@ -397,6 +419,15 @@ func (d *DataBases) GetGetuiToken() (string, error) {
return result, err return result, err
} }
func (d *DataBases) SetGetuiTaskID(taskID string, expireTime int64) error {
return d.RDB.Set(context.Background(), getuiTaskID, taskID, time.Duration(expireTime)*time.Second).Err()
}
func (d *DataBases) GetGetuiTaskID() (string, error) {
result, err := d.RDB.Get(context.Background(), getuiTaskID).Result()
return result, err
}
func (d *DataBases) SetSendMsgStatus(status int32, operationID string) error { func (d *DataBases) SetSendMsgStatus(status int32, operationID string) error {
return d.RDB.Set(context.Background(), sendMsgFailedFlag+operationID, status, time.Hour*24).Err() return d.RDB.Set(context.Background(), sendMsgFailedFlag+operationID, status, time.Hour*24).Err()
} }
@ -437,3 +468,61 @@ func (d *DataBases) GetUserBadgeUnreadCountSum(uid string) (int, error) {
seq, err := d.RDB.Get(context.Background(), key).Result() seq, err := d.RDB.Get(context.Background(), key).Result()
return utils.StringToInt(seq), err return utils.StringToInt(seq), err
} }
func (d *DataBases) JudgeMessageReactionEXISTS(clientMsgID string, sessionType int32) (bool, error) {
key := getMessageReactionExPrefix(clientMsgID, sessionType)
n, err := d.RDB.Exists(context.Background(), key).Result()
if n > 0 {
return true, err
} else {
return false, err
}
}
func (d *DataBases) GetOneMessageAllReactionList(clientMsgID string, sessionType int32) (map[string]string, error) {
key := getMessageReactionExPrefix(clientMsgID, sessionType)
return d.RDB.HGetAll(context.Background(), key).Result()
}
func (d *DataBases) DeleteOneMessageKey(clientMsgID string, sessionType int32, subKey string) error {
key := getMessageReactionExPrefix(clientMsgID, sessionType)
return d.RDB.HDel(context.Background(), key, subKey).Err()
}
func (d *DataBases) SetMessageReactionExpire(clientMsgID string, sessionType int32, expiration time.Duration) (bool, error) {
key := getMessageReactionExPrefix(clientMsgID, sessionType)
return d.RDB.Expire(context.Background(), key, expiration).Result()
}
func (d *DataBases) GetMessageTypeKeyValue(clientMsgID string, sessionType int32, typeKey string) (string, error) {
key := getMessageReactionExPrefix(clientMsgID, sessionType)
result, err := d.RDB.HGet(context.Background(), key, typeKey).Result()
return result, err
}
func (d *DataBases) SetMessageTypeKeyValue(clientMsgID string, sessionType int32, typeKey, value string) error {
key := getMessageReactionExPrefix(clientMsgID, sessionType)
return d.RDB.HSet(context.Background(), key, typeKey, value).Err()
}
func (d *DataBases) LockMessageTypeKey(clientMsgID string, TypeKey string) error {
key := exTypeKeyLocker + clientMsgID + "_" + TypeKey
return d.RDB.SetNX(context.Background(), key, 1, time.Minute).Err()
}
func (d *DataBases) UnLockMessageTypeKey(clientMsgID string, TypeKey string) error {
key := exTypeKeyLocker + clientMsgID + "_" + TypeKey
return d.RDB.Del(context.Background(), key).Err()
}
func getMessageReactionExPrefix(clientMsgID string, sessionType int32) string {
switch sessionType {
case constant.SingleChatType:
return "EX_SINGLE_" + clientMsgID
case constant.GroupChatType:
return "EX_GROUP_" + clientMsgID
case constant.SuperGroupChatType:
return "EX_SUPER_GROUP_" + clientMsgID
case constant.NotificationChatType:
return "EX_NOTIFICATION" + clientMsgID
}
return ""
}

View File

@ -2,46 +2,61 @@ package db
import ( import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
server_api_params "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"
"errors"
"fmt" "fmt"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"strconv" "strconv"
"strings"
"time" "time"
"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson"
) )
const cExtendMsgSet = "extend_msgs" const cExtendMsgSet = "extend_msgs"
const MaxNum = 100
type ExtendMsgSet struct { type ExtendMsgSet struct {
ID string `bson:"id" json:"ID"` SourceID string `bson:"source_id" json:"sourceID"`
SessionType int32 `bson:"session_type" json:"sessionType"`
ExtendMsgs map[string]ExtendMsg `bson:"extend_msgs" json:"extendMsgs"` ExtendMsgs map[string]ExtendMsg `bson:"extend_msgs" json:"extendMsgs"`
LatestUpdateTime int32 `bson:"latest_update_time" json:"latestUpdateTime"`
AttachedInfo *string `bson:"attached_info" json:"attachedInfo"`
Ex *string `bson:"ex" json:"ex"`
ExtendMsgNum int32 `bson:"extend_msg_num" json:"extendMsgNum"` ExtendMsgNum int32 `bson:"extend_msg_num" json:"extendMsgNum"`
CreateTime int32 `bson:"create_time" json:"createTime"` CreateTime int64 `bson:"create_time" json:"createTime"` // this block's create time
MaxMsgUpdateTime int64 `bson:"max_msg_update_time" json:"maxMsgUpdateTime"` // index find msg
} }
type ReactionExtendMsgSet struct { type KeyValue struct {
UserKey string `bson:"user_key" json:"userKey"` TypeKey string `bson:"type_key" json:"typeKey"`
Value string `bson:"value" json:"value"` Value string `bson:"value" json:"value"`
LatestUpdateTime int32 `bson:"latest_update_time" json:"latestUpdateTime"` LatestUpdateTime int64 `bson:"latest_update_time" json:"latestUpdateTime"`
} }
type ExtendMsg struct { type ExtendMsg struct {
Content map[string]ReactionExtendMsgSet `bson:"content" json:"content"` ReactionExtensionList map[string]KeyValue `bson:"reaction_extension_list" json:"reactionExtensionList"`
ClientMsgID string `bson:"client_msg_id" json:"clientMsgID"` ClientMsgID string `bson:"client_msg_id" json:"clientMsgID"`
CreateTime int32 `bson:"create_time" json:"createTime"` MsgFirstModifyTime int64 `bson:"msg_first_modify_time" json:"msgFirstModifyTime"` // this extendMsg create time
LatestUpdateTime int32 `bson:"latest_update_time" json:"latestUpdateTime"` AttachedInfo string `bson:"attached_info" json:"attachedInfo"`
Ex string `bson:"ex" json:"ex"`
} }
func GetExtendMsgSetID(ID string, index int32) string { func GetExtendMsgMaxNum() int32 {
return MaxNum
}
func GetExtendMsgSourceID(ID string, index int32) string {
return ID + ":" + strconv.Itoa(int(index)) return ID + ":" + strconv.Itoa(int(index))
} }
func SplitSourceIDAndGetIndex(sourceID string) int32 {
l := strings.Split(sourceID, ":")
index, _ := strconv.Atoi(l[len(l)-1])
return int32(index)
}
func (d *DataBases) CreateExtendMsgSet(set *ExtendMsgSet) error { func (d *DataBases) CreateExtendMsgSet(set *ExtendMsgSet) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
@ -75,61 +90,116 @@ func (d *DataBases) GetAllExtendMsgSet(ID string, opts *GetAllExtendMsgSetOpts)
return sets, nil return sets, nil
} }
type GetExtendMsgSetOpts struct { func (d *DataBases) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64, c *mongo.Collection) (*ExtendMsgSet, error) {
ExcludeExtendMsgs bool regex := fmt.Sprintf("^%s", sourceID)
var err error
findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{"extend_msgs": 0})
// update newest
find := bson.M{"source_id": primitive.Regex{Pattern: regex}, "session_type": sessionType}
if maxMsgUpdateTime > 0 {
find["max_msg_update_time"] = maxMsgUpdateTime
} }
result, err := c.Find(ctx, find, findOpts)
func (d *DataBases) GetExtendMsgSet(ID string, index int32, opts *GetExtendMsgSetOpts) (*ExtendMsgSet, error) { if err != nil {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) return nil, utils.Wrap(err, "")
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
var set ExtendMsgSet
var findOneOpt *options.FindOneOptions
if opts != nil {
if opts.ExcludeExtendMsgs {
findOneOpt = &options.FindOneOptions{}
findOneOpt.SetProjection(bson.M{"extend_msgs": 0})
} }
var setList []ExtendMsgSet
if err := result.All(ctx, &setList); err != nil {
return nil, utils.Wrap(err, "")
} }
err := c.FindOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, findOneOpt).Decode(&set) if len(setList) == 0 {
return &set, err return nil, nil
}
return &setList[0], nil
} }
// first modify msg // first modify msg
func (d *DataBases) InsertExtendMsgAndGetIndex(ID string, index int32, msg *ExtendMsg) error { func (d *DataBases) InsertExtendMsg(sourceID string, sessionType int32, msg *ExtendMsg) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
_, err := c.UpdateOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, bson.M{"$set": bson.M{"latest_update_time": utils.GetCurrentTimestampBySecond(), "$inc": bson.M{"extend_msg_num": 1}, fmt.Sprintf("extend_msgs.%s", msg.ClientMsgID): msg}}) set, err := d.GetExtendMsgSet(ctx, sourceID, sessionType, 0, c)
return err if err != nil {
return utils.Wrap(err, "")
}
if set == nil || set.ExtendMsgNum >= GetExtendMsgMaxNum() {
var index int32
if set != nil {
index = SplitSourceIDAndGetIndex(set.SourceID)
}
err = d.CreateExtendMsgSet(&ExtendMsgSet{
SourceID: GetExtendMsgSourceID(sourceID, index),
SessionType: sessionType,
ExtendMsgs: map[string]ExtendMsg{msg.ClientMsgID: *msg},
ExtendMsgNum: 1,
CreateTime: msg.MsgFirstModifyTime,
MaxMsgUpdateTime: msg.MsgFirstModifyTime,
})
} else {
_, err = c.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$set": bson.M{"max_msg_update_time": msg.MsgFirstModifyTime, "$inc": bson.M{"extend_msg_num": 1}, fmt.Sprintf("extend_msgs.%s", msg.ClientMsgID): msg}})
}
return utils.Wrap(err, "")
} }
// insert or update // insert or update
func (d *DataBases) InsertOrUpdateReactionExtendMsgSet(ID string, index int32, clientMsgID, userID, value string) error { func (d *DataBases) InsertOrUpdateReactionExtendMsgSet(sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
reactionExtendMsgSet := ReactionExtendMsgSet{ var updateBson = bson.M{}
UserKey: userID, for _, v := range reactionExtensionList {
Value: value, updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = v
LatestUpdateTime: int32(utils.GetCurrentTimestampBySecond()),
} }
upsert := true upsert := true
opt := &options.UpdateOptions{ opt := &options.UpdateOptions{
Upsert: &upsert, Upsert: &upsert,
} }
_, err := c.UpdateOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, bson.M{"$set": bson.M{"latest_update_time": utils.GetCurrentTimestampBySecond()}, fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, userID): reactionExtendMsgSet}, opt) set, err := d.GetExtendMsgSet(ctx, sourceID, sessionType, msgFirstModifyTime, c)
if err != nil {
return utils.Wrap(err, "")
}
if set == nil {
return errors.New(fmt.Sprintf("sourceID %s has no set", sourceID))
}
_, err = c.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$set": updateBson}, opt)
return utils.Wrap(err, "")
}
// delete TypeKey
func (d *DataBases) DeleteReactionExtendMsgSet(sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
var updateBson = bson.M{}
for _, v := range reactionExtensionList {
updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = ""
}
set, err := d.GetExtendMsgSet(ctx, sourceID, sessionType, msgFirstModifyTime, c)
if err != nil {
return utils.Wrap(err, "")
}
if set == nil {
return errors.New(fmt.Sprintf("sourceID %s has no set", sourceID))
}
_, err = c.UpdateOne(ctx, bson.M{"source_id": set.SourceID, "session_type": sessionType}, bson.M{"$unset": updateBson})
return err return err
} }
func (d *DataBases) DeleteReactionExtendMsgSet(ID string, index int32, clientMsgID, userID string) error { func (d *DataBases) GetExtendMsg(sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *ExtendMsg, err error) {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
_, err := c.UpdateOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, bson.M{"$unset": bson.M{}}) findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{fmt.Sprintf("extend_msgs.%s", clientMsgID): 1})
return err regex := fmt.Sprintf("^%s", sourceID)
result, err := c.Find(ctx, bson.M{"source_id": primitive.Regex{Pattern: regex}, "session_type": sessionType, "max_msg_update_time": bson.M{"$lte": maxMsgUpdateTime}}, findOpts)
if err != nil {
return nil, utils.Wrap(err, "")
} }
var setList []ExtendMsgSet
// by index start end if err := result.All(ctx, &setList); err != nil {
func (d *DataBases) GetExtendMsgList(ID string, index int32, clientMsgID string) (extendMsg *ExtendMsg, err error) { return nil, utils.Wrap(err, "")
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) }
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) if len(setList) == 0 {
err = c.FindOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index), "extend_msgs": bson.M{}}).Decode(&extendMsg) return nil, utils.Wrap(errors.New("GetExtendMsg failed, len(setList) == 0"), "")
return extendMsg, err }
if v, ok := setList[0].ExtendMsgs[clientMsgID]; ok {
return &v, nil
}
return nil, errors.New(fmt.Sprintf("cant find client msg id: %s", clientMsgID))
} }

View File

@ -46,10 +46,10 @@ func key(dbAddress, dbName string) string {
} }
func init() { func init() {
//log.NewPrivateLog(constant.LogFileName)
var mongoClient *mongo.Client var mongoClient *mongo.Client
var err1 error var err1 error
//mysql init fmt.Println("init mysql redis mongo ")
initMysqlDB() initMysqlDB()
// mongo init // mongo init
// "mongodb://sysop:moon@localhost/records" // "mongodb://sysop:moon@localhost/records"
@ -84,45 +84,34 @@ func init() {
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
if err != nil { if err != nil {
fmt.Println(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri)
time.Sleep(time.Duration(30) * time.Second) time.Sleep(time.Duration(30) * time.Second)
mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
if err1 != nil { if err1 != nil {
fmt.Println(" mongo.Connect retry failed, panic", err.Error(), uri) panic(err1.Error() + " mongo.Connect failed " + uri)
panic(err1.Error())
} }
} }
fmt.Println("mongo driver client init success: ", uri)
// mongodb create index // mongodb create index
if err := createMongoIndex(mongoClient, cSendLog, false, "send_id", "-send_time"); err != nil { if err := createMongoIndex(mongoClient, cSendLog, false, "send_id", "-send_time"); err != nil {
fmt.Println("send_id", "-send_time", "index create failed", err.Error()) panic(err.Error() + " index create failed " + cSendLog + " send_id, -send_time")
panic(err.Error())
} }
if err := createMongoIndex(mongoClient, cChat, false, "uid"); err != nil { if err := createMongoIndex(mongoClient, cChat, false, "uid"); err != nil {
fmt.Println("uid", " index create failed", err.Error()) fmt.Println(err.Error() + " index create failed " + cChat + " uid ")
//panic(err.Error())
} }
if err := createMongoIndex(mongoClient, cWorkMoment, true, "-create_time", "work_moment_id"); err != nil { if err := createMongoIndex(mongoClient, cWorkMoment, true, "-create_time", "work_moment_id"); err != nil {
fmt.Println("-create_time", "work_moment_id", "index create failed", err.Error()) panic(err.Error() + "index create failed " + cWorkMoment + " -create_time, work_moment_id")
panic(err.Error())
} }
if err := createMongoIndex(mongoClient, cWorkMoment, true, "work_moment_id"); err != nil { if err := createMongoIndex(mongoClient, cWorkMoment, true, "work_moment_id"); err != nil {
fmt.Println("work_moment_id", "index create failed", err.Error()) panic(err.Error() + "index create failed " + cWorkMoment + " work_moment_id ")
panic(err.Error())
} }
if err := createMongoIndex(mongoClient, cWorkMoment, false, "user_id", "-create_time"); err != nil { if err := createMongoIndex(mongoClient, cWorkMoment, false, "user_id", "-create_time"); err != nil {
fmt.Println("user_id", "-create_time", "index create failed", err.Error()) panic(err.Error() + "index create failed " + cWorkMoment + "user_id, -create_time")
panic(err.Error())
} }
if err := createMongoIndex(mongoClient, cTag, false, "user_id", "-create_time"); err != nil { if err := createMongoIndex(mongoClient, cTag, false, "user_id", "-create_time"); err != nil {
fmt.Println("user_id", "-create_time", "index create failed", err.Error()) panic(err.Error() + "index create failed " + cTag + " user_id, -create_time")
panic(err.Error())
} }
if err := createMongoIndex(mongoClient, cTag, true, "tag_id"); err != nil { if err := createMongoIndex(mongoClient, cTag, true, "tag_id"); err != nil {
fmt.Println("tag_id", "index create failed", err.Error()) panic(err.Error() + "index create failed " + cTag + " tag_id")
panic(err.Error())
} }
fmt.Println("createMongoIndex success")
DB.mongoClient = mongoClient DB.mongoClient = mongoClient
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
@ -136,7 +125,8 @@ func init() {
}) })
_, err = DB.RDB.Ping(ctx).Result() _, err = DB.RDB.Ping(ctx).Result()
if err != nil { if err != nil {
panic(err.Error()) fmt.Println("redis cluster failed address ", config.Config.Redis.DBAddress)
panic(err.Error() + " redis cluster " + config.Config.Redis.DBUserName + config.Config.Redis.DBPassWord)
} }
} else { } else {
DB.RDB = go_redis.NewClient(&go_redis.Options{ DB.RDB = go_redis.NewClient(&go_redis.Options{
@ -148,7 +138,7 @@ func init() {
}) })
_, err = DB.RDB.Ping(ctx).Result() _, err = DB.RDB.Ping(ctx).Result()
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error() + " redis " + config.Config.Redis.DBAddress[0] + config.Config.Redis.DBUserName + config.Config.Redis.DBPassWord)
} }
} }
// 强一致性缓存当一个key被标记删除其他请求线程会被锁住轮询直到新的key生成适合各种同步的拉取, 如果弱一致可能导致拉取还是老数据,毫无意义 // 强一致性缓存当一个key被标记删除其他请求线程会被锁住轮询直到新的key生成适合各种同步的拉取, 如果弱一致可能导致拉取还是老数据,毫无意义
@ -158,6 +148,8 @@ func init() {
// 弱一致性缓存当一个key被标记删除其他请求线程直接返回该key的value适合高频并且生成很缓存很慢的情况 如大群发消息缓存的缓存 // 弱一致性缓存当一个key被标记删除其他请求线程直接返回该key的value适合高频并且生成很缓存很慢的情况 如大群发消息缓存的缓存
DB.WeakRc = rockscache.NewClient(DB.RDB, rockscache.NewDefaultOptions()) DB.WeakRc = rockscache.NewClient(DB.RDB, rockscache.NewDefaultOptions())
DB.WeakRc.Options.StrongConsistency = false DB.WeakRc.Options.StrongConsistency = false
fmt.Println("init mysql redis mongo ok ")
} }
func createMongoIndex(client *mongo.Client, collection string, isUnique bool, keys ...string) error { func createMongoIndex(client *mongo.Client, collection string, isUnique bool, keys ...string) error {

View File

@ -10,13 +10,14 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"math/rand"
"sync"
"github.com/go-redis/redis/v8" "github.com/go-redis/redis/v8"
"github.com/gogo/protobuf/sortkeys" "github.com/gogo/protobuf/sortkeys"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"math/rand"
"sync"
//"github.com/garyburd/redigo/redis" //"github.com/garyburd/redigo/redis"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
@ -93,7 +94,7 @@ func (d *DataBases) GetMinSeqFromMongo2(uid string) (MinSeq uint32, err error) {
} }
// deleteMsgByLogic // deleteMsgByLogic
func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID string) (totalUnexistSeqList []uint32, err error) { func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID string) (totalUnExistSeqList []uint32, err error) {
log.Debug(operationID, utils.GetSelfFuncName(), "args ", userID, seqList) log.Debug(operationID, utils.GetSelfFuncName(), "args ", userID, seqList)
sortkeys.Uint32s(seqList) sortkeys.Uint32s(seqList)
suffixUserID2SubSeqList := func(uid string, seqList []uint32) map[string][]uint32 { suffixUserID2SubSeqList := func(uid string, seqList []uint32) map[string][]uint32 {
@ -122,11 +123,11 @@ func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID
return return
} }
lock.Lock() lock.Lock()
totalUnexistSeqList = append(totalUnexistSeqList, unexistSeqList...) totalUnExistSeqList = append(totalUnExistSeqList, unexistSeqList...)
lock.Unlock() lock.Unlock()
}(k, v, operationID) }(k, v, operationID)
} }
return totalUnexistSeqList, err return totalUnExistSeqList, err
} }
func (d *DataBases) DelMsgBySeqListInOneDoc(suffixUserID string, seqList []uint32, operationID string) ([]uint32, error) { func (d *DataBases) DelMsgBySeqListInOneDoc(suffixUserID string, seqList []uint32, operationID string) ([]uint32, error) {
@ -206,6 +207,13 @@ func (d *DataBases) ReplaceMsgBySeq(uid string, msg *open_im_sdk.MsgData, operat
return nil return nil
} }
func (d *DataBases) UpdateOneMsgList(msg *UserChat) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
_, err := c.UpdateOne(ctx, bson.M{"uid": msg.UID}, bson.M{"$set": bson.M{"msg": msg.Msg}})
return err
}
func (d *DataBases) GetMsgBySeqList(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) { func (d *DataBases) GetMsgBySeqList(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) {
log.NewInfo(operationID, utils.GetSelfFuncName(), uid, seqList) log.NewInfo(operationID, utils.GetSelfFuncName(), uid, seqList)
var hasSeqList []uint32 var hasSeqList []uint32

View File

@ -22,37 +22,26 @@ func (w Writer) Printf(format string, args ...interface{}) {
} }
func initMysqlDB() { func initMysqlDB() {
fmt.Println("init mysqlDB start")
//When there is no open IM database, connect to the mysql built-in database to create openIM database
dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local", dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local",
config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], "mysql") config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], "mysql")
var db *gorm.DB var db *gorm.DB
var err1 error var err1 error
db, err := gorm.Open(mysql.Open(dsn), nil) db, err := gorm.Open(mysql.Open(dsn), nil)
if err != nil {
fmt.Println("Open failed ", err.Error(), dsn)
}
if err != nil { if err != nil {
time.Sleep(time.Duration(30) * time.Second) time.Sleep(time.Duration(30) * time.Second)
db, err1 = gorm.Open(mysql.Open(dsn), nil) db, err1 = gorm.Open(mysql.Open(dsn), nil)
if err1 != nil { if err1 != nil {
fmt.Println("Open failed ", err1.Error(), dsn) panic(err1.Error() + " open failed " + dsn)
panic(err1.Error())
} }
} }
//Check the database and table during initialization
sql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s default charset utf8 COLLATE utf8_general_ci;", config.Config.Mysql.DBDatabaseName) sql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s default charset utf8 COLLATE utf8_general_ci;", config.Config.Mysql.DBDatabaseName)
fmt.Println("exec sql: ", sql, " begin")
err = db.Exec(sql).Error err = db.Exec(sql).Error
if err != nil { if err != nil {
fmt.Println("Exec failed ", err.Error(), sql) panic(err.Error() + " Exec failed " + sql)
panic(err.Error())
} }
fmt.Println("exec sql: ", sql, " end")
dsn = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local", dsn = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local",
config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], config.Config.Mysql.DBDatabaseName) config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], config.Config.Mysql.DBDatabaseName)
newLogger := logger.New( newLogger := logger.New(
Writer{}, Writer{},
logger.Config{ logger.Config{
@ -66,20 +55,18 @@ func initMysqlDB() {
Logger: newLogger, Logger: newLogger,
}) })
if err != nil { if err != nil {
fmt.Println("Open failed ", err.Error(), dsn) panic(err.Error() + " Open failed " + dsn)
panic(err.Error())
} }
sqlDB, err := db.DB() sqlDB, err := db.DB()
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error() + " db.DB() failed ")
} }
sqlDB.SetConnMaxLifetime(time.Second * time.Duration(config.Config.Mysql.DBMaxLifeTime)) sqlDB.SetConnMaxLifetime(time.Second * time.Duration(config.Config.Mysql.DBMaxLifeTime))
sqlDB.SetMaxOpenConns(config.Config.Mysql.DBMaxOpenConns) sqlDB.SetMaxOpenConns(config.Config.Mysql.DBMaxOpenConns)
sqlDB.SetMaxIdleConns(config.Config.Mysql.DBMaxIdleConns) sqlDB.SetMaxIdleConns(config.Config.Mysql.DBMaxIdleConns)
fmt.Println("open mysql ok ", dsn)
db.AutoMigrate( db.AutoMigrate(
&Register{}, &Register{},
&Friend{}, &Friend{},
@ -94,99 +81,69 @@ func initMysqlDB() {
db.Set("gorm:table_options", "collation=utf8_unicode_ci") db.Set("gorm:table_options", "collation=utf8_unicode_ci")
if !db.Migrator().HasTable(&Friend{}) { if !db.Migrator().HasTable(&Friend{}) {
fmt.Println("CreateTable Friend")
db.Migrator().CreateTable(&Friend{}) db.Migrator().CreateTable(&Friend{})
} }
if !db.Migrator().HasTable(&FriendRequest{}) { if !db.Migrator().HasTable(&FriendRequest{}) {
fmt.Println("CreateTable FriendRequest")
db.Migrator().CreateTable(&FriendRequest{}) db.Migrator().CreateTable(&FriendRequest{})
} }
if !db.Migrator().HasTable(&Group{}) { if !db.Migrator().HasTable(&Group{}) {
fmt.Println("CreateTable Group")
db.Migrator().CreateTable(&Group{}) db.Migrator().CreateTable(&Group{})
} }
if !db.Migrator().HasTable(&GroupMember{}) { if !db.Migrator().HasTable(&GroupMember{}) {
fmt.Println("CreateTable GroupMember")
db.Migrator().CreateTable(&GroupMember{}) db.Migrator().CreateTable(&GroupMember{})
} }
if !db.Migrator().HasTable(&GroupRequest{}) { if !db.Migrator().HasTable(&GroupRequest{}) {
fmt.Println("CreateTable GroupRequest")
db.Migrator().CreateTable(&GroupRequest{}) db.Migrator().CreateTable(&GroupRequest{})
} }
if !db.Migrator().HasTable(&User{}) { if !db.Migrator().HasTable(&User{}) {
fmt.Println("CreateTable User")
db.Migrator().CreateTable(&User{}) db.Migrator().CreateTable(&User{})
} }
if !db.Migrator().HasTable(&Black{}) { if !db.Migrator().HasTable(&Black{}) {
fmt.Println("CreateTable Black")
db.Migrator().CreateTable(&Black{}) db.Migrator().CreateTable(&Black{})
} }
if !db.Migrator().HasTable(&ChatLog{}) { if !db.Migrator().HasTable(&ChatLog{}) {
fmt.Println("CreateTable ChatLog")
db.Migrator().CreateTable(&ChatLog{}) db.Migrator().CreateTable(&ChatLog{})
} }
if !db.Migrator().HasTable(&Register{}) { if !db.Migrator().HasTable(&Register{}) {
fmt.Println("CreateTable Register")
db.Migrator().CreateTable(&Register{}) db.Migrator().CreateTable(&Register{})
} }
if !db.Migrator().HasTable(&Conversation{}) { if !db.Migrator().HasTable(&Conversation{}) {
fmt.Println("CreateTable Conversation")
db.Migrator().CreateTable(&Conversation{}) db.Migrator().CreateTable(&Conversation{})
} }
if !db.Migrator().HasTable(&Department{}) { if !db.Migrator().HasTable(&Department{}) {
fmt.Println("CreateTable Department")
db.Migrator().CreateTable(&Department{}) db.Migrator().CreateTable(&Department{})
} }
if !db.Migrator().HasTable(&OrganizationUser{}) { if !db.Migrator().HasTable(&OrganizationUser{}) {
fmt.Println("CreateTable OrganizationUser")
db.Migrator().CreateTable(&OrganizationUser{}) db.Migrator().CreateTable(&OrganizationUser{})
} }
if !db.Migrator().HasTable(&DepartmentMember{}) { if !db.Migrator().HasTable(&DepartmentMember{}) {
fmt.Println("CreateTable DepartmentMember")
db.Migrator().CreateTable(&DepartmentMember{}) db.Migrator().CreateTable(&DepartmentMember{})
} }
if !db.Migrator().HasTable(&AppVersion{}) { if !db.Migrator().HasTable(&AppVersion{}) {
fmt.Println("CreateTable DepartmentMember")
db.Migrator().CreateTable(&AppVersion{}) db.Migrator().CreateTable(&AppVersion{})
} }
if !db.Migrator().HasTable(&BlackList{}) { if !db.Migrator().HasTable(&BlackList{}) {
fmt.Println("CreateTable BlackList")
db.Migrator().CreateTable(&BlackList{}) db.Migrator().CreateTable(&BlackList{})
} }
if !db.Migrator().HasTable(&IpLimit{}) { if !db.Migrator().HasTable(&IpLimit{}) {
fmt.Println("CreateTable IpLimit")
db.Migrator().CreateTable(&IpLimit{}) db.Migrator().CreateTable(&IpLimit{})
} }
if !db.Migrator().HasTable(&UserIpLimit{}) { if !db.Migrator().HasTable(&UserIpLimit{}) {
fmt.Println("CreateTable UserIpLimit")
db.Migrator().CreateTable(&UserIpLimit{}) db.Migrator().CreateTable(&UserIpLimit{})
} }
if !db.Migrator().HasTable(&RegisterAddFriend{}) { if !db.Migrator().HasTable(&RegisterAddFriend{}) {
fmt.Println("CreateTable RegisterAddFriend")
db.Migrator().CreateTable(&RegisterAddFriend{}) db.Migrator().CreateTable(&RegisterAddFriend{})
} }
if !db.Migrator().HasTable(&Invitation{}) { if !db.Migrator().HasTable(&Invitation{}) {
fmt.Println("CreateTable Invitation")
db.Migrator().CreateTable(&Invitation{}) db.Migrator().CreateTable(&Invitation{})
} }
if !db.Migrator().HasTable(&ClientInitConfig{}) { if !db.Migrator().HasTable(&ClientInitConfig{}) {
fmt.Println("CreateTable ClientInitConfig")
db.Migrator().CreateTable(&ClientInitConfig{}) db.Migrator().CreateTable(&ClientInitConfig{})
} }
if !db.Migrator().HasTable(&UserIpRecord{}) { if !db.Migrator().HasTable(&UserIpRecord{}) {
fmt.Println("CreateTable Friend")
db.Migrator().CreateTable(&UserIpRecord{}) db.Migrator().CreateTable(&UserIpRecord{})
} }
DB.MysqlDB.db = db DB.MysqlDB.db = db
return
} }
func (m *mysqlDB) DefaultGormDB() *gorm.DB { func (m *mysqlDB) DefaultGormDB() *gorm.DB {

View File

@ -74,6 +74,12 @@ func GetGroupMemberIDListByGroupID(groupID string) ([]string, error) {
return groupMemberIDList, nil return groupMemberIDList, nil
} }
func GetGroupMemberByUserIDList(groupID string, userIDList []string) ([]*db.GroupMember, error) {
var groupMemberList []*db.GroupMember
err := db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and user_id in (?)", groupID, userIDList).Find(&groupMemberList).Error
return groupMemberList, err
}
func GetGroupMemberListByGroupIDAndRoleLevel(groupID string, roleLevel int32) ([]db.GroupMember, error) { func GetGroupMemberListByGroupIDAndRoleLevel(groupID string, roleLevel int32) ([]db.GroupMember, error) {
var groupMemberList []db.GroupMember var groupMemberList []db.GroupMember
err := db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and role_level=?", groupID, roleLevel).Find(&groupMemberList).Error err := db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and role_level=?", groupID, roleLevel).Find(&groupMemberList).Error

View File

@ -44,6 +44,12 @@ func GetGroupInfoByGroupID(groupID string) (*db.Group, error) {
return &groupInfo, err return &groupInfo, err
} }
func GetGroupInfoByGroupIDList(groupIDList []string) ([]*db.Group, error) {
var groupInfoList []*db.Group
err := db.DB.MysqlDB.DefaultGormDB().Table("groups").Where("group_id in (?)", groupIDList).Find(&groupIDList).Error
return groupInfoList, err
}
func SetGroupInfo(groupInfo db.Group) error { func SetGroupInfo(groupInfo db.Group) error {
return db.DB.MysqlDB.DefaultGormDB().Table("groups").Where("group_id=?", groupInfo.GroupID).Updates(&groupInfo).Error return db.DB.MysqlDB.DefaultGormDB().Table("groups").Where("group_id=?", groupInfo.GroupID).Updates(&groupInfo).Error
} }

View File

@ -27,7 +27,9 @@ func UpdateGroupRequest(groupRequest db.GroupRequest) error {
} }
func InsertIntoGroupRequest(toInsertInfo db.GroupRequest) error { func InsertIntoGroupRequest(toInsertInfo db.GroupRequest) error {
DelGroupRequestByGroupIDAndUserID(toInsertInfo.GroupID, toInsertInfo.UserID) if err := DelGroupRequestByGroupIDAndUserID(toInsertInfo.GroupID, toInsertInfo.UserID); err != nil {
return err
}
if toInsertInfo.HandledTime.Unix() < 0 { if toInsertInfo.HandledTime.Unix() < 0 {
toInsertInfo.HandledTime = utils.UnixSecondToTime(0) toInsertInfo.HandledTime = utils.UnixSecondToTime(0)
} }

View File

@ -145,40 +145,6 @@ func DelJoinedGroupIDListFromCache(userID string) error {
return db.DB.Rc.TagAsDeleted(joinedGroupListCache + userID) return db.DB.Rc.TagAsDeleted(joinedGroupListCache + userID)
} }
func GetGroupMemberIDListFromCache(groupID string) ([]string, error) {
f := func() (string, error) {
groupInfo, err := GetGroupInfoFromCache(groupID)
if err != nil {
return "", utils.Wrap(err, "GetGroupInfoFromCache failed")
}
var groupMemberIDList []string
if groupInfo.GroupType == constant.SuperGroup {
superGroup, err := db.DB.GetSuperGroup(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
groupMemberIDList = superGroup.MemberIDList
} else {
groupMemberIDList, err = imdb.GetGroupMemberIDListByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
}
bytes, err := json.Marshal(groupMemberIDList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
groupIDListStr, err := db.DB.Rc.Fetch(groupCache+groupID, time.Second*30*60, f)
if err != nil {
return nil, utils.Wrap(err, "")
}
var groupMemberIDList []string
err = json.Unmarshal([]byte(groupIDListStr), &groupMemberIDList)
return groupMemberIDList, utils.Wrap(err, "")
}
func DelGroupMemberIDListFromCache(groupID string) error { func DelGroupMemberIDListFromCache(groupID string) error {
err := db.DB.Rc.TagAsDeleted(groupCache + groupID) err := db.DB.Rc.TagAsDeleted(groupCache + groupID)
return err return err
@ -458,6 +424,39 @@ func GetGroupMemberListHashFromCache(groupID string) (uint64, error) {
hashCodeUint64, err := strconv.Atoi(hashCode) hashCodeUint64, err := strconv.Atoi(hashCode)
return uint64(hashCodeUint64), err return uint64(hashCodeUint64), err
} }
func GetGroupMemberIDListFromCache(groupID string) ([]string, error) {
f := func() (string, error) {
groupInfo, err := GetGroupInfoFromCache(groupID)
if err != nil {
return "", utils.Wrap(err, "GetGroupInfoFromCache failed")
}
var groupMemberIDList []string
if groupInfo.GroupType == constant.SuperGroup {
superGroup, err := db.DB.GetSuperGroup(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
groupMemberIDList = superGroup.MemberIDList
} else {
groupMemberIDList, err = imdb.GetGroupMemberIDListByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
}
bytes, err := json.Marshal(groupMemberIDList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
groupIDListStr, err := db.DB.Rc.Fetch(groupCache+groupID, time.Second*30*60, f)
if err != nil {
return nil, utils.Wrap(err, "")
}
var groupMemberIDList []string
err = json.Unmarshal([]byte(groupIDListStr), &groupMemberIDList)
return groupMemberIDList, utils.Wrap(err, "")
}
func DelGroupMemberListHashFromCache(groupID string) error { func DelGroupMemberListHashFromCache(groupID string) error {
err := db.DB.Rc.TagAsDeleted(groupMemberListHashCache + groupID) err := db.DB.Rc.TagAsDeleted(groupMemberListHashCache + groupID)
@ -567,37 +566,9 @@ func DelConversationFromCache(ownerUserID, conversationID string) error {
return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationCache+ownerUserID+":"+conversationID), "DelConversationFromCache err") return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationCache+ownerUserID+":"+conversationID), "DelConversationFromCache err")
} }
func GetExtendMsgSetFromCache(ID string, index int32) (*db.ExtendMsgSet, error) { func GetExtendMsg(sourceID string, sessionType int32, clientMsgID string, firstModifyTime int64) (*db.ExtendMsg, error) {
getExtendMsgSet := func() (string, error) {
extendMsgSet, err := db.DB.GetExtendMsgSet(ID, index, &db.GetExtendMsgSetOpts{ExcludeExtendMsgs: false})
if err != nil {
return "", utils.Wrap(err, "GetExtendMsgSet failed")
}
bytes, err := json.Marshal(extendMsgSet)
if err != nil {
return "", utils.Wrap(err, "Marshal failed")
}
return string(bytes), nil
}
extendMsgSetStr, err := db.DB.Rc.Fetch(extendMsgSetCache+db.GetExtendMsgSetID(ID, index), time.Second*30*60, getExtendMsgSet)
if err != nil {
return nil, utils.Wrap(err, "Fetch failed")
}
extendMsgSet := &db.ExtendMsgSet{}
err = json.Unmarshal([]byte(extendMsgSetStr), extendMsgSet)
if err != nil {
return nil, utils.Wrap(err, "Unmarshal failed")
}
return extendMsgSet, nil
}
func DelExtendMsgSetFromCache(ID string, index int32) error {
return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgSetCache+db.GetExtendMsgSetID(ID, index)), "DelExtendMsgSetFromCache err")
}
func GetExtendMsg(ID string, index int32, clientMsgID string) (*db.ExtendMsg, error) {
getExtendMsg := func() (string, error) { getExtendMsg := func() (string, error) {
extendMsg, err := db.DB.GetExtendMsgList(ID, index, clientMsgID) extendMsg, err := db.DB.GetExtendMsg(sourceID, sessionType, clientMsgID, firstModifyTime)
if err != nil { if err != nil {
return "", utils.Wrap(err, "GetExtendMsgList failed") return "", utils.Wrap(err, "GetExtendMsgList failed")
} }
@ -607,8 +578,7 @@ func GetExtendMsg(ID string, index int32, clientMsgID string) (*db.ExtendMsg, er
} }
return string(bytes), nil return string(bytes), nil
} }
extendMsgStr, err := db.DB.Rc.Fetch(extendMsgCache+clientMsgID, time.Second*30*60, getExtendMsg)
extendMsgStr, err := db.DB.Rc.Fetch(extendMsgCache+db.GetExtendMsgSetID(ID, index)+":"+clientMsgID, time.Second*30*60, getExtendMsg)
if err != nil { if err != nil {
return nil, utils.Wrap(err, "Fetch failed") return nil, utils.Wrap(err, "Fetch failed")
} }
@ -621,5 +591,5 @@ func GetExtendMsg(ID string, index int32, clientMsgID string) (*db.ExtendMsg, er
} }
func DelExtendMsg(ID string, index int32, clientMsgID string) error { func DelExtendMsg(ID string, index int32, clientMsgID string) error {
return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgCache+db.GetExtendMsgSetID(ID, index)+":"+clientMsgID), "DelExtendMsg err") return utils.Wrap(db.DB.Rc.TagAsDeleted(extendMsgCache+clientMsgID), "DelExtendMsg err")
} }

View File

@ -9,6 +9,7 @@ package kafka
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/Shopify/sarama" "github.com/Shopify/sarama"
) )
@ -29,9 +30,10 @@ func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addrs []str
config.Version = consumerConfig.KafkaVersion config.Version = consumerConfig.KafkaVersion
config.Consumer.Offsets.Initial = consumerConfig.OffsetsInitial config.Consumer.Offsets.Initial = consumerConfig.OffsetsInitial
config.Consumer.Return.Errors = consumerConfig.IsReturnErr config.Consumer.Return.Errors = consumerConfig.IsReturnErr
fmt.Println("init address is ", addrs, "topics is ", topics) //fmt.Println("init address is ", addrs, "topics is ", topics)
consumerGroup, err := sarama.NewConsumerGroup(addrs, groupID, config) consumerGroup, err := sarama.NewConsumerGroup(addrs, groupID, config)
if err != nil { if err != nil {
fmt.Println("args:", addrs, groupID, config)
panic(err.Error()) panic(err.Error())
} }
return &MConsumerGroup{ return &MConsumerGroup{

View File

@ -36,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} }
func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (m *CommonResp) String() string { return proto.CompactTextString(m) }
func (*CommonResp) ProtoMessage() {} func (*CommonResp) ProtoMessage() {}
func (*CommonResp) Descriptor() ([]byte, []int) { func (*CommonResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{0} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{0}
} }
func (m *CommonResp) XXX_Unmarshal(b []byte) error { func (m *CommonResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CommonResp.Unmarshal(m, b) return xxx_messageInfo_CommonResp.Unmarshal(m, b)
@ -83,7 +83,7 @@ func (m *AdminLoginReq) Reset() { *m = AdminLoginReq{} }
func (m *AdminLoginReq) String() string { return proto.CompactTextString(m) } func (m *AdminLoginReq) String() string { return proto.CompactTextString(m) }
func (*AdminLoginReq) ProtoMessage() {} func (*AdminLoginReq) ProtoMessage() {}
func (*AdminLoginReq) Descriptor() ([]byte, []int) { func (*AdminLoginReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{1} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{1}
} }
func (m *AdminLoginReq) XXX_Unmarshal(b []byte) error { func (m *AdminLoginReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AdminLoginReq.Unmarshal(m, b) return xxx_messageInfo_AdminLoginReq.Unmarshal(m, b)
@ -138,7 +138,7 @@ func (m *AdminLoginResp) Reset() { *m = AdminLoginResp{} }
func (m *AdminLoginResp) String() string { return proto.CompactTextString(m) } func (m *AdminLoginResp) String() string { return proto.CompactTextString(m) }
func (*AdminLoginResp) ProtoMessage() {} func (*AdminLoginResp) ProtoMessage() {}
func (*AdminLoginResp) Descriptor() ([]byte, []int) { func (*AdminLoginResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{2} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{2}
} }
func (m *AdminLoginResp) XXX_Unmarshal(b []byte) error { func (m *AdminLoginResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AdminLoginResp.Unmarshal(m, b) return xxx_messageInfo_AdminLoginResp.Unmarshal(m, b)
@ -199,7 +199,7 @@ func (m *GetUserTokenReq) Reset() { *m = GetUserTokenReq{} }
func (m *GetUserTokenReq) String() string { return proto.CompactTextString(m) } func (m *GetUserTokenReq) String() string { return proto.CompactTextString(m) }
func (*GetUserTokenReq) ProtoMessage() {} func (*GetUserTokenReq) ProtoMessage() {}
func (*GetUserTokenReq) Descriptor() ([]byte, []int) { func (*GetUserTokenReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{3} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{3}
} }
func (m *GetUserTokenReq) XXX_Unmarshal(b []byte) error { func (m *GetUserTokenReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserTokenReq.Unmarshal(m, b) return xxx_messageInfo_GetUserTokenReq.Unmarshal(m, b)
@ -253,7 +253,7 @@ func (m *GetUserTokenResp) Reset() { *m = GetUserTokenResp{} }
func (m *GetUserTokenResp) String() string { return proto.CompactTextString(m) } func (m *GetUserTokenResp) String() string { return proto.CompactTextString(m) }
func (*GetUserTokenResp) ProtoMessage() {} func (*GetUserTokenResp) ProtoMessage() {}
func (*GetUserTokenResp) Descriptor() ([]byte, []int) { func (*GetUserTokenResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{4} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{4}
} }
func (m *GetUserTokenResp) XXX_Unmarshal(b []byte) error { func (m *GetUserTokenResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserTokenResp.Unmarshal(m, b) return xxx_messageInfo_GetUserTokenResp.Unmarshal(m, b)
@ -306,7 +306,7 @@ func (m *AddUserRegisterAddFriendIDListReq) Reset() { *m = AddUserRegist
func (m *AddUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) } func (m *AddUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) }
func (*AddUserRegisterAddFriendIDListReq) ProtoMessage() {} func (*AddUserRegisterAddFriendIDListReq) ProtoMessage() {}
func (*AddUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) { func (*AddUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{5} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{5}
} }
func (m *AddUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error { func (m *AddUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddUserRegisterAddFriendIDListReq.Unmarshal(m, b) return xxx_messageInfo_AddUserRegisterAddFriendIDListReq.Unmarshal(m, b)
@ -351,7 +351,7 @@ func (m *AddUserRegisterAddFriendIDListResp) Reset() { *m = AddUserRegis
func (m *AddUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) } func (m *AddUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) }
func (*AddUserRegisterAddFriendIDListResp) ProtoMessage() {} func (*AddUserRegisterAddFriendIDListResp) ProtoMessage() {}
func (*AddUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) { func (*AddUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{6} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{6}
} }
func (m *AddUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error { func (m *AddUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddUserRegisterAddFriendIDListResp.Unmarshal(m, b) return xxx_messageInfo_AddUserRegisterAddFriendIDListResp.Unmarshal(m, b)
@ -391,7 +391,7 @@ func (m *ReduceUserRegisterAddFriendIDListReq) Reset() { *m = ReduceUser
func (m *ReduceUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) } func (m *ReduceUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) }
func (*ReduceUserRegisterAddFriendIDListReq) ProtoMessage() {} func (*ReduceUserRegisterAddFriendIDListReq) ProtoMessage() {}
func (*ReduceUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) { func (*ReduceUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{7} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{7}
} }
func (m *ReduceUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error { func (m *ReduceUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReduceUserRegisterAddFriendIDListReq.Unmarshal(m, b) return xxx_messageInfo_ReduceUserRegisterAddFriendIDListReq.Unmarshal(m, b)
@ -443,7 +443,7 @@ func (m *ReduceUserRegisterAddFriendIDListResp) Reset() { *m = ReduceUse
func (m *ReduceUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) } func (m *ReduceUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) }
func (*ReduceUserRegisterAddFriendIDListResp) ProtoMessage() {} func (*ReduceUserRegisterAddFriendIDListResp) ProtoMessage() {}
func (*ReduceUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) { func (*ReduceUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{8} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{8}
} }
func (m *ReduceUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error { func (m *ReduceUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReduceUserRegisterAddFriendIDListResp.Unmarshal(m, b) return xxx_messageInfo_ReduceUserRegisterAddFriendIDListResp.Unmarshal(m, b)
@ -482,7 +482,7 @@ func (m *GetUserRegisterAddFriendIDListReq) Reset() { *m = GetUserRegist
func (m *GetUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) } func (m *GetUserRegisterAddFriendIDListReq) String() string { return proto.CompactTextString(m) }
func (*GetUserRegisterAddFriendIDListReq) ProtoMessage() {} func (*GetUserRegisterAddFriendIDListReq) ProtoMessage() {}
func (*GetUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) { func (*GetUserRegisterAddFriendIDListReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{9} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{9}
} }
func (m *GetUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error { func (m *GetUserRegisterAddFriendIDListReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserRegisterAddFriendIDListReq.Unmarshal(m, b) return xxx_messageInfo_GetUserRegisterAddFriendIDListReq.Unmarshal(m, b)
@ -529,7 +529,7 @@ func (m *GetUserRegisterAddFriendIDListResp) Reset() { *m = GetUserRegis
func (m *GetUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) } func (m *GetUserRegisterAddFriendIDListResp) String() string { return proto.CompactTextString(m) }
func (*GetUserRegisterAddFriendIDListResp) ProtoMessage() {} func (*GetUserRegisterAddFriendIDListResp) ProtoMessage() {}
func (*GetUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) { func (*GetUserRegisterAddFriendIDListResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{10} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{10}
} }
func (m *GetUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error { func (m *GetUserRegisterAddFriendIDListResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserRegisterAddFriendIDListResp.Unmarshal(m, b) return xxx_messageInfo_GetUserRegisterAddFriendIDListResp.Unmarshal(m, b)
@ -579,6 +579,7 @@ type GetChatLogsReq struct {
ContentType int32 `protobuf:"varint,6,opt,name=contentType" json:"contentType,omitempty"` ContentType int32 `protobuf:"varint,6,opt,name=contentType" json:"contentType,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,7,opt,name=pagination" json:"pagination,omitempty"` Pagination *sdk_ws.RequestPagination `protobuf:"bytes,7,opt,name=pagination" json:"pagination,omitempty"`
OperationID string `protobuf:"bytes,8,opt,name=operationID" json:"operationID,omitempty"` OperationID string `protobuf:"bytes,8,opt,name=operationID" json:"operationID,omitempty"`
OpUserID string `protobuf:"bytes,9,opt,name=opUserID" json:"opUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
@ -588,7 +589,7 @@ func (m *GetChatLogsReq) Reset() { *m = GetChatLogsReq{} }
func (m *GetChatLogsReq) String() string { return proto.CompactTextString(m) } func (m *GetChatLogsReq) String() string { return proto.CompactTextString(m) }
func (*GetChatLogsReq) ProtoMessage() {} func (*GetChatLogsReq) ProtoMessage() {}
func (*GetChatLogsReq) Descriptor() ([]byte, []int) { func (*GetChatLogsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{11} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{11}
} }
func (m *GetChatLogsReq) XXX_Unmarshal(b []byte) error { func (m *GetChatLogsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetChatLogsReq.Unmarshal(m, b) return xxx_messageInfo_GetChatLogsReq.Unmarshal(m, b)
@ -664,6 +665,13 @@ func (m *GetChatLogsReq) GetOperationID() string {
return "" return ""
} }
func (m *GetChatLogsReq) GetOpUserID() string {
if m != nil {
return m.OpUserID
}
return ""
}
type ChatLog struct { type ChatLog struct {
ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID" json:"serverMsgID,omitempty"` ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID" json:"serverMsgID,omitempty"`
ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID" json:"clientMsgID,omitempty"` ClientMsgID string `protobuf:"bytes,2,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
@ -692,7 +700,7 @@ func (m *ChatLog) Reset() { *m = ChatLog{} }
func (m *ChatLog) String() string { return proto.CompactTextString(m) } func (m *ChatLog) String() string { return proto.CompactTextString(m) }
func (*ChatLog) ProtoMessage() {} func (*ChatLog) ProtoMessage() {}
func (*ChatLog) Descriptor() ([]byte, []int) { func (*ChatLog) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{12} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{12}
} }
func (m *ChatLog) XXX_Unmarshal(b []byte) error { func (m *ChatLog) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChatLog.Unmarshal(m, b) return xxx_messageInfo_ChatLog.Unmarshal(m, b)
@ -852,7 +860,7 @@ func (m *GetChatLogsResp) Reset() { *m = GetChatLogsResp{} }
func (m *GetChatLogsResp) String() string { return proto.CompactTextString(m) } func (m *GetChatLogsResp) String() string { return proto.CompactTextString(m) }
func (*GetChatLogsResp) ProtoMessage() {} func (*GetChatLogsResp) ProtoMessage() {}
func (*GetChatLogsResp) Descriptor() ([]byte, []int) { func (*GetChatLogsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{13} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{13}
} }
func (m *GetChatLogsResp) XXX_Unmarshal(b []byte) error { func (m *GetChatLogsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetChatLogsResp.Unmarshal(m, b) return xxx_messageInfo_GetChatLogsResp.Unmarshal(m, b)
@ -912,7 +920,7 @@ func (m *StatisticsReq) Reset() { *m = StatisticsReq{} }
func (m *StatisticsReq) String() string { return proto.CompactTextString(m) } func (m *StatisticsReq) String() string { return proto.CompactTextString(m) }
func (*StatisticsReq) ProtoMessage() {} func (*StatisticsReq) ProtoMessage() {}
func (*StatisticsReq) Descriptor() ([]byte, []int) { func (*StatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{14} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{14}
} }
func (m *StatisticsReq) XXX_Unmarshal(b []byte) error { func (m *StatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StatisticsReq.Unmarshal(m, b) return xxx_messageInfo_StatisticsReq.Unmarshal(m, b)
@ -958,7 +966,7 @@ func (m *GetActiveUserReq) Reset() { *m = GetActiveUserReq{} }
func (m *GetActiveUserReq) String() string { return proto.CompactTextString(m) } func (m *GetActiveUserReq) String() string { return proto.CompactTextString(m) }
func (*GetActiveUserReq) ProtoMessage() {} func (*GetActiveUserReq) ProtoMessage() {}
func (*GetActiveUserReq) Descriptor() ([]byte, []int) { func (*GetActiveUserReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{15} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{15}
} }
func (m *GetActiveUserReq) XXX_Unmarshal(b []byte) error { func (m *GetActiveUserReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveUserReq.Unmarshal(m, b) return xxx_messageInfo_GetActiveUserReq.Unmarshal(m, b)
@ -1005,7 +1013,7 @@ func (m *UserResp) Reset() { *m = UserResp{} }
func (m *UserResp) String() string { return proto.CompactTextString(m) } func (m *UserResp) String() string { return proto.CompactTextString(m) }
func (*UserResp) ProtoMessage() {} func (*UserResp) ProtoMessage() {}
func (*UserResp) Descriptor() ([]byte, []int) { func (*UserResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{16} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{16}
} }
func (m *UserResp) XXX_Unmarshal(b []byte) error { func (m *UserResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserResp.Unmarshal(m, b) return xxx_messageInfo_UserResp.Unmarshal(m, b)
@ -1058,7 +1066,7 @@ func (m *GetActiveUserResp) Reset() { *m = GetActiveUserResp{} }
func (m *GetActiveUserResp) String() string { return proto.CompactTextString(m) } func (m *GetActiveUserResp) String() string { return proto.CompactTextString(m) }
func (*GetActiveUserResp) ProtoMessage() {} func (*GetActiveUserResp) ProtoMessage() {}
func (*GetActiveUserResp) Descriptor() ([]byte, []int) { func (*GetActiveUserResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{17} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{17}
} }
func (m *GetActiveUserResp) XXX_Unmarshal(b []byte) error { func (m *GetActiveUserResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveUserResp.Unmarshal(m, b) return xxx_messageInfo_GetActiveUserResp.Unmarshal(m, b)
@ -1104,7 +1112,7 @@ func (m *GetActiveGroupReq) Reset() { *m = GetActiveGroupReq{} }
func (m *GetActiveGroupReq) String() string { return proto.CompactTextString(m) } func (m *GetActiveGroupReq) String() string { return proto.CompactTextString(m) }
func (*GetActiveGroupReq) ProtoMessage() {} func (*GetActiveGroupReq) ProtoMessage() {}
func (*GetActiveGroupReq) Descriptor() ([]byte, []int) { func (*GetActiveGroupReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{18} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{18}
} }
func (m *GetActiveGroupReq) XXX_Unmarshal(b []byte) error { func (m *GetActiveGroupReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveGroupReq.Unmarshal(m, b) return xxx_messageInfo_GetActiveGroupReq.Unmarshal(m, b)
@ -1152,7 +1160,7 @@ func (m *GroupResp) Reset() { *m = GroupResp{} }
func (m *GroupResp) String() string { return proto.CompactTextString(m) } func (m *GroupResp) String() string { return proto.CompactTextString(m) }
func (*GroupResp) ProtoMessage() {} func (*GroupResp) ProtoMessage() {}
func (*GroupResp) Descriptor() ([]byte, []int) { func (*GroupResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{19} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{19}
} }
func (m *GroupResp) XXX_Unmarshal(b []byte) error { func (m *GroupResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GroupResp.Unmarshal(m, b) return xxx_messageInfo_GroupResp.Unmarshal(m, b)
@ -1212,7 +1220,7 @@ func (m *GetActiveGroupResp) Reset() { *m = GetActiveGroupResp{} }
func (m *GetActiveGroupResp) String() string { return proto.CompactTextString(m) } func (m *GetActiveGroupResp) String() string { return proto.CompactTextString(m) }
func (*GetActiveGroupResp) ProtoMessage() {} func (*GetActiveGroupResp) ProtoMessage() {}
func (*GetActiveGroupResp) Descriptor() ([]byte, []int) { func (*GetActiveGroupResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{20} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{20}
} }
func (m *GetActiveGroupResp) XXX_Unmarshal(b []byte) error { func (m *GetActiveGroupResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetActiveGroupResp.Unmarshal(m, b) return xxx_messageInfo_GetActiveGroupResp.Unmarshal(m, b)
@ -1258,7 +1266,7 @@ func (m *DateNumList) Reset() { *m = DateNumList{} }
func (m *DateNumList) String() string { return proto.CompactTextString(m) } func (m *DateNumList) String() string { return proto.CompactTextString(m) }
func (*DateNumList) ProtoMessage() {} func (*DateNumList) ProtoMessage() {}
func (*DateNumList) Descriptor() ([]byte, []int) { func (*DateNumList) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{21} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{21}
} }
func (m *DateNumList) XXX_Unmarshal(b []byte) error { func (m *DateNumList) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DateNumList.Unmarshal(m, b) return xxx_messageInfo_DateNumList.Unmarshal(m, b)
@ -1304,7 +1312,7 @@ func (m *GetMessageStatisticsReq) Reset() { *m = GetMessageStatisticsReq
func (m *GetMessageStatisticsReq) String() string { return proto.CompactTextString(m) } func (m *GetMessageStatisticsReq) String() string { return proto.CompactTextString(m) }
func (*GetMessageStatisticsReq) ProtoMessage() {} func (*GetMessageStatisticsReq) ProtoMessage() {}
func (*GetMessageStatisticsReq) Descriptor() ([]byte, []int) { func (*GetMessageStatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{22} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{22}
} }
func (m *GetMessageStatisticsReq) XXX_Unmarshal(b []byte) error { func (m *GetMessageStatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetMessageStatisticsReq.Unmarshal(m, b) return xxx_messageInfo_GetMessageStatisticsReq.Unmarshal(m, b)
@ -1353,7 +1361,7 @@ func (m *GetMessageStatisticsResp) Reset() { *m = GetMessageStatisticsRe
func (m *GetMessageStatisticsResp) String() string { return proto.CompactTextString(m) } func (m *GetMessageStatisticsResp) String() string { return proto.CompactTextString(m) }
func (*GetMessageStatisticsResp) ProtoMessage() {} func (*GetMessageStatisticsResp) ProtoMessage() {}
func (*GetMessageStatisticsResp) Descriptor() ([]byte, []int) { func (*GetMessageStatisticsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{23} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{23}
} }
func (m *GetMessageStatisticsResp) XXX_Unmarshal(b []byte) error { func (m *GetMessageStatisticsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetMessageStatisticsResp.Unmarshal(m, b) return xxx_messageInfo_GetMessageStatisticsResp.Unmarshal(m, b)
@ -1420,7 +1428,7 @@ func (m *GetGroupStatisticsReq) Reset() { *m = GetGroupStatisticsReq{} }
func (m *GetGroupStatisticsReq) String() string { return proto.CompactTextString(m) } func (m *GetGroupStatisticsReq) String() string { return proto.CompactTextString(m) }
func (*GetGroupStatisticsReq) ProtoMessage() {} func (*GetGroupStatisticsReq) ProtoMessage() {}
func (*GetGroupStatisticsReq) Descriptor() ([]byte, []int) { func (*GetGroupStatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{24} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{24}
} }
func (m *GetGroupStatisticsReq) XXX_Unmarshal(b []byte) error { func (m *GetGroupStatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetGroupStatisticsReq.Unmarshal(m, b) return xxx_messageInfo_GetGroupStatisticsReq.Unmarshal(m, b)
@ -1469,7 +1477,7 @@ func (m *GetGroupStatisticsResp) Reset() { *m = GetGroupStatisticsResp{}
func (m *GetGroupStatisticsResp) String() string { return proto.CompactTextString(m) } func (m *GetGroupStatisticsResp) String() string { return proto.CompactTextString(m) }
func (*GetGroupStatisticsResp) ProtoMessage() {} func (*GetGroupStatisticsResp) ProtoMessage() {}
func (*GetGroupStatisticsResp) Descriptor() ([]byte, []int) { func (*GetGroupStatisticsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{25} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{25}
} }
func (m *GetGroupStatisticsResp) XXX_Unmarshal(b []byte) error { func (m *GetGroupStatisticsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetGroupStatisticsResp.Unmarshal(m, b) return xxx_messageInfo_GetGroupStatisticsResp.Unmarshal(m, b)
@ -1536,7 +1544,7 @@ func (m *GetUserStatisticsReq) Reset() { *m = GetUserStatisticsReq{} }
func (m *GetUserStatisticsReq) String() string { return proto.CompactTextString(m) } func (m *GetUserStatisticsReq) String() string { return proto.CompactTextString(m) }
func (*GetUserStatisticsReq) ProtoMessage() {} func (*GetUserStatisticsReq) ProtoMessage() {}
func (*GetUserStatisticsReq) Descriptor() ([]byte, []int) { func (*GetUserStatisticsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{26} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{26}
} }
func (m *GetUserStatisticsReq) XXX_Unmarshal(b []byte) error { func (m *GetUserStatisticsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserStatisticsReq.Unmarshal(m, b) return xxx_messageInfo_GetUserStatisticsReq.Unmarshal(m, b)
@ -1587,7 +1595,7 @@ func (m *GetUserStatisticsResp) Reset() { *m = GetUserStatisticsResp{} }
func (m *GetUserStatisticsResp) String() string { return proto.CompactTextString(m) } func (m *GetUserStatisticsResp) String() string { return proto.CompactTextString(m) }
func (*GetUserStatisticsResp) ProtoMessage() {} func (*GetUserStatisticsResp) ProtoMessage() {}
func (*GetUserStatisticsResp) Descriptor() ([]byte, []int) { func (*GetUserStatisticsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{27} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{27}
} }
func (m *GetUserStatisticsResp) XXX_Unmarshal(b []byte) error { func (m *GetUserStatisticsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserStatisticsResp.Unmarshal(m, b) return xxx_messageInfo_GetUserStatisticsResp.Unmarshal(m, b)
@ -1669,7 +1677,7 @@ func (m *GenerateInvitationCodeReq) Reset() { *m = GenerateInvitationCod
func (m *GenerateInvitationCodeReq) String() string { return proto.CompactTextString(m) } func (m *GenerateInvitationCodeReq) String() string { return proto.CompactTextString(m) }
func (*GenerateInvitationCodeReq) ProtoMessage() {} func (*GenerateInvitationCodeReq) ProtoMessage() {}
func (*GenerateInvitationCodeReq) Descriptor() ([]byte, []int) { func (*GenerateInvitationCodeReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{28} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{28}
} }
func (m *GenerateInvitationCodeReq) XXX_Unmarshal(b []byte) error { func (m *GenerateInvitationCodeReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GenerateInvitationCodeReq.Unmarshal(m, b) return xxx_messageInfo_GenerateInvitationCodeReq.Unmarshal(m, b)
@ -1721,7 +1729,7 @@ func (m *GenerateInvitationCodeResp) Reset() { *m = GenerateInvitationCo
func (m *GenerateInvitationCodeResp) String() string { return proto.CompactTextString(m) } func (m *GenerateInvitationCodeResp) String() string { return proto.CompactTextString(m) }
func (*GenerateInvitationCodeResp) ProtoMessage() {} func (*GenerateInvitationCodeResp) ProtoMessage() {}
func (*GenerateInvitationCodeResp) Descriptor() ([]byte, []int) { func (*GenerateInvitationCodeResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{29} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{29}
} }
func (m *GenerateInvitationCodeResp) XXX_Unmarshal(b []byte) error { func (m *GenerateInvitationCodeResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GenerateInvitationCodeResp.Unmarshal(m, b) return xxx_messageInfo_GenerateInvitationCodeResp.Unmarshal(m, b)
@ -1762,7 +1770,7 @@ func (m *GetInvitationCodesReq) Reset() { *m = GetInvitationCodesReq{} }
func (m *GetInvitationCodesReq) String() string { return proto.CompactTextString(m) } func (m *GetInvitationCodesReq) String() string { return proto.CompactTextString(m) }
func (*GetInvitationCodesReq) ProtoMessage() {} func (*GetInvitationCodesReq) ProtoMessage() {}
func (*GetInvitationCodesReq) Descriptor() ([]byte, []int) { func (*GetInvitationCodesReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{30} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{30}
} }
func (m *GetInvitationCodesReq) XXX_Unmarshal(b []byte) error { func (m *GetInvitationCodesReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetInvitationCodesReq.Unmarshal(m, b) return xxx_messageInfo_GetInvitationCodesReq.Unmarshal(m, b)
@ -1825,7 +1833,7 @@ func (m *InvitationCode) Reset() { *m = InvitationCode{} }
func (m *InvitationCode) String() string { return proto.CompactTextString(m) } func (m *InvitationCode) String() string { return proto.CompactTextString(m) }
func (*InvitationCode) ProtoMessage() {} func (*InvitationCode) ProtoMessage() {}
func (*InvitationCode) Descriptor() ([]byte, []int) { func (*InvitationCode) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{31} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{31}
} }
func (m *InvitationCode) XXX_Unmarshal(b []byte) error { func (m *InvitationCode) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_InvitationCode.Unmarshal(m, b) return xxx_messageInfo_InvitationCode.Unmarshal(m, b)
@ -1893,7 +1901,7 @@ func (m *GetInvitationCodesResp) Reset() { *m = GetInvitationCodesResp{}
func (m *GetInvitationCodesResp) String() string { return proto.CompactTextString(m) } func (m *GetInvitationCodesResp) String() string { return proto.CompactTextString(m) }
func (*GetInvitationCodesResp) ProtoMessage() {} func (*GetInvitationCodesResp) ProtoMessage() {}
func (*GetInvitationCodesResp) Descriptor() ([]byte, []int) { func (*GetInvitationCodesResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{32} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{32}
} }
func (m *GetInvitationCodesResp) XXX_Unmarshal(b []byte) error { func (m *GetInvitationCodesResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetInvitationCodesResp.Unmarshal(m, b) return xxx_messageInfo_GetInvitationCodesResp.Unmarshal(m, b)
@ -1946,7 +1954,7 @@ func (m *QueryIPRegisterReq) Reset() { *m = QueryIPRegisterReq{} }
func (m *QueryIPRegisterReq) String() string { return proto.CompactTextString(m) } func (m *QueryIPRegisterReq) String() string { return proto.CompactTextString(m) }
func (*QueryIPRegisterReq) ProtoMessage() {} func (*QueryIPRegisterReq) ProtoMessage() {}
func (*QueryIPRegisterReq) Descriptor() ([]byte, []int) { func (*QueryIPRegisterReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{33} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{33}
} }
func (m *QueryIPRegisterReq) XXX_Unmarshal(b []byte) error { func (m *QueryIPRegisterReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryIPRegisterReq.Unmarshal(m, b) return xxx_messageInfo_QueryIPRegisterReq.Unmarshal(m, b)
@ -1995,7 +2003,7 @@ func (m *QueryIPRegisterResp) Reset() { *m = QueryIPRegisterResp{} }
func (m *QueryIPRegisterResp) String() string { return proto.CompactTextString(m) } func (m *QueryIPRegisterResp) String() string { return proto.CompactTextString(m) }
func (*QueryIPRegisterResp) ProtoMessage() {} func (*QueryIPRegisterResp) ProtoMessage() {}
func (*QueryIPRegisterResp) Descriptor() ([]byte, []int) { func (*QueryIPRegisterResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{34} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{34}
} }
func (m *QueryIPRegisterResp) XXX_Unmarshal(b []byte) error { func (m *QueryIPRegisterResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryIPRegisterResp.Unmarshal(m, b) return xxx_messageInfo_QueryIPRegisterResp.Unmarshal(m, b)
@ -2063,7 +2071,7 @@ func (m *AddIPLimitReq) Reset() { *m = AddIPLimitReq{} }
func (m *AddIPLimitReq) String() string { return proto.CompactTextString(m) } func (m *AddIPLimitReq) String() string { return proto.CompactTextString(m) }
func (*AddIPLimitReq) ProtoMessage() {} func (*AddIPLimitReq) ProtoMessage() {}
func (*AddIPLimitReq) Descriptor() ([]byte, []int) { func (*AddIPLimitReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{35} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{35}
} }
func (m *AddIPLimitReq) XXX_Unmarshal(b []byte) error { func (m *AddIPLimitReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddIPLimitReq.Unmarshal(m, b) return xxx_messageInfo_AddIPLimitReq.Unmarshal(m, b)
@ -2115,7 +2123,7 @@ func (m *AddIPLimitResp) Reset() { *m = AddIPLimitResp{} }
func (m *AddIPLimitResp) String() string { return proto.CompactTextString(m) } func (m *AddIPLimitResp) String() string { return proto.CompactTextString(m) }
func (*AddIPLimitResp) ProtoMessage() {} func (*AddIPLimitResp) ProtoMessage() {}
func (*AddIPLimitResp) Descriptor() ([]byte, []int) { func (*AddIPLimitResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{36} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{36}
} }
func (m *AddIPLimitResp) XXX_Unmarshal(b []byte) error { func (m *AddIPLimitResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddIPLimitResp.Unmarshal(m, b) return xxx_messageInfo_AddIPLimitResp.Unmarshal(m, b)
@ -2154,7 +2162,7 @@ func (m *RemoveIPLimitReq) Reset() { *m = RemoveIPLimitReq{} }
func (m *RemoveIPLimitReq) String() string { return proto.CompactTextString(m) } func (m *RemoveIPLimitReq) String() string { return proto.CompactTextString(m) }
func (*RemoveIPLimitReq) ProtoMessage() {} func (*RemoveIPLimitReq) ProtoMessage() {}
func (*RemoveIPLimitReq) Descriptor() ([]byte, []int) { func (*RemoveIPLimitReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{37} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{37}
} }
func (m *RemoveIPLimitReq) XXX_Unmarshal(b []byte) error { func (m *RemoveIPLimitReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemoveIPLimitReq.Unmarshal(m, b) return xxx_messageInfo_RemoveIPLimitReq.Unmarshal(m, b)
@ -2199,7 +2207,7 @@ func (m *RemoveIPLimitResp) Reset() { *m = RemoveIPLimitResp{} }
func (m *RemoveIPLimitResp) String() string { return proto.CompactTextString(m) } func (m *RemoveIPLimitResp) String() string { return proto.CompactTextString(m) }
func (*RemoveIPLimitResp) ProtoMessage() {} func (*RemoveIPLimitResp) ProtoMessage() {}
func (*RemoveIPLimitResp) Descriptor() ([]byte, []int) { func (*RemoveIPLimitResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{38} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{38}
} }
func (m *RemoveIPLimitResp) XXX_Unmarshal(b []byte) error { func (m *RemoveIPLimitResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemoveIPLimitResp.Unmarshal(m, b) return xxx_messageInfo_RemoveIPLimitResp.Unmarshal(m, b)
@ -2238,7 +2246,7 @@ func (m *QueryUserIDIPLimitLoginReq) Reset() { *m = QueryUserIDIPLimitLo
func (m *QueryUserIDIPLimitLoginReq) String() string { return proto.CompactTextString(m) } func (m *QueryUserIDIPLimitLoginReq) String() string { return proto.CompactTextString(m) }
func (*QueryUserIDIPLimitLoginReq) ProtoMessage() {} func (*QueryUserIDIPLimitLoginReq) ProtoMessage() {}
func (*QueryUserIDIPLimitLoginReq) Descriptor() ([]byte, []int) { func (*QueryUserIDIPLimitLoginReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{39} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{39}
} }
func (m *QueryUserIDIPLimitLoginReq) XXX_Unmarshal(b []byte) error { func (m *QueryUserIDIPLimitLoginReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryUserIDIPLimitLoginReq.Unmarshal(m, b) return xxx_messageInfo_QueryUserIDIPLimitLoginReq.Unmarshal(m, b)
@ -2285,7 +2293,7 @@ func (m *UserIPLimit) Reset() { *m = UserIPLimit{} }
func (m *UserIPLimit) String() string { return proto.CompactTextString(m) } func (m *UserIPLimit) String() string { return proto.CompactTextString(m) }
func (*UserIPLimit) ProtoMessage() {} func (*UserIPLimit) ProtoMessage() {}
func (*UserIPLimit) Descriptor() ([]byte, []int) { func (*UserIPLimit) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{40} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{40}
} }
func (m *UserIPLimit) XXX_Unmarshal(b []byte) error { func (m *UserIPLimit) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserIPLimit.Unmarshal(m, b) return xxx_messageInfo_UserIPLimit.Unmarshal(m, b)
@ -2338,7 +2346,7 @@ func (m *QueryUserIDIPLimitLoginResp) Reset() { *m = QueryUserIDIPLimitL
func (m *QueryUserIDIPLimitLoginResp) String() string { return proto.CompactTextString(m) } func (m *QueryUserIDIPLimitLoginResp) String() string { return proto.CompactTextString(m) }
func (*QueryUserIDIPLimitLoginResp) ProtoMessage() {} func (*QueryUserIDIPLimitLoginResp) ProtoMessage() {}
func (*QueryUserIDIPLimitLoginResp) Descriptor() ([]byte, []int) { func (*QueryUserIDIPLimitLoginResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{41} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{41}
} }
func (m *QueryUserIDIPLimitLoginResp) XXX_Unmarshal(b []byte) error { func (m *QueryUserIDIPLimitLoginResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QueryUserIDIPLimitLoginResp.Unmarshal(m, b) return xxx_messageInfo_QueryUserIDIPLimitLoginResp.Unmarshal(m, b)
@ -2385,7 +2393,7 @@ func (m *AddUserIPLimitLoginReq) Reset() { *m = AddUserIPLimitLoginReq{}
func (m *AddUserIPLimitLoginReq) String() string { return proto.CompactTextString(m) } func (m *AddUserIPLimitLoginReq) String() string { return proto.CompactTextString(m) }
func (*AddUserIPLimitLoginReq) ProtoMessage() {} func (*AddUserIPLimitLoginReq) ProtoMessage() {}
func (*AddUserIPLimitLoginReq) Descriptor() ([]byte, []int) { func (*AddUserIPLimitLoginReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{42} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{42}
} }
func (m *AddUserIPLimitLoginReq) XXX_Unmarshal(b []byte) error { func (m *AddUserIPLimitLoginReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddUserIPLimitLoginReq.Unmarshal(m, b) return xxx_messageInfo_AddUserIPLimitLoginReq.Unmarshal(m, b)
@ -2437,7 +2445,7 @@ func (m *AddUserIPLimitLoginResp) Reset() { *m = AddUserIPLimitLoginResp
func (m *AddUserIPLimitLoginResp) String() string { return proto.CompactTextString(m) } func (m *AddUserIPLimitLoginResp) String() string { return proto.CompactTextString(m) }
func (*AddUserIPLimitLoginResp) ProtoMessage() {} func (*AddUserIPLimitLoginResp) ProtoMessage() {}
func (*AddUserIPLimitLoginResp) Descriptor() ([]byte, []int) { func (*AddUserIPLimitLoginResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{43} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{43}
} }
func (m *AddUserIPLimitLoginResp) XXX_Unmarshal(b []byte) error { func (m *AddUserIPLimitLoginResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AddUserIPLimitLoginResp.Unmarshal(m, b) return xxx_messageInfo_AddUserIPLimitLoginResp.Unmarshal(m, b)
@ -2477,7 +2485,7 @@ func (m *RemoveUserIPLimitReq) Reset() { *m = RemoveUserIPLimitReq{} }
func (m *RemoveUserIPLimitReq) String() string { return proto.CompactTextString(m) } func (m *RemoveUserIPLimitReq) String() string { return proto.CompactTextString(m) }
func (*RemoveUserIPLimitReq) ProtoMessage() {} func (*RemoveUserIPLimitReq) ProtoMessage() {}
func (*RemoveUserIPLimitReq) Descriptor() ([]byte, []int) { func (*RemoveUserIPLimitReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{44} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{44}
} }
func (m *RemoveUserIPLimitReq) XXX_Unmarshal(b []byte) error { func (m *RemoveUserIPLimitReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemoveUserIPLimitReq.Unmarshal(m, b) return xxx_messageInfo_RemoveUserIPLimitReq.Unmarshal(m, b)
@ -2529,7 +2537,7 @@ func (m *RemoveUserIPLimitResp) Reset() { *m = RemoveUserIPLimitResp{} }
func (m *RemoveUserIPLimitResp) String() string { return proto.CompactTextString(m) } func (m *RemoveUserIPLimitResp) String() string { return proto.CompactTextString(m) }
func (*RemoveUserIPLimitResp) ProtoMessage() {} func (*RemoveUserIPLimitResp) ProtoMessage() {}
func (*RemoveUserIPLimitResp) Descriptor() ([]byte, []int) { func (*RemoveUserIPLimitResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{45} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{45}
} }
func (m *RemoveUserIPLimitResp) XXX_Unmarshal(b []byte) error { func (m *RemoveUserIPLimitResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemoveUserIPLimitResp.Unmarshal(m, b) return xxx_messageInfo_RemoveUserIPLimitResp.Unmarshal(m, b)
@ -2567,7 +2575,7 @@ func (m *GetClientInitConfigReq) Reset() { *m = GetClientInitConfigReq{}
func (m *GetClientInitConfigReq) String() string { return proto.CompactTextString(m) } func (m *GetClientInitConfigReq) String() string { return proto.CompactTextString(m) }
func (*GetClientInitConfigReq) ProtoMessage() {} func (*GetClientInitConfigReq) ProtoMessage() {}
func (*GetClientInitConfigReq) Descriptor() ([]byte, []int) { func (*GetClientInitConfigReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{46} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{46}
} }
func (m *GetClientInitConfigReq) XXX_Unmarshal(b []byte) error { func (m *GetClientInitConfigReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetClientInitConfigReq.Unmarshal(m, b) return xxx_messageInfo_GetClientInitConfigReq.Unmarshal(m, b)
@ -2605,7 +2613,7 @@ func (m *GetClientInitConfigResp) Reset() { *m = GetClientInitConfigResp
func (m *GetClientInitConfigResp) String() string { return proto.CompactTextString(m) } func (m *GetClientInitConfigResp) String() string { return proto.CompactTextString(m) }
func (*GetClientInitConfigResp) ProtoMessage() {} func (*GetClientInitConfigResp) ProtoMessage() {}
func (*GetClientInitConfigResp) Descriptor() ([]byte, []int) { func (*GetClientInitConfigResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{47} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{47}
} }
func (m *GetClientInitConfigResp) XXX_Unmarshal(b []byte) error { func (m *GetClientInitConfigResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetClientInitConfigResp.Unmarshal(m, b) return xxx_messageInfo_GetClientInitConfigResp.Unmarshal(m, b)
@ -2644,7 +2652,7 @@ func (m *SetClientInitConfigReq) Reset() { *m = SetClientInitConfigReq{}
func (m *SetClientInitConfigReq) String() string { return proto.CompactTextString(m) } func (m *SetClientInitConfigReq) String() string { return proto.CompactTextString(m) }
func (*SetClientInitConfigReq) ProtoMessage() {} func (*SetClientInitConfigReq) ProtoMessage() {}
func (*SetClientInitConfigReq) Descriptor() ([]byte, []int) { func (*SetClientInitConfigReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{48} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{48}
} }
func (m *SetClientInitConfigReq) XXX_Unmarshal(b []byte) error { func (m *SetClientInitConfigReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SetClientInitConfigReq.Unmarshal(m, b) return xxx_messageInfo_SetClientInitConfigReq.Unmarshal(m, b)
@ -2689,7 +2697,7 @@ func (m *SetClientInitConfigResp) Reset() { *m = SetClientInitConfigResp
func (m *SetClientInitConfigResp) String() string { return proto.CompactTextString(m) } func (m *SetClientInitConfigResp) String() string { return proto.CompactTextString(m) }
func (*SetClientInitConfigResp) ProtoMessage() {} func (*SetClientInitConfigResp) ProtoMessage() {}
func (*SetClientInitConfigResp) Descriptor() ([]byte, []int) { func (*SetClientInitConfigResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{49} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{49}
} }
func (m *SetClientInitConfigResp) XXX_Unmarshal(b []byte) error { func (m *SetClientInitConfigResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SetClientInitConfigResp.Unmarshal(m, b) return xxx_messageInfo_SetClientInitConfigResp.Unmarshal(m, b)
@ -2731,7 +2739,7 @@ func (m *GetUserFriendsReq) Reset() { *m = GetUserFriendsReq{} }
func (m *GetUserFriendsReq) String() string { return proto.CompactTextString(m) } func (m *GetUserFriendsReq) String() string { return proto.CompactTextString(m) }
func (*GetUserFriendsReq) ProtoMessage() {} func (*GetUserFriendsReq) ProtoMessage() {}
func (*GetUserFriendsReq) Descriptor() ([]byte, []int) { func (*GetUserFriendsReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{50} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{50}
} }
func (m *GetUserFriendsReq) XXX_Unmarshal(b []byte) error { func (m *GetUserFriendsReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserFriendsReq.Unmarshal(m, b) return xxx_messageInfo_GetUserFriendsReq.Unmarshal(m, b)
@ -2800,7 +2808,7 @@ func (m *GetUserFriendsResp) Reset() { *m = GetUserFriendsResp{} }
func (m *GetUserFriendsResp) String() string { return proto.CompactTextString(m) } func (m *GetUserFriendsResp) String() string { return proto.CompactTextString(m) }
func (*GetUserFriendsResp) ProtoMessage() {} func (*GetUserFriendsResp) ProtoMessage() {}
func (*GetUserFriendsResp) Descriptor() ([]byte, []int) { func (*GetUserFriendsResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{51} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{51}
} }
func (m *GetUserFriendsResp) XXX_Unmarshal(b []byte) error { func (m *GetUserFriendsResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserFriendsResp.Unmarshal(m, b) return xxx_messageInfo_GetUserFriendsResp.Unmarshal(m, b)
@ -2861,7 +2869,7 @@ func (m *GetUserIDByEmailAndPhoneNumberReq) Reset() { *m = GetUserIDByEm
func (m *GetUserIDByEmailAndPhoneNumberReq) String() string { return proto.CompactTextString(m) } func (m *GetUserIDByEmailAndPhoneNumberReq) String() string { return proto.CompactTextString(m) }
func (*GetUserIDByEmailAndPhoneNumberReq) ProtoMessage() {} func (*GetUserIDByEmailAndPhoneNumberReq) ProtoMessage() {}
func (*GetUserIDByEmailAndPhoneNumberReq) Descriptor() ([]byte, []int) { func (*GetUserIDByEmailAndPhoneNumberReq) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{52} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{52}
} }
func (m *GetUserIDByEmailAndPhoneNumberReq) XXX_Unmarshal(b []byte) error { func (m *GetUserIDByEmailAndPhoneNumberReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserIDByEmailAndPhoneNumberReq.Unmarshal(m, b) return xxx_messageInfo_GetUserIDByEmailAndPhoneNumberReq.Unmarshal(m, b)
@ -2914,7 +2922,7 @@ func (m *GetUserIDByEmailAndPhoneNumberResp) Reset() { *m = GetUserIDByE
func (m *GetUserIDByEmailAndPhoneNumberResp) String() string { return proto.CompactTextString(m) } func (m *GetUserIDByEmailAndPhoneNumberResp) String() string { return proto.CompactTextString(m) }
func (*GetUserIDByEmailAndPhoneNumberResp) ProtoMessage() {} func (*GetUserIDByEmailAndPhoneNumberResp) ProtoMessage() {}
func (*GetUserIDByEmailAndPhoneNumberResp) Descriptor() ([]byte, []int) { func (*GetUserIDByEmailAndPhoneNumberResp) Descriptor() ([]byte, []int) {
return fileDescriptor_admin_cms_f23e453f07b40171, []int{53} return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{53}
} }
func (m *GetUserIDByEmailAndPhoneNumberResp) XXX_Unmarshal(b []byte) error { func (m *GetUserIDByEmailAndPhoneNumberResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUserIDByEmailAndPhoneNumberResp.Unmarshal(m, b) return xxx_messageInfo_GetUserIDByEmailAndPhoneNumberResp.Unmarshal(m, b)
@ -3804,153 +3812,153 @@ var _AdminCMS_serviceDesc = grpc.ServiceDesc{
} }
func init() { func init() {
proto.RegisterFile("admin_cms/admin_cms.proto", fileDescriptor_admin_cms_f23e453f07b40171) proto.RegisterFile("admin_cms/admin_cms.proto", fileDescriptor_admin_cms_49bc09b1772ecee1)
} }
var fileDescriptor_admin_cms_f23e453f07b40171 = []byte{ var fileDescriptor_admin_cms_49bc09b1772ecee1 = []byte{
// 2290 bytes of a gzipped FileDescriptorProto // 2301 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x1a, 0x4d, 0x6f, 0x1c, 0x49, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x1a, 0x4d, 0x6f, 0x1c, 0x49,
0x55, 0x3d, 0x1f, 0xfe, 0x78, 0xfe, 0x2e, 0x3b, 0xde, 0x71, 0x67, 0xd7, 0xd8, 0x4d, 0xbc, 0x18, 0x55, 0x3d, 0x1f, 0xfe, 0x78, 0xfe, 0x2e, 0x3b, 0xce, 0xb8, 0xb3, 0x6b, 0xec, 0x26, 0x5e, 0x0c,
0xb4, 0xb1, 0x91, 0x23, 0x2e, 0x8b, 0x14, 0xe4, 0x78, 0x62, 0x33, 0x91, 0xed, 0x0c, 0x3d, 0xc9, 0xda, 0xd8, 0xc8, 0x11, 0x97, 0x45, 0x0a, 0x72, 0x3c, 0xb1, 0x99, 0xc8, 0x76, 0x86, 0x9e, 0x78,
0x4a, 0xc0, 0x6a, 0x4d, 0x67, 0xa6, 0x3c, 0x69, 0xd9, 0xd3, 0x5d, 0xe9, 0xea, 0xf1, 0xc6, 0x5a, 0x25, 0x60, 0xb5, 0xa6, 0x33, 0x53, 0x9e, 0xb4, 0xec, 0xe9, 0xae, 0x74, 0xb5, 0xbd, 0xb1, 0x56,
0xed, 0x75, 0x2f, 0x5c, 0x90, 0x90, 0x38, 0x70, 0x44, 0x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0xfe, 0xee, 0x96, 0xd0, 0xff, 0x3c, 0xf9, 0xf5, 0x6a, 0x82, 0x7f, 0x7a, 0xfc, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x1c, 0xab, 0x91, 0x4b, 0x27, 0x00, 0x00,
} }

View File

@ -74,7 +74,7 @@ message GetChatLogsReq {
int32 contentType = 6; int32 contentType = 6;
server_api_params.RequestPagination pagination = 7; server_api_params.RequestPagination pagination = 7;
string operationID = 8; string operationID = 8;
string opUserID = 9;
} }
message ChatLog { message ChatLog {

File diff suppressed because it is too large Load Diff

View File

@ -146,6 +146,7 @@ message GetGroupMembersInfoReq {
repeated string memberList = 2; repeated string memberList = 2;
string OpUserID = 3; //No verification permission string OpUserID = 3; //No verification permission
string OperationID = 4; string OperationID = 4;
bool noCache = 5;
} }
message GetGroupMembersInfoResp { message GetGroupMembersInfoResp {
@ -375,6 +376,27 @@ message GetGroupAbstractInfoResp{
uint64 groupMemberListHash = 3; uint64 groupMemberListHash = 3;
} }
message GroupIsExistReq {
repeated string groupIDList = 1;
string opUserID = 2;
string operationID = 3;
}
message GroupIsExistResp {
CommonResp CommonResp = 1;
map<string, bool> IsExistMap = 2;
}
message UserIsInGroupReq {
string groupID = 1;
repeated string userIDList = 2;
string operationID = 3;
}
message UserIsInGroupResp {
CommonResp CommonResp = 1;
map<string, bool> IsExistMap = 2;
}
service group{ service group{
rpc createGroup(CreateGroupReq) returns(CreateGroupResp); rpc createGroup(CreateGroupReq) returns(CreateGroupResp);
@ -408,6 +430,8 @@ service group{
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp); rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp); rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
rpc GetGroupAbstractInfo(GetGroupAbstractInfoReq) returns (GetGroupAbstractInfoResp); rpc GetGroupAbstractInfo(GetGroupAbstractInfoReq) returns (GetGroupAbstractInfoResp);
rpc GroupIsExist(GroupIsExistReq) returns(GroupIsExistResp);
rpc UserIsInGroup(UserIsInGroupReq) returns(UserIsInGroupResp);
} }

File diff suppressed because it is too large Load Diff

View File

@ -154,26 +154,140 @@ message GetWriteDiffMsgResp{
server_api_params.MsgData msgData = 3; server_api_params.MsgData msgData = 3;
} }
message ModifyMsgReq { message ModifyMessageReactionExtensionsReq {
string operationID = 1; string operationID = 1;
string ID = 2; string sourceID = 2;
int32 Index = 3; string opUserID = 3;
int32 msgIndex = 4; int32 sessionType = 4;
string opUserID = 5; map <string, server_api_params.KeyValue>reactionExtensionList = 5;
string userID = 6; string clientMsgID = 6;
bool isFirstModify = 7; google.protobuf.StringValue ex = 7;
string clientMsgID = 8; google.protobuf.StringValue attachedInfo = 8;
google.protobuf.StringValue value = 9; bool isReact = 9;
google.protobuf.StringValue ex = 10; bool isExternalExtensions = 10;
google.protobuf.StringValue attachedInfo = 11; int64 msgFirstModifyTime = 11;
} }
message SetMessageReactionExtensionsReq {
message ModifyMsgResp { string operationID = 1;
string sourceID = 2;
string opUserID = 3;
int32 sessionType = 4;
map <string, server_api_params.KeyValue>reactionExtensionList = 5;
string clientMsgID = 6;
google.protobuf.StringValue ex = 7;
google.protobuf.StringValue attachedInfo = 8;
bool isReact = 9;
bool isExternalExtensions = 10;
int64 msgFirstModifyTime = 11;
}
message SetMessageReactionExtensionsResp {
int32 errCode = 1; int32 errCode = 1;
string errMsg = 2; string errMsg = 2;
int32 Index = 4; string clientMsgID = 3;
int32 msgIndex = 3; int64 msgFirstModifyTime = 4;
bool isReact = 5;
repeated KeyValueResp result = 6;
} }
message AddMessageReactionExtensionsReq {
string operationID = 1;
string sourceID = 2;
string opUserID = 3;
int32 sessionType = 4;
map <string, server_api_params.KeyValue>reactionExtensionList = 5;
string clientMsgID = 6;
google.protobuf.StringValue ex = 7;
google.protobuf.StringValue attachedInfo = 8;
bool isReact = 9;
bool isExternalExtensions = 10;
int64 msgFirstModifyTime = 11;
}
message AddMessageReactionExtensionsResp {
int32 errCode = 1;
string errMsg = 2;
string clientMsgID = 3;
int64 msgFirstModifyTime = 4;
bool isReact = 5;
repeated KeyValueResp result = 6;
}
message GetMessageListReactionExtensionsReq {
string operationID = 1;
string opUserID = 2;
string sourceID = 3;
int32 sessionType = 4;
bool isExternalExtensions = 5;
message MessageReactionKey {
string clientMsgID = 1;
int64 msgFirstModifyTime = 2;
}
repeated string typeKeyList = 6;
repeated MessageReactionKey messageReactionKeyList = 7;
}
message GetMessageListReactionExtensionsResp{
int32 errCode = 1;
string errMsg = 2;
repeated SingleMessageExtensionResult singleMessageResult =3;
}
message SingleMessageExtensionResult {
int32 errCode = 1;
string errMsg = 2;
map <string, server_api_params.KeyValue>reactionExtensionList = 3;
string clientMsgID = 4;
}
message ModifyMessageReactionExtensionsResp {
int32 errCode = 1;
string errMsg = 2;
repeated ExtendMsgResp successList = 3;
repeated ExtendMsgResp failedList = 4;
}
message DeleteMessageListReactionExtensionsReq {
string operationID = 1;
string opUserID = 2;
string sourceID = 3;
int32 sessionType = 4;
string clientMsgID = 5;
bool isExternalExtensions = 6;
int64 msgFirstModifyTime = 7;
repeated server_api_params.KeyValue reactionExtensionList = 8;
}
message DeleteMessageListReactionExtensionsResp {
int32 errCode = 1;
string errMsg = 2;
repeated KeyValueResp result = 6;
}
message ExtendMsgResp {
ExtendMsg extendMsg = 1;
int32 errCode = 2;
string errMsg = 3;
}
message ExtendMsg {
map <string, KeyValueResp>reactionExtensionList = 1;
string clientMsgID = 2;
int64 msgFirstModifyTime = 3;
string attachedInfo = 4;
string ex = 5;
}
message KeyValueResp {
server_api_params.KeyValue keyValue = 1;
int32 errCode = 2;
string errMsg = 3;
}
message MsgDataToModifyByMQ{
string aggregationID = 1;
repeated MsgDataToMQ messageList = 2;
string triggerID = 3;
}
service msg { service msg {
rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp); rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp);
@ -189,5 +303,8 @@ service msg {
rpc GetWriteDiffMsg(GetWriteDiffMsgReq) returns(GetWriteDiffMsgResp); rpc GetWriteDiffMsg(GetWriteDiffMsgReq) returns(GetWriteDiffMsgResp);
// modify msg // modify msg
rpc ModifyMsg(ModifyMsgReq) returns(ModifyMsgResp); rpc SetMessageReactionExtensions(SetMessageReactionExtensionsReq) returns(SetMessageReactionExtensionsResp);
rpc GetMessageListReactionExtensions(GetMessageListReactionExtensionsReq) returns(GetMessageListReactionExtensionsResp);
rpc AddMessageReactionExtensions(AddMessageReactionExtensionsReq) returns(AddMessageReactionExtensionsResp);
rpc DeleteMessageReactionExtensions(DeleteMessageListReactionExtensionsReq) returns(DeleteMessageListReactionExtensionsResp);
} }

View File

@ -37,7 +37,7 @@ func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} }
func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) } func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) }
func (*OnlinePushMsgReq) ProtoMessage() {} func (*OnlinePushMsgReq) ProtoMessage() {}
func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) { func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{0} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{0}
} }
func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b)
@ -89,7 +89,7 @@ func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} }
func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) } func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) }
func (*OnlinePushMsgResp) ProtoMessage() {} func (*OnlinePushMsgResp) ProtoMessage() {}
func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) { func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{1} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{1}
} }
func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b)
@ -129,7 +129,7 @@ func (m *SingelMsgToUserResultList) Reset() { *m = SingelMsgToUserResult
func (m *SingelMsgToUserResultList) String() string { return proto.CompactTextString(m) } func (m *SingelMsgToUserResultList) String() string { return proto.CompactTextString(m) }
func (*SingelMsgToUserResultList) ProtoMessage() {} func (*SingelMsgToUserResultList) ProtoMessage() {}
func (*SingelMsgToUserResultList) Descriptor() ([]byte, []int) { func (*SingelMsgToUserResultList) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{2} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{2}
} }
func (m *SingelMsgToUserResultList) XXX_Unmarshal(b []byte) error { func (m *SingelMsgToUserResultList) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SingelMsgToUserResultList.Unmarshal(m, b) return xxx_messageInfo_SingelMsgToUserResultList.Unmarshal(m, b)
@ -183,7 +183,7 @@ func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgR
func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) } func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) }
func (*OnlineBatchPushOneMsgReq) ProtoMessage() {} func (*OnlineBatchPushOneMsgReq) ProtoMessage() {}
func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) { func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{3} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{3}
} }
func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error { func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b) return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b)
@ -235,7 +235,7 @@ func (m *OnlineBatchPushOneMsgResp) Reset() { *m = OnlineBatchPushOneMsg
func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) } func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) }
func (*OnlineBatchPushOneMsgResp) ProtoMessage() {} func (*OnlineBatchPushOneMsgResp) ProtoMessage() {}
func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) { func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{4} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{4}
} }
func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error { func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b) return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b)
@ -275,7 +275,7 @@ func (m *SingleMsgToUserPlatform) Reset() { *m = SingleMsgToUserPlatform
func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) } func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) }
func (*SingleMsgToUserPlatform) ProtoMessage() {} func (*SingleMsgToUserPlatform) ProtoMessage() {}
func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) { func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{5} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{5}
} }
func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error { func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b) return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b)
@ -329,7 +329,7 @@ func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq
func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) } func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) }
func (*GetUsersOnlineStatusReq) ProtoMessage() {} func (*GetUsersOnlineStatusReq) ProtoMessage() {}
func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) { func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{6} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{6}
} }
func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b)
@ -384,7 +384,7 @@ func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusRe
func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) }
func (*GetUsersOnlineStatusResp) ProtoMessage() {} func (*GetUsersOnlineStatusResp) ProtoMessage() {}
func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{7} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{7}
} }
func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b)
@ -448,7 +448,7 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() {
func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) } func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) }
func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {}
func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) { func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{7, 0} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{7, 0}
} }
func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b)
@ -509,7 +509,7 @@ func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersO
func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) } func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) }
func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {}
func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) { func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{7, 1} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{7, 1}
} }
func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b)
@ -565,7 +565,7 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() {
func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) } func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) }
func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {}
func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) { func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{7, 2} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{7, 2}
} }
func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b)
@ -619,7 +619,7 @@ func (m *KickUserOfflineReq) Reset() { *m = KickUserOfflineReq{} }
func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) } func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) }
func (*KickUserOfflineReq) ProtoMessage() {} func (*KickUserOfflineReq) ProtoMessage() {}
func (*KickUserOfflineReq) Descriptor() ([]byte, []int) { func (*KickUserOfflineReq) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{8} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{8}
} }
func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error { func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b) return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b)
@ -670,7 +670,7 @@ func (m *KickUserOfflineResp) Reset() { *m = KickUserOfflineResp{} }
func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) } func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) }
func (*KickUserOfflineResp) ProtoMessage() {} func (*KickUserOfflineResp) ProtoMessage() {}
func (*KickUserOfflineResp) Descriptor() ([]byte, []int) { func (*KickUserOfflineResp) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{9} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{9}
} }
func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error { func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b) return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b)
@ -704,7 +704,7 @@ func (m *MultiTerminalLoginCheckReq) Reset() { *m = MultiTerminalLoginCh
func (m *MultiTerminalLoginCheckReq) String() string { return proto.CompactTextString(m) } func (m *MultiTerminalLoginCheckReq) String() string { return proto.CompactTextString(m) }
func (*MultiTerminalLoginCheckReq) ProtoMessage() {} func (*MultiTerminalLoginCheckReq) ProtoMessage() {}
func (*MultiTerminalLoginCheckReq) Descriptor() ([]byte, []int) { func (*MultiTerminalLoginCheckReq) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{10} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{10}
} }
func (m *MultiTerminalLoginCheckReq) XXX_Unmarshal(b []byte) error { func (m *MultiTerminalLoginCheckReq) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MultiTerminalLoginCheckReq.Unmarshal(m, b) return xxx_messageInfo_MultiTerminalLoginCheckReq.Unmarshal(m, b)
@ -764,7 +764,7 @@ func (m *MultiTerminalLoginCheckResp) Reset() { *m = MultiTerminalLoginC
func (m *MultiTerminalLoginCheckResp) String() string { return proto.CompactTextString(m) } func (m *MultiTerminalLoginCheckResp) String() string { return proto.CompactTextString(m) }
func (*MultiTerminalLoginCheckResp) ProtoMessage() {} func (*MultiTerminalLoginCheckResp) ProtoMessage() {}
func (*MultiTerminalLoginCheckResp) Descriptor() ([]byte, []int) { func (*MultiTerminalLoginCheckResp) Descriptor() ([]byte, []int) {
return fileDescriptor_relay_fe7346d2191b0ff8, []int{11} return fileDescriptor_relay_8a2a5bc32d9acd54, []int{11}
} }
func (m *MultiTerminalLoginCheckResp) XXX_Unmarshal(b []byte) error { func (m *MultiTerminalLoginCheckResp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MultiTerminalLoginCheckResp.Unmarshal(m, b) return xxx_messageInfo_MultiTerminalLoginCheckResp.Unmarshal(m, b)
@ -833,6 +833,7 @@ type RelayClient interface {
SuperGroupOnlineBatchPushOneMsg(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) KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error)
MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error) MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error)
SuperGroupBackgroundOnlinePush(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error)
} }
type relayClient struct { type relayClient struct {
@ -897,6 +898,15 @@ func (c *relayClient) MultiTerminalLoginCheck(ctx context.Context, in *MultiTerm
return out, nil return out, nil
} }
func (c *relayClient) SuperGroupBackgroundOnlinePush(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) {
out := new(OnlineBatchPushOneMsgResp)
err := grpc.Invoke(ctx, "/relay.relay/SuperGroupBackgroundOnlinePush", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Relay service // Server API for Relay service
type RelayServer interface { type RelayServer interface {
@ -906,6 +916,7 @@ type RelayServer interface {
SuperGroupOnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error) SuperGroupOnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error)
KickUserOffline(context.Context, *KickUserOfflineReq) (*KickUserOfflineResp, error) KickUserOffline(context.Context, *KickUserOfflineReq) (*KickUserOfflineResp, error)
MultiTerminalLoginCheck(context.Context, *MultiTerminalLoginCheckReq) (*MultiTerminalLoginCheckResp, error) MultiTerminalLoginCheck(context.Context, *MultiTerminalLoginCheckReq) (*MultiTerminalLoginCheckResp, error)
SuperGroupBackgroundOnlinePush(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error)
} }
func RegisterRelayServer(s *grpc.Server, srv RelayServer) { func RegisterRelayServer(s *grpc.Server, srv RelayServer) {
@ -1020,6 +1031,24 @@ func _Relay_MultiTerminalLoginCheck_Handler(srv interface{}, ctx context.Context
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Relay_SuperGroupBackgroundOnlinePush_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.(RelayServer).SuperGroupBackgroundOnlinePush(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/relay.relay/SuperGroupBackgroundOnlinePush",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RelayServer).SuperGroupBackgroundOnlinePush(ctx, req.(*OnlineBatchPushOneMsgReq))
}
return interceptor(ctx, in, info, handler)
}
var _Relay_serviceDesc = grpc.ServiceDesc{ var _Relay_serviceDesc = grpc.ServiceDesc{
ServiceName: "relay.relay", ServiceName: "relay.relay",
HandlerType: (*RelayServer)(nil), HandlerType: (*RelayServer)(nil),
@ -1048,66 +1077,71 @@ var _Relay_serviceDesc = grpc.ServiceDesc{
MethodName: "MultiTerminalLoginCheck", MethodName: "MultiTerminalLoginCheck",
Handler: _Relay_MultiTerminalLoginCheck_Handler, Handler: _Relay_MultiTerminalLoginCheck_Handler,
}, },
{
MethodName: "SuperGroupBackgroundOnlinePush",
Handler: _Relay_SuperGroupBackgroundOnlinePush_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "relay/relay.proto", Metadata: "relay/relay.proto",
} }
func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_fe7346d2191b0ff8) } func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_8a2a5bc32d9acd54) }
var fileDescriptor_relay_fe7346d2191b0ff8 = []byte{ var fileDescriptor_relay_8a2a5bc32d9acd54 = []byte{
// 844 bytes of a gzipped FileDescriptorProto // 857 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xe3, 0x44, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44,
0x14, 0x97, 0x37, 0xc9, 0xee, 0xf6, 0xb5, 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9, 0x70, 0xc2, 0x52, 0xb1, 0x78,
0xa7, 0xdf, 0x0b, 0xc2, 0x87, 0x03, 0xbb, 0xa2, 0x12, 0x17, 0x30, 0xf7, 0x02, 0x5e, 0x6d, 0xf4, 0x4d, 0xbf, 0x17, 0x84, 0x0f, 0x07, 0x76, 0x45, 0x15, 0x2e, 0xf8, 0xdc, 0x2b, 0x78, 0xb6, 0x35,
0x23, 0x18, 0xea, 0x41, 0x95, 0x13, 0xc1, 0x6c, 0xab, 0x55, 0x69, 0x1f, 0xf6, 0x1a, 0x1d, 0x4d, 0x8f, 0x60, 0xa8, 0x07, 0x55, 0x4e, 0x04, 0xb3, 0xad, 0x56, 0xa5, 0x7d, 0xdc, 0x6b, 0x74, 0x34,
0x79, 0x12, 0xc6, 0x41, 0x44, 0x46, 0x22, 0xd0, 0xc1, 0x57, 0x91, 0x97, 0xcc, 0x29, 0x5f, 0x61, 0xe4, 0x49, 0x18, 0x07, 0x11, 0x19, 0x89, 0x40, 0x27, 0xdf, 0x44, 0x5e, 0x32, 0xa7, 0x7c, 0x85,
0xe5, 0xeb, 0xfe, 0x6a, 0xc1, 0x99, 0xf4, 0x20, 0x51, 0xe6, 0x81, 0x89, 0x48, 0xa3, 0xe4, 0x32, 0x55, 0xac, 0xfb, 0xab, 0x05, 0x17, 0x32, 0x82, 0x44, 0x59, 0x04, 0x26, 0x22, 0x8d, 0x92, 0xeb,
0x14, 0x09, 0xfa, 0x14, 0x9e, 0xa7, 0xba, 0x09, 0xcd, 0xce, 0x58, 0x59, 0xa5, 0x67, 0xff, 0xbd, 0x50, 0x24, 0xe8, 0x53, 0x78, 0x9c, 0xea, 0x21, 0x34, 0x3a, 0x63, 0x65, 0x9d, 0x1e, 0xfd, 0xfb,
0x12, 0x6a, 0x00, 0xd0, 0xac, 0x65, 0x45, 0xea, 0x25, 0xce, 0x21, 0xee, 0x9f, 0x16, 0xd8, 0x9a, 0x4e, 0xa8, 0x01, 0x40, 0xb3, 0x91, 0x15, 0xa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rpc SuperGroupOnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp); rpc SuperGroupOnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp);
rpc KickUserOffline(KickUserOfflineReq) returns(KickUserOfflineResp); rpc KickUserOffline(KickUserOfflineReq) returns(KickUserOfflineResp);
rpc MultiTerminalLoginCheck(MultiTerminalLoginCheckReq) returns(MultiTerminalLoginCheckResp); rpc MultiTerminalLoginCheck(MultiTerminalLoginCheckReq) returns(MultiTerminalLoginCheckResp);
rpc SuperGroupBackgroundOnlinePush(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp);
} }

File diff suppressed because it is too large Load Diff

View File

@ -266,6 +266,9 @@ message MsgData {
bytes msgDataList = 21; bytes msgDataList = 21;
string attachedInfo = 22; string attachedInfo = 22;
string ex = 23; string ex = 23;
bool isReact = 24;
bool isExternalExtensions = 25;
int64 msgFirstModifyTime = 26;
} }
message OfflinePushInfo{ message OfflinePushInfo{
@ -330,6 +333,7 @@ message GroupApplicationAcceptedTips{
GroupInfo group = 1; GroupInfo group = 1;
GroupMemberFullInfo opUser = 2; GroupMemberFullInfo opUser = 2;
string handleMsg = 4; string handleMsg = 4;
int32 receiverAs = 5; // admin(==1) or applicant(==0)
} }
// OnApplicationGroupRejected() // OnApplicationGroupRejected()
@ -337,6 +341,7 @@ message GroupApplicationRejectedTips{
GroupInfo group = 1; GroupInfo group = 1;
GroupMemberFullInfo opUser = 2; GroupMemberFullInfo opUser = 2;
string handleMsg = 4; string handleMsg = 4;
int32 receiverAs = 5; // admin(==1) or applicant(==0)
} }
// OnTransferGroupOwner() // OnTransferGroupOwner()
@ -707,25 +712,27 @@ message SetAppBackgroundStatusResp {
} }
message ExtendMsgSet { message ExtendMsgSet {
string ID = 1; string sourceID = 1;
repeated ExtendMsg extendMsgs = 2; int32 sessionType = 2;
int32 latestUpdateTime = 3; map <string, ExtendMsg>extendMsgs = 3;
string attachedInfo = 4; int64 MaxMsgUpdateTime = 4;
string ex = 5; int32 extendMsgNum = 5;
int32 extendMsgNum = 6; int64 createTime = 6;
int32 createTime = 7;
} }
message ExtendMsg { message ExtendMsg {
repeated ReactionExtendMsgSet content = 1; map <string, KeyValue>reactionExtensionList = 1;
string clientMsgID = 2; string clientMsgID = 2;
int32 createTime = 3; int64 msgFirstModifyTime = 3;
int32 latestUpdateTime = 4; string attachedInfo = 4;
string ex = 5;
} }
message ReactionExtendMsgSet { message KeyValue {
string userKey = 1; string typeKey = 1;
string value = 2; string value = 2;
int32 latestUpdateTime = 3; int64 latestUpdateTime = 3;
} }

View File

@ -0,0 +1,176 @@
package batcher
import (
"Open_IM/pkg/common/log"
"context"
"errors"
"hash/crc32"
"sync"
"time"
)
var (
ErrorNotSetFunction = errors.New("not set do function")
)
var (
DefaultSize = 100
DefaultBuffer = 100
DefaultWorker = 5
DefaultInterval = time.Second
)
type DoFuntion func(ctx context.Context, val map[string][]interface{})
type Option func(c *Config)
type Config struct {
size int //Number of message aggregations
buffer int //The number of caches running in a single coroutine
worker int //Number of coroutines processed in parallel
interval time.Duration //Time of message aggregations
}
func newDefaultConfig() *Config {
return &Config{
size: DefaultSize,
buffer: DefaultBuffer,
worker: DefaultWorker,
interval: DefaultInterval,
}
}
type Batcher struct {
config Config
Do func(ctx context.Context, val map[string][]interface{})
Sharding func(key string) int
chans []chan *msg
wait sync.WaitGroup
}
type msg struct {
key string
val interface{}
}
func NewBatcher(fn DoFuntion, opts ...Option) *Batcher {
b := &Batcher{}
b.Do = fn
config := newDefaultConfig()
for _, o := range opts {
o(config)
}
b.chans = make([]chan *msg, b.config.worker)
for i := 0; i < b.config.worker; i++ {
b.chans[i] = make(chan *msg, b.config.buffer)
}
return b
}
func WithSize(s int) Option {
return func(c *Config) {
c.size = s
}
}
func WithBuffer(b int) Option {
return func(c *Config) {
c.buffer = b
}
}
func WithWorker(w int) Option {
return func(c *Config) {
c.worker = w
}
}
func WithInterval(i time.Duration) Option {
return func(c *Config) {
c.interval = i
}
}
func (b *Batcher) Start() error {
if b.Do == nil {
return ErrorNotSetFunction
}
if b.Sharding == nil {
b.Sharding = func(key string) int {
hasCode := int(crc32.ChecksumIEEE([]byte(key)))
return hasCode % b.config.worker
}
}
b.wait.Add(len(b.chans))
for i, ch := range b.chans {
go b.merge(i, ch)
}
return nil
}
func (b *Batcher) Add(key string, val interface{}) error {
ch, msg := b.add(key, val)
select {
case ch <- msg:
default:
return ErrFull
}
return nil
}
func (b *Batcher) add(key string, val interface{}) (chan *msg, *msg) {
sharding := b.Sharding(key) % b.opts.worker
ch := b.chans[sharding]
msg := &msg{key: key, val: val}
return ch, msg
}
func (b *Batcher) merge(idx int, ch <-chan *msg) {
defer b.wait.Done()
var (
msg *msg
count int
closed bool
lastTicker = true
interval = b.opts.interval
vals = make(map[string][]interface{}, b.opts.size)
)
if idx > 0 {
interval = time.Duration(int64(idx) * (int64(b.opts.interval) / int64(b.opts.worker)))
}
ticker := time.NewTicker(interval)
for {
select {
case msg = <-ch:
if msg == nil {
closed = true
break
}
count++
vals[msg.key] = append(vals[msg.key], msg.val)
if count >= b.opts.size {
break
}
continue
case <-ticker.C:
if lastTicker {
ticker.Stop()
ticker = time.NewTicker(b.opts.interval)
lastTicker = false
}
}
if len(vals) > 0 {
ctx := context.Background()
b.Do(ctx, vals)
vals = make(map[string][]interface{}, b.opts.size)
count = 0
}
if closed {
ticker.Stop()
return
}
}
}
func (b *Batcher) Close() {
for _, ch := range b.chans {
ch <- nil
}
b.wait.Wait()
}

View File

@ -119,6 +119,22 @@ func DifferenceString(slice1, slice2 []string) []string {
} }
return n return n
} }
func RemoveFromSlice(slice1, slice2 []string) []string {
for _, v1 := range slice1 {
for i2, v2 := range slice2 {
if v2 == v1 {
if i2 != len(slice2)-1 {
slice2 = append(slice2[:i2], slice2[i2+1:]...)
} else {
slice2 = append(slice2[:i2])
}
}
}
}
return slice2
}
func OperationIDGenerator() string { func OperationIDGenerator() string {
return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10) return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10)
} }
@ -146,7 +162,8 @@ func Pb2String(pb proto.Message) (string, error) {
} }
func String2Pb(s string, pb proto.Message) error { func String2Pb(s string, pb proto.Message) error {
return proto.Unmarshal([]byte(s), pb) err := jsonpb.UnmarshalString(s, pb)
return err
} }
func Map2Pb(m map[string]string) (pb proto.Message, err error) { func Map2Pb(m map[string]string) (pb proto.Message, err error) {

View File

@ -54,13 +54,13 @@ else
fi fi
#check=$(ps aux | grep -w ./${cron_task_name} | grep -v grep | wc -l) check=$(ps aux | grep -w ./${cron_task_name} | grep -v grep | wc -l)
#if [ $check -ge 1 ]; then if [ $check -ge 1 ]; then
# echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImCronTask"${COLOR_SUFFIX} echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImCronTask"${COLOR_SUFFIX}
#else else
# echo -e ${RED_PREFIX}"cron_task_name service does not start normally"${COLOR_SUFFIX} echo -e ${RED_PREFIX}"cron_task_name service does not start normally"${COLOR_SUFFIX}
# echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX} echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX}
# exit -1 exit -1
#fi fi
#
#echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX} echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX}

View File

@ -10,6 +10,7 @@ need_to_start_server_shell=(
msg_transfer_start.sh msg_transfer_start.sh
sdk_svr_start.sh sdk_svr_start.sh
demo_svr_start.sh demo_svr_start.sh
start_cron.sh
) )
#fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started

View File

@ -1,6 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source ./style_info.cfg source ./style_info.cfg
echo -e "check time synchronize.................................."
t=`curl http://time.akamai.com/?iso -s`
t1=`date -d $t +%s`
t2=`date +%s`
let between=t2-t1
if [[ $between -gt 10 ]] || [[ $between -lt -10 ]]; then
echo -e ${RED_PREFIX}"Warning: The difference between the iso time and the server's time is too large: "$between"s" ${COLOR_SUFFIX}
else
echo -e ${GREEN_PREFIX} "ok: Server time is synchronized " ${COLOR_SUFFIX}
fi
echo -e "check login user........................................" echo -e "check login user........................................"
user=`whoami` user=`whoami`
if [ $user == "root" ] ; then if [ $user == "root" ] ; then

View File

@ -10,7 +10,7 @@ need_to_start_server_shell=(
sdk_svr_start.sh sdk_svr_start.sh
msg_gateway_start.sh msg_gateway_start.sh
demo_svr_start.sh demo_svr_start.sh
# start_cron.sh start_cron.sh
) )
time=`date +"%Y-%m-%d %H:%M:%S"` time=`date +"%Y-%m-%d %H:%M:%S"`
echo "==========================================================">>../logs/openIM.log 2>&1 & echo "==========================================================">>../logs/openIM.log 2>&1 &