mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-08 19:45:22 +08:00
Merge remote-tracking branch 'origin/v2.3.0release' into v2.3.0release
This commit is contained in:
commit
396a87ab71
72
README.md
72
README.md
@ -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.
|
||||
|
||||
#### 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
|
||||
```
|
||||
|
||||
3. Build and start Service.
|
||||
3. Deploy
|
||||
|
||||
1. Shell authorization
|
||||
1. Modify env
|
||||
|
||||
```
|
||||
#cd Open-IM-server/script
|
||||
|
||||
chmod +x *.sh
|
||||
#cd Open-IM-server
|
||||
USER=root
|
||||
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
|
||||
```
|
||||
|
||||
3. Start service
|
||||
|
||||
```
|
||||
./start_all.sh
|
||||
chmod +x install_im_server.sh;
|
||||
./install_im_server.sh;
|
||||
```
|
||||
|
||||
4. Check service
|
||||
|
||||
```
|
||||
./check_all.sh
|
||||
cd script;
|
||||
./docker_check_service.sh./check_all.sh
|
||||
```
|
||||
|
||||

|
||||
|
||||
#### 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
|
||||
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive
|
||||
cd cmd/Open-IM-SDK-Core
|
||||
git checkout main
|
||||
```
|
||||
|
||||
2. [Install Docker Compose](https://docs.docker.com/compose/install/) 1.22 or above.
|
||||
1. Set executable permissions
|
||||
|
||||
3. Clone the Open-IM project to your server.
|
||||
```shell
|
||||
cd ../../script/
|
||||
chmod +x *.sh
|
||||
```
|
||||
|
||||
```
|
||||
git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive
|
||||
```
|
||||
1. build
|
||||
|
||||
4. Start docker-compose with one click(Docker automatically pulls all images)
|
||||
```shell
|
||||
./batch_build_all_service.sh
|
||||
```
|
||||
|
||||
```
|
||||
cd Open-IM-Server
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
5. Check service
|
||||
|
||||
```
|
||||
./docker_check_service.sh
|
||||
./check_all.sh
|
||||
```
|
||||
|
||||

|
||||
all services build success
|
||||
|
||||
### CONFIGURATION INSTRUCTIONS
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 1667b0f4e205fc4ed7c690ab55b662087d61c277
|
||||
Subproject commit e7bf4b2a2066e8836dccd908d11b4d37c1c6a4ce
|
@ -163,6 +163,11 @@ func main() {
|
||||
chatGroup.POST("/batch_send_msg", manage.ManagementBatchSendMsg)
|
||||
chatGroup.POST("/check_msg_is_send_success", manage.CheckMsgIsSendSuccess)
|
||||
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
|
||||
conversationGroup := r.Group("/conversation")
|
||||
@ -232,7 +237,7 @@ func main() {
|
||||
if config.Config.Api.ListenIP != "" {
|
||||
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)
|
||||
if err != nil {
|
||||
log.Error("", "api run failed ", address, err.Error())
|
||||
|
@ -25,6 +25,6 @@ func main() {
|
||||
address = config.Config.Api.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)
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ func main() {
|
||||
address = config.Config.Api.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.ImportFriendRoutine()
|
||||
err := r.Run(address)
|
||||
|
@ -21,7 +21,7 @@ func main() {
|
||||
flag.Parse()
|
||||
var wg sync.WaitGroup
|
||||
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.Run(*prometheusPort)
|
||||
wg.Wait()
|
||||
|
@ -17,7 +17,7 @@ func main() {
|
||||
flag.Parse()
|
||||
log.NewPrivateLog(constant.LogFileName)
|
||||
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)
|
||||
wg.Wait()
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ func main() {
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
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.Run(*prometheusPort)
|
||||
wg.Wait()
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.AdminCmsPrometheusPort[0], "adminCMSPrometheusPort default listen port")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
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")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -15,7 +15,7 @@ func main() {
|
||||
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")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
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")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
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")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
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")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.MessagePrometheusPort[0], "msgPrometheusPort default listen port")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OfficePrometheusPort[0], "officePrometheusPort default listen port")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
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")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -14,7 +14,7 @@ func main() {
|
||||
rpcPort := flag.Int("port", defaultPorts[0], "rpc listening port")
|
||||
prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.UserPrometheusPort[0], "userPrometheusPort default listen port")
|
||||
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)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(*prometheusPort)
|
||||
|
@ -36,7 +36,7 @@ mongo:
|
||||
dbPassword: #mongo密码,建议先不设置
|
||||
dbMaxPoolSize: 100
|
||||
dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改
|
||||
chatRecordsClearTime: "* * * * *" # 每天凌晨3点清除消息,该配置和linux定时任务一样, 清理操作建议设置在用户活跃少的时候 # 0 3 * * *
|
||||
chatRecordsClearTime: "0 3 * * *" # 每天凌晨3点清除消息,该配置和linux定时任务一样, 清理操作建议设置在用户活跃少的时候 # 0 3 * * *
|
||||
|
||||
redis:
|
||||
dbAddress: [ 127.0.0.1:16379 ] #redis地址 单机时,填写一个地址即可,使用redis集群时候,填写集群中多个节点地址(主从地址都可以填写,增加容灾能力),默认即可
|
||||
@ -62,12 +62,15 @@ kafka:
|
||||
ms2pschat:
|
||||
addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可
|
||||
topic: "ms2ps_chat" #消息push
|
||||
msgtomodify:
|
||||
addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可
|
||||
topic: "msg_to_modify"
|
||||
consumergroupid:
|
||||
msgToTransfer: mongo
|
||||
msgToMongo: mongo_ex
|
||||
msgToMySql: mysql
|
||||
msgToPush: push
|
||||
|
||||
msgToModify: modify
|
||||
|
||||
|
||||
#---------------Internal service configuration---------------------#
|
||||
@ -345,10 +348,15 @@ callback:
|
||||
enable: false
|
||||
callbackTimeOut: 2
|
||||
callbackFailedContinue: true # 回调超时是否继续
|
||||
callbackBeforeExtendMsgModify:
|
||||
callbackBeforeSetGroupMemberInfo:
|
||||
enable: false
|
||||
callbackTimeOut: 2
|
||||
callbackFailedContinue: true # 回调超时是否继续
|
||||
callbackSetMessageReactionExtensions:
|
||||
enable: false
|
||||
callbackTimeOut: 2
|
||||
callbackFailedContinue: true # 回调超时是否继续
|
||||
|
||||
|
||||
notification:
|
||||
groupCreated:
|
||||
|
@ -115,7 +115,7 @@ services:
|
||||
|
||||
|
||||
open_im_server:
|
||||
image: openim/open_im_server:v2.3.5
|
||||
image: openim/open_im_server:v2.3.7
|
||||
container_name: open_im_server
|
||||
volumes:
|
||||
- ./logs:/Open-IM-Server/logs
|
||||
@ -139,7 +139,7 @@ services:
|
||||
max-file: "2"
|
||||
|
||||
open_im_enterprise:
|
||||
image: openim/open_im_enterprise:v1.0.0
|
||||
image: openim/open_im_enterprise:v1.0.3
|
||||
container_name: open_im_enterprise
|
||||
volumes:
|
||||
- ./logs:/Open-IM-Enterprise/logs
|
||||
|
@ -1,4 +1,13 @@
|
||||
#!/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 ;
|
||||
chmod +x *.sh ;
|
||||
|
@ -38,6 +38,7 @@ func SetOptions(options map[string]bool, value bool) {
|
||||
|
||||
func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
|
||||
var newContent string
|
||||
options := make(map[string]bool, 5)
|
||||
var err error
|
||||
switch params.ContentType {
|
||||
case constant.Text:
|
||||
@ -57,12 +58,13 @@ func newUserSendMsgReq(params *api.ManagementSendMsgReq) *pbChat.SendMsgReq {
|
||||
case constant.CustomOnlineOnly:
|
||||
fallthrough
|
||||
case constant.AdvancedRevoke:
|
||||
utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false)
|
||||
newContent = utils.StructToJsonString(params.Content)
|
||||
case constant.Revoke:
|
||||
utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false)
|
||||
newContent = params.Content["revokeMsgClientID"].(string)
|
||||
default:
|
||||
}
|
||||
options := make(map[string]bool, 5)
|
||||
if params.IsOnlineOnly {
|
||||
SetOptions(options, false)
|
||||
}
|
||||
|
207
internal/api/msg/extend_msg.go
Normal file
207
internal/api/msg/extend_msg.go
Normal 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)
|
||||
}
|
@ -7,11 +7,12 @@ import (
|
||||
"Open_IM/pkg/common/log"
|
||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
"Open_IM/pkg/utils"
|
||||
goRedis "github.com/go-redis/redis/v8"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
goRedis "github.com/go-redis/redis/v8"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
const oldestList = 0
|
||||
@ -105,59 +106,45 @@ func deleteMongoMsg(operationID string, ID string, index int64, delStruct *delMs
|
||||
if len(msgs.Msg) > db.GetSingleGocMsgNum() {
|
||||
log.NewWarn(operationID, utils.GetSelfFuncName(), "msgs too large", len(msgs.Msg), msgs.UID)
|
||||
}
|
||||
var hasMsgDoNotNeedDel bool
|
||||
for i, msg := range msgs.Msg {
|
||||
// 找到列表中不需要删除的消息了, 表示为递归到最后一个块
|
||||
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{}
|
||||
err = proto.Unmarshal(msgs.Msg[len(msgs.Msg)-1].Msg, lastMsgPb)
|
||||
if err != nil {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), len(msgs.Msg)-1, msgs.UID)
|
||||
return 0, utils.Wrap(err, "proto.Unmarshal failed")
|
||||
}
|
||||
delStruct.minSeq = lastMsgPb.Seq
|
||||
if msgListIsFull(msgs) {
|
||||
log.NewDebug(operationID, "msg list is full", msgs.UID)
|
||||
if msgs.Msg[len(msgs.Msg)-1].SendTime+(int64(config.Config.Mongo.DBRetainChatRecords)*24*60*60*1000) < utils.GetCurrentTimestampByMill() && msgListIsFull(msgs) {
|
||||
delStruct.delUidList = append(delStruct.delUidList, msgs.UID)
|
||||
lastMsgPb := &server_api_params.MsgData{}
|
||||
err = proto.Unmarshal(msgs.Msg[len(msgs.Msg)-1].Msg, lastMsgPb)
|
||||
if err != nil {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), len(msgs.Msg)-1, msgs.UID)
|
||||
return 0, utils.Wrap(err, "proto.Unmarshal failed")
|
||||
}
|
||||
delStruct.minSeq = lastMsgPb.Seq + 1
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), msgs.UID, "add to delUidList", "minSeq", lastMsgPb.Seq+1)
|
||||
} else {
|
||||
// 列表没有满且没有不需要被删除的消息 代表他是最新的消息块
|
||||
if !hasMsgDoNotNeedDel {
|
||||
delStruct.minSeq, err = db.DB.ReplaceMsgToBlankByIndex(msgs.UID, len(msgs.Msg)-1)
|
||||
var hasMarkDelFlag bool
|
||||
for index, msg := range msgs.Msg {
|
||||
if msg.SendTime == 0 {
|
||||
continue
|
||||
}
|
||||
msgPb := &server_api_params.MsgData{}
|
||||
err = proto.Unmarshal(msg.Msg, msgPb)
|
||||
if err != nil {
|
||||
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
|
||||
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
|
||||
}
|
||||
return delStruct.getSetMinSeq(), nil
|
||||
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
|
||||
}
|
||||
|
||||
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 {
|
||||
var seqRedis uint64
|
||||
var err error
|
||||
|
@ -3,100 +3,224 @@ package cronTask
|
||||
import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"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"
|
||||
"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"
|
||||
"time"
|
||||
)
|
||||
|
||||
func getMsgListFake(num int) []*pbMsg.MsgDataToMQ {
|
||||
var msgList []*pbMsg.MsgDataToMQ
|
||||
for i := 1; i < num; i++ {
|
||||
msgList = append(msgList, &pbMsg.MsgDataToMQ{
|
||||
Token: "tk",
|
||||
OperationID: "operationID",
|
||||
MsgData: &server_api_params.MsgData{
|
||||
SendID: "sendID1",
|
||||
RecvID: "recvID1",
|
||||
GroupID: "",
|
||||
ClientMsgID: "xxx",
|
||||
ServerMsgID: "xxx",
|
||||
SenderPlatformID: 1,
|
||||
SenderNickname: "testNickName",
|
||||
SenderFaceURL: "testFaceURL",
|
||||
SessionType: 1,
|
||||
MsgFrom: 100,
|
||||
ContentType: 101,
|
||||
Content: []byte("testFaceURL"),
|
||||
Seq: uint32(i),
|
||||
SendTime: time.Now().Unix(),
|
||||
CreateTime: time.Now().Unix(),
|
||||
Status: 1,
|
||||
},
|
||||
})
|
||||
var (
|
||||
redisClient *redis.Client
|
||||
mongoClient *mongo.Collection
|
||||
)
|
||||
|
||||
func GenUserChat(startSeq, stopSeq, delSeq, index uint32, userID string) *db.UserChat {
|
||||
chat := &db.UserChat{UID: userID + ":" + strconv.Itoa(int(index))}
|
||||
for i := startSeq; i <= stopSeq; i++ {
|
||||
msg := server_api_params.MsgData{
|
||||
SendID: "sendID1",
|
||||
RecvID: "recvID1",
|
||||
GroupID: "",
|
||||
ClientMsgID: "xxx",
|
||||
ServerMsgID: "xxx",
|
||||
SenderPlatformID: 1,
|
||||
SenderNickname: "testNickName",
|
||||
SenderFaceURL: "testFaceURL",
|
||||
SessionType: 1,
|
||||
MsgFrom: 100,
|
||||
ContentType: 101,
|
||||
Content: []byte("testFaceURL"),
|
||||
Seq: uint32(i),
|
||||
SendTime: time.Now().Unix(),
|
||||
CreateTime: time.Now().Unix(),
|
||||
Status: 1,
|
||||
}
|
||||
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 msgList
|
||||
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) {
|
||||
|
||||
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"
|
||||
//testUID2 := "test_del_id2"
|
||||
//testUID3 := "test_del_id3"
|
||||
//testUID4 := "test_del_id4"
|
||||
//testUID5 := "test_del_id5"
|
||||
//testUID6 := "test_del_id6"
|
||||
testUserIDList := []string{testUID1}
|
||||
|
||||
err := db.DB.SetUserMaxSeq(testUID1, 500)
|
||||
err = db.DB.BatchInsertChat2DB(testUID1, getMsgListFake(500), testUID1+"-"+operationID, 500)
|
||||
err = DelChat(testUID1, 0)
|
||||
err = SetUserMaxSeq(testUID1, 600)
|
||||
userChat := GenUserChat(1, 600, 200, 0, testUID1)
|
||||
err = CreateChat(userChat)
|
||||
if err := DeleteMongoMsgAndResetRedisSeq(operationID, testUID1); err != nil {
|
||||
t.Error("checkMaxSeqWithMongo failed", testUID1)
|
||||
}
|
||||
if err := checkMaxSeqWithMongo(operationID, testUID1, constant.WriteDiffusion); err != nil {
|
||||
t.Error("checkMaxSeqWithMongo failed", testUID1)
|
||||
}
|
||||
minSeq, err := GetUserMinSeq(testUID1)
|
||||
if err != nil {
|
||||
t.Error(err.Error(), testUID1)
|
||||
t.Error("err is not nil", testUID1, err.Error())
|
||||
}
|
||||
//db.DB.SetUserMaxSeq(testUID1, 6000)
|
||||
//db.DB.BatchInsertChat2DB()
|
||||
//
|
||||
//db.DB.SetUserMaxSeq(testUID1, 4999)
|
||||
//db.DB.BatchInsertChat2DB()
|
||||
//
|
||||
//db.DB.SetUserMaxSeq(testUID1, 30000)
|
||||
//db.DB.BatchInsertChat2DB()
|
||||
//
|
||||
//db.DB.SetUserMaxSeq(testUID1, 9999)
|
||||
//db.DB.BatchInsertChat2DB()
|
||||
cmd := exec.Command("/bin/bash", "unset $CONFIG_NAME")
|
||||
_, err = cmd.StdoutPipe()
|
||||
if minSeq != 201 {
|
||||
t.Error("test1 is not the same", "minSeq:", minSeq, "targetSeq", 201)
|
||||
}
|
||||
|
||||
testUID2 := "test_del_id2"
|
||||
err = DelChat(testUID2, 0)
|
||||
err = DelChat(testUID2, 1)
|
||||
err = SetUserMaxSeq(testUID2, 7000)
|
||||
userChat = GenUserChat(1, 4999, 5000, 0, testUID2)
|
||||
userChat2 := GenUserChat(5000, 7000, 6000, 1, testUID2)
|
||||
err = CreateChat(userChat)
|
||||
err = CreateChat(userChat2)
|
||||
|
||||
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 {
|
||||
return
|
||||
t.Error("err is not nil", testUID2, err.Error())
|
||||
}
|
||||
if minSeq != 6001 {
|
||||
t.Error("test2 is not the same", "minSeq:", minSeq, "targetSeq", 6001)
|
||||
}
|
||||
|
||||
//执行命令
|
||||
if err := cmd.Start(); err != nil {
|
||||
return
|
||||
testUID3 := "test_del_id3"
|
||||
err = DelChat(testUID3, 0)
|
||||
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 {
|
||||
operationID = userID + "-" + operationID
|
||||
if err := DeleteMongoMsgAndResetRedisSeq(operationID, userID); err != nil {
|
||||
t.Error("checkMaxSeqWithMongo failed", userID)
|
||||
}
|
||||
if err := checkMaxSeqWithMongo(operationID, userID, constant.WriteDiffusion); err != nil {
|
||||
t.Error("checkMaxSeqWithMongo failed", userID)
|
||||
}
|
||||
if err := checkMaxSeqWithMongo(operationID, testUID3, constant.WriteDiffusion); err != nil {
|
||||
t.Error("checkMaxSeqWithMongo failed", testUID3)
|
||||
}
|
||||
minSeq, err = GetUserMinSeq(testUID3)
|
||||
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"}
|
||||
for _, groupID := range testWorkingGroupIDList {
|
||||
operationID = groupID + "-" + operationID
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), "groupID:", groupID, "userIDList:", testUserIDList)
|
||||
if err := ResetUserGroupMinSeq(operationID, groupID, testUserIDList); err != nil {
|
||||
t.Error("checkMaxSeqWithMongo failed", groupID)
|
||||
}
|
||||
if err := checkMaxSeqWithMongo(operationID, groupID, constant.ReadDiffusion); err != nil {
|
||||
t.Error("checkMaxSeqWithMongo failed", groupID)
|
||||
}
|
||||
testUID4 := "test_del_id4"
|
||||
err = DelChat(testUID4, 0)
|
||||
err = DelChat(testUID4, 1)
|
||||
err = DelChat(testUID4, 2)
|
||||
err = SetUserMaxSeq(testUID4, 12000)
|
||||
userChat = GenUserChat(1, 4999, 5000, 0, testUID4)
|
||||
userChat2 = GenUserChat(5000, 9999, 10000, 1, testUID4)
|
||||
userChat3 := GenUserChat(10000, 12000, 11000, 2, testUID4)
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,9 @@ import (
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/utils"
|
||||
"fmt"
|
||||
"github.com/robfig/cron/v3"
|
||||
"time"
|
||||
|
||||
"github.com/robfig/cron/v3"
|
||||
)
|
||||
|
||||
const cronTaskOperationID = "cronTaskOperationID-"
|
||||
@ -57,6 +58,7 @@ func ClearAll() {
|
||||
} else {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error())
|
||||
}
|
||||
|
||||
// working group msg clear
|
||||
workingGroupIDList, err := im_mysql_model.GetGroupIDListByGroupType(constant.WorkingGroup)
|
||||
if err == nil {
|
||||
@ -77,9 +79,6 @@ func StartClearMsg(operationID string, userIDList []string) {
|
||||
if err := checkMaxSeqWithMongo(operationID, userID, constant.WriteDiffusion); err != nil {
|
||||
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 {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
package main
|
||||
|
||||
//
|
||||
//func main() {
|
||||
// db.DB.BatchInsertChat()
|
||||
//}
|
@ -186,8 +186,10 @@ func (ws *WServer) pullMsgBySeqListResp(conn *UserConn, m *Req, pb *sdk_ws.PullM
|
||||
}
|
||||
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))
|
||||
|
||||
rpcReq := push.DelUserPushTokenReq{}
|
||||
rpcReq.UserID = m.SendID
|
||||
rpcReq.PlatformID = conn.PlatformID
|
||||
rpcReq.OperationID = m.OperationID
|
||||
grpcConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName, m.OperationID)
|
||||
if grpcConn == nil {
|
||||
|
@ -225,6 +225,54 @@ func (r *RPCServer) SuperGroupOnlineBatchPushOneMsg(_ context.Context, req *pbRe
|
||||
SinglePushResult: singleUserResult,
|
||||
}, 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) {
|
||||
log.NewInfo(req.OperationID, "BatchPushMsgToUser is arriving", req.String())
|
||||
var singleUserResult []*pbRelay.SingelMsgToUserResultList
|
||||
@ -328,7 +376,7 @@ func (r *RPCServer) KickUserOffline(_ context.Context, req *pbRelay.KickUserOffl
|
||||
oldConnMap := ws.getUserAllCons(v)
|
||||
if conn, ok := oldConnMap[int(req.PlatformID)]; ok { // user->map[platform->conn]
|
||||
log.NewWarn(req.OperationID, "send kick msg, close connection ", req.PlatformID, v)
|
||||
ws.sendKickMsg(conn)
|
||||
ws.sendKickMsg(conn, req.OperationID)
|
||||
conn.Close()
|
||||
}
|
||||
}
|
||||
|
@ -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 oldConn, ok := oldConnMap[platformID]; ok {
|
||||
log.NewDebug(operationID, uid, platformID, "kick old conn")
|
||||
ws.sendKickMsg(oldConn)
|
||||
ws.sendKickMsg(oldConn, operationID)
|
||||
m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID))
|
||||
if err != nil && err != go_redis.Nil {
|
||||
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:
|
||||
}
|
||||
}
|
||||
func (ws *WServer) sendKickMsg(oldConn *UserConn) {
|
||||
func (ws *WServer) sendKickMsg(oldConn *UserConn, operationID string) {
|
||||
mReply := Resp{
|
||||
ReqIdentifier: constant.WSKickOnlineMsg,
|
||||
ErrCode: constant.ErrTokenInvalid.ErrCode,
|
||||
ErrMsg: constant.ErrTokenInvalid.ErrMsg,
|
||||
OperationID: operationID,
|
||||
}
|
||||
var b bytes.Buffer
|
||||
enc := gob.NewEncoder(&b)
|
||||
@ -388,7 +389,10 @@ func (ws *WServer) delUserConn(conn *UserConn) {
|
||||
if err != nil {
|
||||
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 {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp)
|
||||
}
|
||||
@ -419,19 +423,19 @@ func (ws *WServer) getUserAllCons(uid string) map[int]*UserConn {
|
||||
return nil
|
||||
}
|
||||
|
||||
//func (ws *WServer) getUserUid(conn *UserConn) (uid string, platform int) {
|
||||
// rwLock.RLock()
|
||||
// defer rwLock.RUnlock()
|
||||
// func (ws *WServer) getUserUid(conn *UserConn) (uid string, platform int) {
|
||||
// rwLock.RLock()
|
||||
// defer rwLock.RUnlock()
|
||||
//
|
||||
// if stringMap, ok := ws.wsConnToUser[conn]; ok {
|
||||
// for k, v := range stringMap {
|
||||
// platform = k
|
||||
// uid = v
|
||||
// if stringMap, ok := ws.wsConnToUser[conn]; ok {
|
||||
// for k, v := range stringMap {
|
||||
// platform = k
|
||||
// uid = v
|
||||
// }
|
||||
// return uid, platform
|
||||
// }
|
||||
// return uid, platform
|
||||
// return "", 0
|
||||
// }
|
||||
// return "", 0
|
||||
//}
|
||||
func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request, operationID string) (isPass, compression bool) {
|
||||
status := http.StatusUnauthorized
|
||||
query := r.URL.Query()
|
||||
|
@ -22,7 +22,9 @@ var (
|
||||
persistentCH PersistentConsumerHandler
|
||||
historyCH OnlineHistoryRedisConsumerHandler
|
||||
historyMongoCH OnlineHistoryMongoConsumerHandler
|
||||
modifyCH ModifyMsgConsumerHandler
|
||||
producer *kafka.Producer
|
||||
producerToModify *kafka.Producer
|
||||
producerToMongo *kafka.Producer
|
||||
cmdCh chan Cmd2Value
|
||||
onlineTopicStatus int
|
||||
@ -43,11 +45,13 @@ func Init() {
|
||||
persistentCH.Init() // ws2mschat save mysql
|
||||
historyCH.Init(cmdCh) //
|
||||
historyMongoCH.Init()
|
||||
modifyCH.Init()
|
||||
onlineTopicStatus = OnlineTopicVacancy
|
||||
//offlineHistoryCH.Init(cmdCh)
|
||||
statistics.NewStatistics(&singleMsgSuccessCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second singleMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)
|
||||
statistics.NewStatistics(&groupMsgCount, config.Config.ModuleName.MsgTransferName, fmt.Sprintf("%d second groupMsgCount insert to mongo", constant.StatisticsTimeInterval), constant.StatisticsTimeInterval)
|
||||
producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic)
|
||||
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)
|
||||
}
|
||||
func Run(promethuesPort int) {
|
||||
@ -59,6 +63,7 @@ func Run(promethuesPort int) {
|
||||
}
|
||||
go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH)
|
||||
go historyMongoCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyMongoCH)
|
||||
go modifyCH.modifyMsgConsumerGroup.RegisterHandleAndConsumer(&modifyCH)
|
||||
//go offlineHistoryCH.historyConsumerGroup.RegisterHandleAndConsumer(&offlineHistoryCH)
|
||||
go func() {
|
||||
err := promePkg.StartPromeSrv(promethuesPort)
|
||||
|
121
internal/msg_transfer/logic/modify_msg_handler.go
Normal file
121
internal/msg_transfer/logic/modify_msg_handler.go
Normal 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
|
||||
}
|
@ -72,6 +72,7 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) {
|
||||
storageMsgList := 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))
|
||||
var modifyMsgList []*pbMsg.MsgDataToMQ
|
||||
for _, v := range msgList {
|
||||
log.Debug(triggerID, "msg come to storage center", v.String())
|
||||
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) {
|
||||
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 {
|
||||
//case constant.SingleChatType:
|
||||
//case constant.GroupChatType:
|
||||
@ -107,6 +112,7 @@ func (och *OnlineHistoryRedisConsumerHandler) Run(channelID int) {
|
||||
singleMsgSuccessCount += uint64(len(storageMsgList))
|
||||
singleMsgSuccessCountMutex.Unlock()
|
||||
och.SendMessageToMongoCH(msgChannelValue.aggregationID, triggerID, storageMsgList, lastSeq)
|
||||
|
||||
for _, v := range storageMsgList {
|
||||
sendMessageToPushMQ(v, msgChannelValue.aggregationID)
|
||||
}
|
||||
@ -552,6 +558,17 @@ func sendMessageToPushMQ(message *pbMsg.MsgDataToMQ, pushToUserID string) {
|
||||
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.
|
||||
//
|
||||
// crc32 returns a uint32, but for our use we need
|
||||
|
@ -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 {
|
||||
log.NewError(v.OperationID, utils.GetSelfFuncName(), "DelMsgBySeqList args: ", DeleteMessageTips.UserID, DeleteMessageTips.SeqList, v.OperationID, err.Error(), unexistSeqList)
|
||||
}
|
||||
//if v.MsgData.ContentType == ? {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,10 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
PushURL = "/push/single/alias"
|
||||
AuthURL = "/auth"
|
||||
PushURL = "/push/single/alias"
|
||||
AuthURL = "/auth"
|
||||
TaskURL = "/push/list/message"
|
||||
BatchPushURL = "/push/list/alias"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -53,23 +55,42 @@ type AuthResp struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type TaskResp struct {
|
||||
TaskID string `json:"taskID"`
|
||||
}
|
||||
|
||||
type Settings struct {
|
||||
TTL *int64 `json:"ttl"`
|
||||
}
|
||||
|
||||
type Audience struct {
|
||||
Alias []string `json:"alias"`
|
||||
}
|
||||
|
||||
type PushMessage struct {
|
||||
Notification *Notification `json:"notification,omitempty"`
|
||||
Transmission *string `json:"transmission,omitempty"`
|
||||
}
|
||||
|
||||
type PushChannel struct {
|
||||
Ios *Ios `json:"ios"`
|
||||
Android *Android `json:"android"`
|
||||
}
|
||||
|
||||
type PushReq struct {
|
||||
RequestID string `json:"request_id"`
|
||||
Audience struct {
|
||||
Alias []string `json:"alias"`
|
||||
} `json:"audience"`
|
||||
PushMessage struct {
|
||||
Notification Notification `json:"notification,omitempty"`
|
||||
Transmission string `json:"transmission,omitempty"`
|
||||
} `json:"push_message"`
|
||||
PushChannel struct {
|
||||
Ios Ios `json:"ios"`
|
||||
Android Android `json:"android"`
|
||||
} `json:"push_channel"`
|
||||
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 {
|
||||
Aps struct {
|
||||
NotiType *string `json:"type"`
|
||||
AutoBadge *string `json:"auto_badge"`
|
||||
Aps struct {
|
||||
Sound string `json:"sound"`
|
||||
Alert Alert `json:"alert"`
|
||||
} `json:"aps"`
|
||||
@ -119,9 +140,9 @@ func newGetuiClient() *Getui {
|
||||
|
||||
func (g *Getui) Push(userIDList []string, title, detailContent, operationID string, opts push.PushOpts) (resp string, err error) {
|
||||
token, err := db.DB.GetGetuiToken()
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), "token:", token)
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), "token:", token, userIDList)
|
||||
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 {
|
||||
token, err = g.getTokenAndSave2Redis(operationID)
|
||||
@ -130,47 +151,32 @@ func (g *Getui) Push(userIDList []string, title, detailContent, operationID stri
|
||||
return "", utils.Wrap(err, "")
|
||||
}
|
||||
}
|
||||
pushReq := PushReq{
|
||||
RequestID: utils.OperationIDGenerator(),
|
||||
Audience: struct {
|
||||
Alias []string `json:"alias"`
|
||||
}{Alias: []string{userIDList[0]}},
|
||||
}
|
||||
pushReq.PushMessage.Notification = Notification{
|
||||
|
||||
pushReq := PushReq{PushMessage: &PushMessage{Notification: &Notification{
|
||||
Title: title,
|
||||
Body: detailContent,
|
||||
ClickType: "startapp",
|
||||
ChannelID: config.Config.Push.Getui.ChannelID,
|
||||
ChannelName: config.Config.Push.Getui.ChannelName,
|
||||
}
|
||||
pushReq.PushChannel.Ios.Aps.Sound = "default"
|
||||
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,
|
||||
},
|
||||
}
|
||||
}}}
|
||||
pushReq.setPushChannel(title, detailContent)
|
||||
pushResp := PushResp{}
|
||||
err = g.request(PushURL, pushReq, token, &pushResp, operationID)
|
||||
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)
|
||||
}
|
||||
switch err {
|
||||
case TokenExpireError:
|
||||
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
|
||||
}
|
||||
|
||||
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 {
|
||||
con, err := json.Marshal(content)
|
||||
if err != nil {
|
||||
@ -245,6 +262,41 @@ func (g *Getui) request(url string, content interface{}, token string, returnStr
|
||||
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 = ¬ify
|
||||
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) {
|
||||
token, expireTime, err := g.Auth(operationID, time.Now().UnixNano()/1e6)
|
||||
if err != nil {
|
||||
@ -257,3 +309,17 @@ func (g *Getui) getTokenAndSave2Redis(operationID string) (token string, err err
|
||||
}
|
||||
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
|
||||
}
|
||||
|
@ -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) {
|
||||
log.Debug(req.OperationID, utils.GetSelfFuncName(), "req", req.String())
|
||||
var resp pbPush.DelUserPushTokenResp
|
||||
err := db.DB.DelFcmToken(req.UserID, int(req.PlatformID))
|
||||
if err != nil {
|
||||
errMsg := req.OperationID + " " + "SetFcmToken failed " + err.Error()
|
||||
errMsg := req.OperationID + " " + "DelFcmToken failed " + err.Error()
|
||||
log.NewError(req.OperationID, errMsg)
|
||||
resp.ErrCode = 500
|
||||
resp.ErrMsg = errMsg
|
||||
|
@ -210,11 +210,25 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
||||
successCount++
|
||||
if isOfflinePush {
|
||||
var onlineSuccessUserIDList []string
|
||||
var WebAndPcBackgroundUserIDList []string
|
||||
onlineSuccessUserIDList = append(onlineSuccessUserIDList, pushMsg.MsgData.SendID)
|
||||
for _, v := range wsResult {
|
||||
if v.OnlinePush && v.UserID != pushMsg.MsgData.SendID {
|
||||
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)
|
||||
//Use offline push messaging
|
||||
@ -240,7 +254,17 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
||||
} else {
|
||||
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 {
|
||||
return
|
||||
}
|
||||
@ -248,7 +272,7 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
||||
if err != nil {
|
||||
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 == "" {
|
||||
switch pushMsg.MsgData.ContentType {
|
||||
case constant.Text:
|
||||
@ -285,6 +309,22 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
||||
promePkg.PromeInc(promePkg.MsgOfflinePushSuccessCounter)
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package push
|
||||
|
||||
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 {
|
||||
Push(userIDList []string, title, detailContent, operationID string, opts PushOpts) (resp string, err error)
|
||||
|
@ -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}
|
||||
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})
|
||||
case constant.FieldGroupAtType:
|
||||
|
@ -10,6 +10,8 @@ import (
|
||||
pbGroup "Open_IM/pkg/proto/group"
|
||||
"Open_IM/pkg/utils"
|
||||
http2 "net/http"
|
||||
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
)
|
||||
|
||||
func callbackBeforeCreateGroup(req *pbGroup.CreateGroupReq) cbApi.CommonCallbackResp {
|
||||
@ -126,3 +128,56 @@ func CallbackBeforeMemberJoinGroup(operationID string, groupMember *db.GroupMemb
|
||||
}
|
||||
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
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import (
|
||||
grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@ -364,6 +365,14 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
var resp pbGroup.InviteUserToGroupResp
|
||||
joinReq := pbGroup.JoinGroupReq{}
|
||||
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
|
||||
groupRequest.UserID = v
|
||||
groupRequest.GroupID = req.GroupID
|
||||
@ -451,8 +460,19 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
resp.Id2ResultList = append(resp.Id2ResultList, &resultNode)
|
||||
}
|
||||
} else {
|
||||
okUserIDList = req.InvitedUserIDList
|
||||
if err := db.DB.AddUserToSuperGroup(req.GroupID, req.InvitedUserIDList); err != nil {
|
||||
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
|
||||
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)
|
||||
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
|
||||
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 {
|
||||
@ -756,7 +803,15 @@ func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetG
|
||||
var resp pbGroup.GetGroupMembersInfoResp
|
||||
resp.MemberList = []*open_im_sdk.GroupMemberFullInfo{}
|
||||
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 {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, userID, err.Error())
|
||||
continue
|
||||
@ -861,6 +916,10 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G
|
||||
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
|
||||
}
|
||||
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.GroupID = req.GroupID
|
||||
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) {
|
||||
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)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OpUserID)
|
||||
return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
||||
}
|
||||
|
||||
groupInfo, err := rocksCache.GetGroupInfoFromCache(req.GroupID)
|
||||
if err != nil {
|
||||
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{}})
|
||||
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 != "" {
|
||||
//get group member user id
|
||||
@ -1765,11 +1828,35 @@ func (s *groupServer) SetGroupMemberNickname(ctx context.Context, req *pbGroup.S
|
||||
log.Error(req.OperationID, errMsg)
|
||||
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.UserID = req.UserID
|
||||
groupMemberInfo.GroupID = req.GroupID
|
||||
if req.Nickname == "" {
|
||||
if nickName == "" {
|
||||
userNickname, err := imdb.GetUserNameByUserID(groupMemberInfo.UserID)
|
||||
if err != nil {
|
||||
errMsg := req.OperationID + " GetUserNameByUserID failed " + err.Error()
|
||||
@ -1778,7 +1865,7 @@ func (s *groupServer) SetGroupMemberNickname(ctx context.Context, req *pbGroup.S
|
||||
}
|
||||
groupMemberInfo.Nickname = userNickname
|
||||
} else {
|
||||
groupMemberInfo.Nickname = req.Nickname
|
||||
groupMemberInfo.Nickname = nickName
|
||||
}
|
||||
|
||||
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()
|
||||
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{
|
||||
GroupID: req.GroupID,
|
||||
UserID: req.UserID,
|
||||
@ -1913,3 +2017,53 @@ func (s *groupServer) DelGroupAndUserCache(operationID, groupID string, userIDLi
|
||||
}
|
||||
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
|
||||
}
|
||||
|
@ -221,9 +221,3 @@ func callbackMsgModify(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
|
||||
log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content))
|
||||
return callbackResp
|
||||
}
|
||||
|
||||
func CallbackBeforeExtendMsgModify() cbApi.CommonCallbackResp {
|
||||
callbackResp := cbApi.CommonCallbackResp{OperationID: ""}
|
||||
|
||||
return callbackResp
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
commonPb "Open_IM/pkg/proto/sdk_ws"
|
||||
"Open_IM/pkg/proto/msg"
|
||||
commonPb "Open_IM/pkg/proto/sdk_ws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"time"
|
||||
@ -39,14 +39,14 @@ func (rpc *rpcChat) DelSuperGroupMsg(_ context.Context, req *msg.DelSuperGroupMs
|
||||
resp := &msg.DelSuperGroupMsgResp{}
|
||||
groupMaxSeq, err := db.DB.GetGroupMaxSeq(req.GroupID)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, "GetGroupMaxSeq false ", req.OpUserID, req.UserID,req.GroupID)
|
||||
log.NewError(req.OperationID, "GetGroupMaxSeq false ", req.OpUserID, req.UserID, req.GroupID)
|
||||
resp.ErrCode = constant.ErrDB.ErrCode
|
||||
resp.ErrMsg = err.Error()
|
||||
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 {
|
||||
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.ErrMsg = err.Error()
|
||||
return resp, nil
|
||||
|
@ -1 +1,477 @@
|
||||
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
|
||||
}
|
||||
|
131
internal/rpc/msg/extend_msg.notification.go
Normal file
131
internal/rpc/msg/extend_msg.notification.go
Normal 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)
|
||||
}
|
||||
|
||||
}
|
104
internal/rpc/msg/extend_msg_callback.go
Normal file
104
internal/rpc/msg/extend_msg_callback.go
Normal 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
|
||||
|
||||
}
|
@ -245,12 +245,15 @@ func GroupCreatedNotification(operationID, opUserID, groupID string, initMemberL
|
||||
// notification := ""
|
||||
// introduction := ""
|
||||
// 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{}}
|
||||
if err := setGroupInfo(groupID, GroupInfoChangedTips.Group); err != nil {
|
||||
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||
return
|
||||
}
|
||||
GroupInfoChangedTips.Group.NeedVerification = 0
|
||||
GroupInfoChangedTips.Group.LookMemberInfo = 0
|
||||
GroupInfoChangedTips.Group.ApplyMemberFriend = 0
|
||||
GroupInfoChangedTips.Group.GroupName = groupName
|
||||
GroupInfoChangedTips.Group.Notification = notification
|
||||
GroupInfoChangedTips.Group.Introduction = introduction
|
||||
@ -258,6 +261,12 @@ func GroupInfoSetNotification(operationID, opUserID, groupID string, groupName,
|
||||
if needVerification != nil {
|
||||
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 {
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -449,6 +471,18 @@ func GroupApplicationRejectedNotification(req *pbGroup.GroupApplicationResponseR
|
||||
return
|
||||
}
|
||||
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) {
|
||||
|
52
internal/rpc/msg/lock.go
Normal file
52
internal/rpc/msg/lock.go
Normal 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)
|
||||
}
|
@ -31,7 +31,8 @@ type rpcChat struct {
|
||||
etcdAddr []string
|
||||
messageWriter MessageWriter
|
||||
//offlineProducer *kafka.Producer
|
||||
delMsgCh chan deleteMsg
|
||||
delMsgCh chan deleteMsg
|
||||
dMessageLocker MessageLocker
|
||||
}
|
||||
|
||||
type deleteMsg struct {
|
||||
@ -48,6 +49,7 @@ func NewRpcChatServer(port int) *rpcChat {
|
||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImMsgName,
|
||||
etcdSchema: config.Config.Etcd.EtcdSchema,
|
||||
etcdAddr: config.Config.Etcd.EtcdAddr,
|
||||
dMessageLocker: NewLockerMessage(),
|
||||
}
|
||||
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)
|
||||
@ -143,14 +145,9 @@ func (rpc *rpcChat) runCh() {
|
||||
select {
|
||||
case msg := <-rpc.delMsgCh:
|
||||
log.NewInfo(msg.OperationID, utils.GetSelfFuncName(), "delmsgch recv new: ", msg)
|
||||
db.DB.DelMsgFromCache(msg.UserID, msg.SeqList, msg.OperationID)
|
||||
unexistSeqList, err := db.DB.DelMsgBySeqList(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)
|
||||
if len(msg.SeqList) > 0 {
|
||||
db.DB.DelMsgFromCache(msg.UserID, msg.SeqList, msg.OperationID)
|
||||
DeleteMessageNotification(msg.OpUserID, msg.UserID, msg.SeqList, msg.OperationID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import (
|
||||
"time"
|
||||
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
|
||||
go_redis "github.com/go-redis/redis/v8"
|
||||
"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) {
|
||||
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
|
||||
}
|
||||
log.NewDebug(data.OperationID, *config.Config.MessageVerify.FriendVerify)
|
||||
|
@ -163,6 +163,22 @@ func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.Batc
|
||||
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)
|
||||
if err != nil {
|
||||
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 {
|
||||
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)
|
||||
if err != nil {
|
||||
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}
|
||||
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
|
||||
if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil {
|
||||
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":
|
||||
conversation.GroupID = stringList[1]
|
||||
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)
|
||||
@ -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}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
if isUpdate {
|
||||
err = rocksCache.DelConversationFromCache(conversation.OwnerUserID, conversation.ConversationID)
|
||||
} else {
|
||||
|
@ -29,6 +29,7 @@ type GetGroupMembersInfoReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
MemberList []string `json:"memberList" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
NoCache bool `json:"noCache"`
|
||||
}
|
||||
type GetGroupMembersInfoResp struct {
|
||||
CommResp
|
||||
|
@ -1,5 +1,10 @@
|
||||
package base_info
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/proto/msg"
|
||||
sdk_ws "Open_IM/pkg/proto/sdk_ws"
|
||||
)
|
||||
|
||||
type DelMsgReq struct {
|
||||
UserID string `json:"userID,omitempty" binding:"required"`
|
||||
SeqList []uint32 `json:"seqList,omitempty" binding:"required"`
|
||||
@ -18,6 +23,7 @@ type CleanUpMsgReq struct {
|
||||
type CleanUpMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type DelSuperGroupMsgReq struct {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
@ -29,23 +35,109 @@ type DelSuperGroupMsgReq struct {
|
||||
type DelSuperGroupMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type MsgDeleteNotificationElem struct {
|
||||
GroupID string `json:"groupID"`
|
||||
IsAllDelete bool `json:"isAllDelete"`
|
||||
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 {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
GroupID string `json:"groupID"`
|
||||
MinSeq uint32 `json:"minSeq" binding:"required"`
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
|
||||
type SetMsgMinSeqResp struct {
|
||||
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"`
|
||||
}
|
||||
|
@ -46,3 +46,22 @@ type CallbackBeforeMemberJoinGroupResp struct {
|
||||
MuteEndTime *int64 `json:"muteEndTime"`
|
||||
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"`
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
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 {
|
||||
CommonCallbackReq
|
||||
@ -63,3 +66,68 @@ type CallbackMsgModifyCommandResp struct {
|
||||
AttachedInfo *string `json:"attachedInfo"`
|
||||
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"`
|
||||
}
|
||||
|
@ -248,11 +248,16 @@ type config struct {
|
||||
Addr []string `yaml:"addr"`
|
||||
Topic string `yaml:"topic"`
|
||||
}
|
||||
MsgToModify struct {
|
||||
Addr []string `yaml:"addr"`
|
||||
Topic string `yaml:"topic"`
|
||||
}
|
||||
ConsumerGroupID struct {
|
||||
MsgToRedis string `yaml:"msgToTransfer"`
|
||||
MsgToMongo string `yaml:"msgToMongo"`
|
||||
MsgToMySql string `yaml:"msgToMySql"`
|
||||
MsgToPush string `yaml:"msgToPush"`
|
||||
MsgToRedis string `yaml:"msgToTransfer"`
|
||||
MsgToMongo string `yaml:"msgToMongo"`
|
||||
MsgToMySql string `yaml:"msgToMySql"`
|
||||
MsgToPush string `yaml:"msgToPush"`
|
||||
MsgToModify string `yaml:"msgToModify"`
|
||||
}
|
||||
}
|
||||
Secret string `yaml:"secret"`
|
||||
@ -292,7 +297,7 @@ type config struct {
|
||||
CallbackBeforeAddFriend callBackConfig `yaml:"callbackBeforeAddFriend"`
|
||||
CallbackBeforeCreateGroup callBackConfig `yaml:"callbackBeforeCreateGroup"`
|
||||
CallbackBeforeMemberJoinGroup callBackConfig `yaml:"callbackBeforeMemberJoinGroup"`
|
||||
CallbackBeforeExtendMsgModify callBackConfig `yaml:"callbackBeforeExtendMsgModify"`
|
||||
CallbackBeforeSetGroupMemberInfo callBackConfig `yaml:"callbackBeforeSetGroupMemberInfo"`
|
||||
} `yaml:"callback"`
|
||||
Notification struct {
|
||||
///////////////////////group/////////////////////////////
|
||||
@ -648,7 +653,7 @@ func unmarshalConfig(config interface{}, configName string) {
|
||||
} else {
|
||||
bytes, err := ioutil.ReadFile(fmt.Sprintf("../config/%s", configName))
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
panic(err.Error() + configName)
|
||||
}
|
||||
if err = yaml.Unmarshal(bytes, config); err != nil {
|
||||
panic(err.Error())
|
||||
|
@ -48,6 +48,8 @@ const (
|
||||
AdvancedRevoke = 118 //影响前者消息
|
||||
CustomNotTriggerConversation = 119
|
||||
CustomOnlineOnly = 120
|
||||
ReactionMessageModifier = 121
|
||||
ReactionMessageDeleter = 122
|
||||
|
||||
Common = 200
|
||||
GroupMsg = 201
|
||||
@ -169,6 +171,7 @@ const (
|
||||
IsNotPrivate = "notPrivate"
|
||||
IsSenderConversationUpdate = "senderConversationUpdate"
|
||||
IsSenderNotificationPush = "senderNotificationPush"
|
||||
IsReactionFromCache = "reactionFromCache"
|
||||
|
||||
//GroupStatus
|
||||
GroupOk = 0
|
||||
@ -202,20 +205,28 @@ const (
|
||||
VerificationCodeForResetSuffix = "_forReset"
|
||||
|
||||
//callbackCommand
|
||||
CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand"
|
||||
CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand"
|
||||
CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand"
|
||||
CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand"
|
||||
CallbackMsgModifyCommand = "callbackMsgModifyCommand"
|
||||
CallbackUserOnlineCommand = "callbackUserOnlineCommand"
|
||||
CallbackUserOfflineCommand = "callbackUserOfflineCommand"
|
||||
CallbackUserKickOffCommand = "callbackUserKickOffCommand"
|
||||
CallbackOfflinePushCommand = "callbackOfflinePushCommand"
|
||||
CallbackOnlinePushCommand = "callbackOnlinePushCommand"
|
||||
CallbackSuperGroupOnlinePushCommand = "callbackSuperGroupOnlinePushCommand"
|
||||
CallbackBeforeAddFriendCommand = "callbackBeforeAddFriendCommand"
|
||||
CallbackBeforeCreateGroupCommand = "callbackBeforeCreateGroupCommand"
|
||||
CallbackBeforeMemberJoinGroupCommand = "callbackBeforeMemberJoinGroupCommand"
|
||||
CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand"
|
||||
CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand"
|
||||
CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand"
|
||||
CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand"
|
||||
CallbackMsgModifyCommand = "callbackMsgModifyCommand"
|
||||
CallbackUserOnlineCommand = "callbackUserOnlineCommand"
|
||||
CallbackUserOfflineCommand = "callbackUserOfflineCommand"
|
||||
CallbackUserKickOffCommand = "callbackUserKickOffCommand"
|
||||
CallbackOfflinePushCommand = "callbackOfflinePushCommand"
|
||||
CallbackOnlinePushCommand = "callbackOnlinePushCommand"
|
||||
CallbackSuperGroupOnlinePushCommand = "callbackSuperGroupOnlinePushCommand"
|
||||
CallbackBeforeAddFriendCommand = "callbackBeforeAddFriendCommand"
|
||||
CallbackBeforeCreateGroupCommand = "callbackBeforeCreateGroupCommand"
|
||||
CallbackBeforeMemberJoinGroupCommand = "callbackBeforeMemberJoinGroupCommand"
|
||||
CallbackBeforeSetGroupMemberInfoCommand = "CallbackBeforeSetGroupMemberInfoCommand"
|
||||
CallbackBeforeSetMessageReactionExtensionCommand = "callbackBeforeSetMessageReactionExtensionCommand"
|
||||
CallbackBeforeDeleteMessageReactionExtensionsCommand = "callbackBeforeDeleteMessageReactionExtensionsCommand"
|
||||
CallbackGetMessageListReactionExtensionsCommand = "callbackGetMessageListReactionExtensionsCommand"
|
||||
CallbackAddMessageListReactionExtensionsCommand = "callbackAddMessageListReactionExtensionsCommand"
|
||||
|
||||
SetMessageExtensions = 1
|
||||
AddMessageExtensions = 2
|
||||
|
||||
//callback actionCode
|
||||
ActionAllow = 0
|
||||
|
@ -57,7 +57,7 @@ var PlatformName2ID = map[string]int{
|
||||
IPadPlatformStr: IPadPlatformID,
|
||||
AdminPlatformStr: AdminPlatformID,
|
||||
}
|
||||
var Platform2class = map[string]string{
|
||||
var PlatformName2class = map[string]string{
|
||||
IOSPlatformStr: TerminalMobile,
|
||||
AndroidPlatformStr: TerminalMobile,
|
||||
MiniWebPlatformStr: WebPlatformStr,
|
||||
@ -66,6 +66,15 @@ var Platform2class = map[string]string{
|
||||
OSXPlatformStr: 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 {
|
||||
return PlatformID2Name[num]
|
||||
@ -74,5 +83,8 @@ func PlatformNameToID(name string) int {
|
||||
return PlatformName2ID[name]
|
||||
}
|
||||
func PlatformNameToClass(name string) string {
|
||||
return Platform2class[name]
|
||||
return PlatformName2class[name]
|
||||
}
|
||||
func PlatformIDToClass(num int) string {
|
||||
return PlatformID2class[num]
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ const (
|
||||
uidPidToken = "UID_PID_TOKEN_STATUS:"
|
||||
conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:"
|
||||
getuiToken = "GETUI_TOKEN"
|
||||
getuiTaskID = "GETUI_TASK_ID"
|
||||
messageCache = "MESSAGE_CACHE:"
|
||||
SignalCache = "SIGNAL_CACHE:"
|
||||
SignalListCache = "SIGNAL_LIST_CACHE:"
|
||||
@ -38,6 +39,10 @@ const (
|
||||
groupMinSeq = "GROUP_MIN_SEQ:"
|
||||
sendMsgFailedFlag = "SEND_MSG_FAILED_FLAG:"
|
||||
userBadgeUnreadCountSum = "USER_BADGE_UNREAD_COUNT_SUM:"
|
||||
exTypeKeyLocker = "EX_LOCK:"
|
||||
|
||||
//temp
|
||||
superGroupUserNotRecvOfflineMsgOptTemp = "SG_RECV_MSG_OPT_TEMP:"
|
||||
)
|
||||
|
||||
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()
|
||||
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 {
|
||||
key := conversationReceiveMessageOpt + userID
|
||||
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
|
||||
}
|
||||
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())
|
||||
continue
|
||||
}
|
||||
@ -397,6 +419,15 @@ func (d *DataBases) GetGetuiToken() (string, error) {
|
||||
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 {
|
||||
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()
|
||||
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 ""
|
||||
}
|
||||
|
@ -2,46 +2,61 @@ package db
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
)
|
||||
|
||||
const cExtendMsgSet = "extend_msgs"
|
||||
const MaxNum = 100
|
||||
|
||||
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"`
|
||||
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"`
|
||||
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 {
|
||||
UserKey string `bson:"user_key" json:"userKey"`
|
||||
type KeyValue struct {
|
||||
TypeKey string `bson:"type_key" json:"typeKey"`
|
||||
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 {
|
||||
Content map[string]ReactionExtendMsgSet `bson:"content" json:"content"`
|
||||
ClientMsgID string `bson:"client_msg_id" json:"clientMsgID"`
|
||||
CreateTime int32 `bson:"create_time" json:"createTime"`
|
||||
LatestUpdateTime int32 `bson:"latest_update_time" json:"latestUpdateTime"`
|
||||
ReactionExtensionList map[string]KeyValue `bson:"reaction_extension_list" json:"reactionExtensionList"`
|
||||
ClientMsgID string `bson:"client_msg_id" json:"clientMsgID"`
|
||||
MsgFirstModifyTime int64 `bson:"msg_first_modify_time" json:"msgFirstModifyTime"` // this extendMsg create time
|
||||
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))
|
||||
}
|
||||
|
||||
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 {
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||
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
|
||||
}
|
||||
|
||||
type GetExtendMsgSetOpts struct {
|
||||
ExcludeExtendMsgs bool
|
||||
}
|
||||
|
||||
func (d *DataBases) GetExtendMsgSet(ID string, index int32, opts *GetExtendMsgSetOpts) (*ExtendMsgSet, 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 set ExtendMsgSet
|
||||
var findOneOpt *options.FindOneOptions
|
||||
if opts != nil {
|
||||
if opts.ExcludeExtendMsgs {
|
||||
findOneOpt = &options.FindOneOptions{}
|
||||
findOneOpt.SetProjection(bson.M{"extend_msgs": 0})
|
||||
}
|
||||
func (d *DataBases) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64, c *mongo.Collection) (*ExtendMsgSet, error) {
|
||||
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
|
||||
}
|
||||
err := c.FindOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, findOneOpt).Decode(&set)
|
||||
return &set, err
|
||||
result, err := c.Find(ctx, find, findOpts)
|
||||
if err != nil {
|
||||
return nil, utils.Wrap(err, "")
|
||||
}
|
||||
var setList []ExtendMsgSet
|
||||
if err := result.All(ctx, &setList); err != nil {
|
||||
return nil, utils.Wrap(err, "")
|
||||
}
|
||||
if len(setList) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return &setList[0], nil
|
||||
}
|
||||
|
||||
// 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)
|
||||
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}})
|
||||
return err
|
||||
set, err := d.GetExtendMsgSet(ctx, sourceID, sessionType, 0, c)
|
||||
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
|
||||
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)
|
||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
|
||||
reactionExtendMsgSet := ReactionExtendMsgSet{
|
||||
UserKey: userID,
|
||||
Value: value,
|
||||
LatestUpdateTime: int32(utils.GetCurrentTimestampBySecond()),
|
||||
var updateBson = bson.M{}
|
||||
for _, v := range reactionExtensionList {
|
||||
updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = v
|
||||
}
|
||||
upsert := true
|
||||
opt := &options.UpdateOptions{
|
||||
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
|
||||
}
|
||||
|
||||
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)
|
||||
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{}})
|
||||
return err
|
||||
}
|
||||
|
||||
// by index start end
|
||||
func (d *DataBases) GetExtendMsgList(ID string, index int32, clientMsgID string) (extendMsg *ExtendMsg, err error) {
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet)
|
||||
err = c.FindOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index), "extend_msgs": bson.M{}}).Decode(&extendMsg)
|
||||
return extendMsg, err
|
||||
findOpts := options.Find().SetLimit(1).SetSkip(0).SetSort(bson.M{"source_id": -1}).SetProjection(bson.M{fmt.Sprintf("extend_msgs.%s", clientMsgID): 1})
|
||||
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
|
||||
if err := result.All(ctx, &setList); err != nil {
|
||||
return nil, utils.Wrap(err, "")
|
||||
}
|
||||
if len(setList) == 0 {
|
||||
return nil, utils.Wrap(errors.New("GetExtendMsg failed, len(setList) == 0"), "")
|
||||
}
|
||||
if v, ok := setList[0].ExtendMsgs[clientMsgID]; ok {
|
||||
return &v, nil
|
||||
}
|
||||
return nil, errors.New(fmt.Sprintf("cant find client msg id: %s", clientMsgID))
|
||||
}
|
||||
|
@ -46,10 +46,10 @@ func key(dbAddress, dbName string) string {
|
||||
}
|
||||
|
||||
func init() {
|
||||
//log.NewPrivateLog(constant.LogFileName)
|
||||
var mongoClient *mongo.Client
|
||||
var err1 error
|
||||
//mysql init
|
||||
fmt.Println("init mysql redis mongo ")
|
||||
|
||||
initMysqlDB()
|
||||
// mongo init
|
||||
// "mongodb://sysop:moon@localhost/records"
|
||||
@ -84,45 +84,34 @@ func init() {
|
||||
|
||||
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
||||
if err != nil {
|
||||
fmt.Println(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri)
|
||||
time.Sleep(time.Duration(30) * time.Second)
|
||||
mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
||||
if err1 != nil {
|
||||
fmt.Println(" mongo.Connect retry failed, panic", err.Error(), uri)
|
||||
panic(err1.Error())
|
||||
panic(err1.Error() + " mongo.Connect failed " + uri)
|
||||
}
|
||||
}
|
||||
fmt.Println("mongo driver client init success: ", uri)
|
||||
// mongodb create index
|
||||
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())
|
||||
panic(err.Error() + " index create failed " + cSendLog + " send_id, -send_time")
|
||||
}
|
||||
if err := createMongoIndex(mongoClient, cChat, false, "uid"); err != nil {
|
||||
fmt.Println("uid", " index create failed", err.Error())
|
||||
//panic(err.Error())
|
||||
fmt.Println(err.Error() + " index create failed " + cChat + " uid ")
|
||||
}
|
||||
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())
|
||||
panic(err.Error() + "index create failed " + cWorkMoment + " -create_time, work_moment_id")
|
||||
}
|
||||
if err := createMongoIndex(mongoClient, cWorkMoment, true, "work_moment_id"); err != nil {
|
||||
fmt.Println("work_moment_id", "index create failed", err.Error())
|
||||
panic(err.Error())
|
||||
panic(err.Error() + "index create failed " + cWorkMoment + " work_moment_id ")
|
||||
}
|
||||
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())
|
||||
panic(err.Error() + "index create failed " + cWorkMoment + "user_id, -create_time")
|
||||
}
|
||||
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())
|
||||
panic(err.Error() + "index create failed " + cTag + " user_id, -create_time")
|
||||
}
|
||||
if err := createMongoIndex(mongoClient, cTag, true, "tag_id"); err != nil {
|
||||
fmt.Println("tag_id", "index create failed", err.Error())
|
||||
panic(err.Error())
|
||||
panic(err.Error() + "index create failed " + cTag + " tag_id")
|
||||
}
|
||||
fmt.Println("createMongoIndex success")
|
||||
DB.mongoClient = mongoClient
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
@ -136,7 +125,8 @@ func init() {
|
||||
})
|
||||
_, err = DB.RDB.Ping(ctx).Result()
|
||||
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 {
|
||||
DB.RDB = go_redis.NewClient(&go_redis.Options{
|
||||
@ -148,7 +138,7 @@ func init() {
|
||||
})
|
||||
_, err = DB.RDB.Ping(ctx).Result()
|
||||
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生成,适合各种同步的拉取, 如果弱一致可能导致拉取还是老数据,毫无意义
|
||||
@ -158,6 +148,8 @@ func init() {
|
||||
// 弱一致性缓存,当一个key被标记删除,其他请求线程直接返回该key的value,适合高频并且生成很缓存很慢的情况 如大群发消息缓存的缓存
|
||||
DB.WeakRc = rockscache.NewClient(DB.RDB, rockscache.NewDefaultOptions())
|
||||
DB.WeakRc.Options.StrongConsistency = false
|
||||
|
||||
fmt.Println("init mysql redis mongo ok ")
|
||||
}
|
||||
|
||||
func createMongoIndex(client *mongo.Client, collection string, isUnique bool, keys ...string) error {
|
||||
|
@ -10,13 +10,14 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"sync"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"github.com/gogo/protobuf/sortkeys"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
"math/rand"
|
||||
"sync"
|
||||
|
||||
//"github.com/garyburd/redigo/redis"
|
||||
"github.com/golang/protobuf/proto"
|
||||
@ -93,7 +94,7 @@ func (d *DataBases) GetMinSeqFromMongo2(uid string) (MinSeq uint32, err error) {
|
||||
}
|
||||
|
||||
// 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)
|
||||
sortkeys.Uint32s(seqList)
|
||||
suffixUserID2SubSeqList := func(uid string, seqList []uint32) map[string][]uint32 {
|
||||
@ -122,11 +123,11 @@ func (d *DataBases) DelMsgBySeqList(userID string, seqList []uint32, operationID
|
||||
return
|
||||
}
|
||||
lock.Lock()
|
||||
totalUnexistSeqList = append(totalUnexistSeqList, unexistSeqList...)
|
||||
totalUnExistSeqList = append(totalUnExistSeqList, unexistSeqList...)
|
||||
lock.Unlock()
|
||||
}(k, v, operationID)
|
||||
}
|
||||
return totalUnexistSeqList, err
|
||||
return totalUnExistSeqList, err
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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) {
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), uid, seqList)
|
||||
var hasSeqList []uint32
|
||||
|
@ -22,37 +22,26 @@ func (w Writer) Printf(format string, args ...interface{}) {
|
||||
}
|
||||
|
||||
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",
|
||||
config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], "mysql")
|
||||
var db *gorm.DB
|
||||
var err1 error
|
||||
db, err := gorm.Open(mysql.Open(dsn), nil)
|
||||
if err != nil {
|
||||
fmt.Println("Open failed ", err.Error(), dsn)
|
||||
}
|
||||
if err != nil {
|
||||
time.Sleep(time.Duration(30) * time.Second)
|
||||
db, err1 = gorm.Open(mysql.Open(dsn), nil)
|
||||
if err1 != nil {
|
||||
fmt.Println("Open failed ", err1.Error(), dsn)
|
||||
panic(err1.Error())
|
||||
panic(err1.Error() + " open failed " + dsn)
|
||||
}
|
||||
}
|
||||
|
||||
//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)
|
||||
fmt.Println("exec sql: ", sql, " begin")
|
||||
err = db.Exec(sql).Error
|
||||
if err != nil {
|
||||
fmt.Println("Exec failed ", err.Error(), sql)
|
||||
panic(err.Error())
|
||||
panic(err.Error() + " Exec failed " + sql)
|
||||
}
|
||||
fmt.Println("exec sql: ", sql, " end")
|
||||
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)
|
||||
|
||||
newLogger := logger.New(
|
||||
Writer{},
|
||||
logger.Config{
|
||||
@ -66,20 +55,18 @@ func initMysqlDB() {
|
||||
Logger: newLogger,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println("Open failed ", err.Error(), dsn)
|
||||
panic(err.Error())
|
||||
panic(err.Error() + " Open failed " + dsn)
|
||||
}
|
||||
|
||||
sqlDB, err := db.DB()
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
panic(err.Error() + " db.DB() failed ")
|
||||
}
|
||||
|
||||
sqlDB.SetConnMaxLifetime(time.Second * time.Duration(config.Config.Mysql.DBMaxLifeTime))
|
||||
sqlDB.SetMaxOpenConns(config.Config.Mysql.DBMaxOpenConns)
|
||||
sqlDB.SetMaxIdleConns(config.Config.Mysql.DBMaxIdleConns)
|
||||
|
||||
fmt.Println("open mysql ok ", dsn)
|
||||
db.AutoMigrate(
|
||||
&Register{},
|
||||
&Friend{},
|
||||
@ -94,99 +81,69 @@ func initMysqlDB() {
|
||||
db.Set("gorm:table_options", "collation=utf8_unicode_ci")
|
||||
|
||||
if !db.Migrator().HasTable(&Friend{}) {
|
||||
fmt.Println("CreateTable Friend")
|
||||
db.Migrator().CreateTable(&Friend{})
|
||||
}
|
||||
|
||||
if !db.Migrator().HasTable(&FriendRequest{}) {
|
||||
fmt.Println("CreateTable FriendRequest")
|
||||
db.Migrator().CreateTable(&FriendRequest{})
|
||||
}
|
||||
|
||||
if !db.Migrator().HasTable(&Group{}) {
|
||||
fmt.Println("CreateTable Group")
|
||||
db.Migrator().CreateTable(&Group{})
|
||||
}
|
||||
|
||||
if !db.Migrator().HasTable(&GroupMember{}) {
|
||||
fmt.Println("CreateTable GroupMember")
|
||||
db.Migrator().CreateTable(&GroupMember{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&GroupRequest{}) {
|
||||
fmt.Println("CreateTable GroupRequest")
|
||||
db.Migrator().CreateTable(&GroupRequest{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&User{}) {
|
||||
fmt.Println("CreateTable User")
|
||||
db.Migrator().CreateTable(&User{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&Black{}) {
|
||||
fmt.Println("CreateTable Black")
|
||||
db.Migrator().CreateTable(&Black{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&ChatLog{}) {
|
||||
fmt.Println("CreateTable ChatLog")
|
||||
db.Migrator().CreateTable(&ChatLog{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&Register{}) {
|
||||
fmt.Println("CreateTable Register")
|
||||
db.Migrator().CreateTable(&Register{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&Conversation{}) {
|
||||
fmt.Println("CreateTable Conversation")
|
||||
db.Migrator().CreateTable(&Conversation{})
|
||||
}
|
||||
|
||||
if !db.Migrator().HasTable(&Department{}) {
|
||||
fmt.Println("CreateTable Department")
|
||||
db.Migrator().CreateTable(&Department{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&OrganizationUser{}) {
|
||||
fmt.Println("CreateTable OrganizationUser")
|
||||
db.Migrator().CreateTable(&OrganizationUser{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&DepartmentMember{}) {
|
||||
fmt.Println("CreateTable DepartmentMember")
|
||||
db.Migrator().CreateTable(&DepartmentMember{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&AppVersion{}) {
|
||||
fmt.Println("CreateTable DepartmentMember")
|
||||
db.Migrator().CreateTable(&AppVersion{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&BlackList{}) {
|
||||
fmt.Println("CreateTable BlackList")
|
||||
db.Migrator().CreateTable(&BlackList{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&IpLimit{}) {
|
||||
fmt.Println("CreateTable IpLimit")
|
||||
db.Migrator().CreateTable(&IpLimit{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&UserIpLimit{}) {
|
||||
fmt.Println("CreateTable UserIpLimit")
|
||||
db.Migrator().CreateTable(&UserIpLimit{})
|
||||
}
|
||||
|
||||
if !db.Migrator().HasTable(&RegisterAddFriend{}) {
|
||||
fmt.Println("CreateTable RegisterAddFriend")
|
||||
db.Migrator().CreateTable(&RegisterAddFriend{})
|
||||
}
|
||||
if !db.Migrator().HasTable(&Invitation{}) {
|
||||
fmt.Println("CreateTable Invitation")
|
||||
db.Migrator().CreateTable(&Invitation{})
|
||||
}
|
||||
|
||||
if !db.Migrator().HasTable(&ClientInitConfig{}) {
|
||||
fmt.Println("CreateTable ClientInitConfig")
|
||||
db.Migrator().CreateTable(&ClientInitConfig{})
|
||||
}
|
||||
|
||||
if !db.Migrator().HasTable(&UserIpRecord{}) {
|
||||
fmt.Println("CreateTable Friend")
|
||||
db.Migrator().CreateTable(&UserIpRecord{})
|
||||
}
|
||||
|
||||
DB.MysqlDB.db = db
|
||||
return
|
||||
}
|
||||
|
||||
func (m *mysqlDB) DefaultGormDB() *gorm.DB {
|
||||
|
@ -74,6 +74,12 @@ func GetGroupMemberIDListByGroupID(groupID string) ([]string, error) {
|
||||
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) {
|
||||
var groupMemberList []db.GroupMember
|
||||
err := db.DB.MysqlDB.DefaultGormDB().Table("group_members").Where("group_id=? and role_level=?", groupID, roleLevel).Find(&groupMemberList).Error
|
||||
|
@ -44,6 +44,12 @@ func GetGroupInfoByGroupID(groupID string) (*db.Group, error) {
|
||||
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 {
|
||||
return db.DB.MysqlDB.DefaultGormDB().Table("groups").Where("group_id=?", groupInfo.GroupID).Updates(&groupInfo).Error
|
||||
}
|
||||
|
@ -27,7 +27,9 @@ func UpdateGroupRequest(groupRequest 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 {
|
||||
toInsertInfo.HandledTime = utils.UnixSecondToTime(0)
|
||||
}
|
||||
@ -70,7 +72,7 @@ func GetGroupRequestByGroupID(groupID string) ([]db.GroupRequest, error) {
|
||||
return groupRequestList, nil
|
||||
}
|
||||
|
||||
//received
|
||||
// received
|
||||
func GetGroupApplicationList(userID string) ([]db.GroupRequest, error) {
|
||||
var groupRequestList []db.GroupRequest
|
||||
memberList, err := GetGroupMemberListByUserID(userID)
|
||||
|
@ -145,40 +145,6 @@ func DelJoinedGroupIDListFromCache(userID string) error {
|
||||
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 {
|
||||
err := db.DB.Rc.TagAsDeleted(groupCache + groupID)
|
||||
return err
|
||||
@ -458,6 +424,39 @@ func GetGroupMemberListHashFromCache(groupID string) (uint64, error) {
|
||||
hashCodeUint64, err := strconv.Atoi(hashCode)
|
||||
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 {
|
||||
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")
|
||||
}
|
||||
|
||||
func GetExtendMsgSetFromCache(ID string, index int32) (*db.ExtendMsgSet, 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) {
|
||||
func GetExtendMsg(sourceID string, sessionType int32, clientMsgID string, firstModifyTime int64) (*db.ExtendMsg, 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 {
|
||||
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
|
||||
}
|
||||
|
||||
extendMsgStr, err := db.DB.Rc.Fetch(extendMsgCache+db.GetExtendMsgSetID(ID, index)+":"+clientMsgID, time.Second*30*60, getExtendMsg)
|
||||
extendMsgStr, err := db.DB.Rc.Fetch(extendMsgCache+clientMsgID, time.Second*30*60, getExtendMsg)
|
||||
if err != nil {
|
||||
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 {
|
||||
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")
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ package kafka
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/Shopify/sarama"
|
||||
)
|
||||
|
||||
@ -29,9 +30,10 @@ func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addrs []str
|
||||
config.Version = consumerConfig.KafkaVersion
|
||||
config.Consumer.Offsets.Initial = consumerConfig.OffsetsInitial
|
||||
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)
|
||||
if err != nil {
|
||||
fmt.Println("args:", addrs, groupID, config)
|
||||
panic(err.Error())
|
||||
}
|
||||
return &MConsumerGroup{
|
||||
|
@ -36,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} }
|
||||
func (m *CommonResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*CommonResp) ProtoMessage() {}
|
||||
func (*CommonResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_admin_cms_f23e453f07b40171, []int{0}
|
||||
return fileDescriptor_admin_cms_49bc09b1772ecee1, []int{0}
|
||||
}
|
||||
func (m *CommonResp) XXX_Unmarshal(b []byte) error {
|
||||
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 (*AdminLoginReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*AdminLoginResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserTokenReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserTokenResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*AddUserRegisterAddFriendIDListReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*AddUserRegisterAddFriendIDListResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*ReduceUserRegisterAddFriendIDListReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*ReduceUserRegisterAddFriendIDListResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserRegisterAddFriendIDListReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserRegisterAddFriendIDListResp) ProtoMessage() {}
|
||||
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 {
|
||||
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"`
|
||||
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,7,opt,name=pagination" json:"pagination,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_unrecognized []byte `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 (*GetChatLogsReq) ProtoMessage() {}
|
||||
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 {
|
||||
return xxx_messageInfo_GetChatLogsReq.Unmarshal(m, b)
|
||||
@ -664,6 +665,13 @@ func (m *GetChatLogsReq) GetOperationID() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetChatLogsReq) GetOpUserID() string {
|
||||
if m != nil {
|
||||
return m.OpUserID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ChatLog struct {
|
||||
ServerMsgID string `protobuf:"bytes,1,opt,name=serverMsgID" json:"serverMsgID,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 (*ChatLog) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetChatLogsResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*StatisticsReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetActiveUserReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*UserResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetActiveUserResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetActiveGroupReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GroupResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetActiveGroupResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*DateNumList) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetMessageStatisticsReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetMessageStatisticsResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetGroupStatisticsReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetGroupStatisticsResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserStatisticsReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserStatisticsResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GenerateInvitationCodeReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GenerateInvitationCodeResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetInvitationCodesReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*InvitationCode) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetInvitationCodesResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*QueryIPRegisterReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*QueryIPRegisterResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*AddIPLimitReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*AddIPLimitResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*RemoveIPLimitReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*RemoveIPLimitResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*QueryUserIDIPLimitLoginReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*UserIPLimit) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*QueryUserIDIPLimitLoginResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*AddUserIPLimitLoginReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*AddUserIPLimitLoginResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*RemoveUserIPLimitReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*RemoveUserIPLimitResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetClientInitConfigReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetClientInitConfigResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*SetClientInitConfigReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*SetClientInitConfigResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserFriendsReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserFriendsResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserIDByEmailAndPhoneNumberReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUserIDByEmailAndPhoneNumberResp) ProtoMessage() {}
|
||||
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 {
|
||||
return xxx_messageInfo_GetUserIDByEmailAndPhoneNumberResp.Unmarshal(m, b)
|
||||
@ -3804,153 +3812,153 @@ var _AdminCMS_serviceDesc = grpc.ServiceDesc{
|
||||
}
|
||||
|
||||
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{
|
||||
// 2290 bytes of a gzipped FileDescriptorProto
|
||||
var fileDescriptor_admin_cms_49bc09b1772ecee1 = []byte{
|
||||
// 2301 bytes of a gzipped FileDescriptorProto
|
||||
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,
|
||||
0xb4, 0xb1, 0x91, 0x23, 0x2e, 0x8b, 0x14, 0xe4, 0x78, 0x62, 0x33, 0x91, 0xed, 0x0c, 0x3d, 0xc9,
|
||||
0x4a, 0xc0, 0x6a, 0x4d, 0x67, 0xa6, 0x3c, 0x69, 0xd9, 0xd3, 0x5d, 0xe9, 0xea, 0xf1, 0xc6, 0x5a,
|
||||
0xed, 0x75, 0x2f, 0x5c, 0x90, 0x90, 0x38, 0x70, 0x44, 0xdc, 0x38, 0x70, 0x40, 0xe2, 0xce, 0xef,
|
||||
0xe0, 0xb0, 0x42, 0xfc, 0x0a, 0x6e, 0xa8, 0xaa, 0xfa, 0xa3, 0xaa, 0xba, 0x67, 0xa6, 0xd3, 0x8e,
|
||||
0x72, 0x9b, 0xf7, 0xfa, 0xd5, 0xfb, 0xae, 0x57, 0xaf, 0x5e, 0x0d, 0x6c, 0x38, 0xbd, 0x81, 0xeb,
|
||||
0x5d, 0x74, 0x07, 0x74, 0x3f, 0xf9, 0xb5, 0x47, 0x02, 0x3f, 0xf4, 0xd1, 0x6c, 0x82, 0x30, 0x77,
|
||||
0x9f, 0x13, 0xec, 0x3d, 0x6c, 0x9d, 0x3d, 0xec, 0xe0, 0xe0, 0x06, 0x07, 0xfb, 0xe4, 0xaa, 0xbf,
|
||||
0xcf, 0x89, 0xf6, 0x69, 0xef, 0xea, 0xe2, 0x6b, 0xba, 0xff, 0x75, 0xb4, 0xc8, 0x7a, 0x0c, 0x70,
|
||||
0xe4, 0x0f, 0x06, 0xbe, 0x67, 0x63, 0x4a, 0x50, 0x03, 0xa6, 0x71, 0x10, 0x1c, 0xf9, 0x3d, 0xdc,
|
||||
0x30, 0xb6, 0x8c, 0xdd, 0xba, 0x1d, 0x83, 0x68, 0x1d, 0xa6, 0x70, 0x10, 0x9c, 0xd1, 0x7e, 0xa3,
|
||||
0xb2, 0x65, 0xec, 0xce, 0xda, 0x11, 0x64, 0x75, 0x61, 0xe1, 0x90, 0x89, 0x3d, 0xf5, 0xfb, 0xae,
|
||||
0x67, 0xe3, 0x37, 0x68, 0x0b, 0xe6, 0x7c, 0x82, 0x03, 0x27, 0x74, 0x7d, 0xaf, 0xd5, 0xe4, 0x6c,
|
||||
0x66, 0x6d, 0x19, 0xc5, 0x84, 0x70, 0x4d, 0x5b, 0xcd, 0x88, 0x57, 0x0c, 0x32, 0x21, 0x14, 0x77,
|
||||
0x03, 0x1c, 0x36, 0xaa, 0x42, 0x88, 0x80, 0xac, 0x3f, 0x1a, 0xb0, 0x28, 0x4b, 0xa1, 0x04, 0xad,
|
||||
0x41, 0x3d, 0xf4, 0xaf, 0xb0, 0x17, 0x09, 0x10, 0x00, 0x32, 0x61, 0x66, 0x48, 0x71, 0x70, 0xee,
|
||||
0x0c, 0x70, 0xc4, 0x3b, 0x81, 0x99, 0xd8, 0x4b, 0xa7, 0x8b, 0x5f, 0xda, 0xa7, 0x11, 0xf7, 0x18,
|
||||
0x44, 0x3f, 0x03, 0xe8, 0x26, 0x3e, 0x68, 0xd4, 0xb6, 0x8c, 0xdd, 0xb9, 0x83, 0x7b, 0x7b, 0xa9,
|
||||
0x7b, 0x53, 0x07, 0xd9, 0x12, 0xa1, 0x75, 0x05, 0x4b, 0x27, 0x38, 0x7c, 0x49, 0x71, 0xf0, 0x82,
|
||||
0x09, 0x2f, 0x66, 0xfc, 0x3a, 0x4c, 0x31, 0x8d, 0x12, 0xdb, 0x23, 0x08, 0x6d, 0x02, 0x90, 0x6b,
|
||||
0x27, 0xbc, 0xf4, 0x83, 0x41, 0xab, 0xc9, 0x15, 0xac, 0xdb, 0x12, 0xc6, 0xba, 0x85, 0x65, 0x55,
|
||||
0x18, 0x25, 0x9a, 0xde, 0x46, 0x41, 0xbd, 0x53, 0xd7, 0x55, 0x64, 0xd7, 0xb1, 0xd0, 0xbf, 0x25,
|
||||
0x2f, 0xdc, 0x01, 0xe6, 0xd2, 0xab, 0x76, 0x0c, 0x5a, 0x18, 0xb6, 0x0f, 0x7b, 0x3d, 0x26, 0xda,
|
||||
0xc6, 0x7d, 0x97, 0x86, 0x38, 0x38, 0xec, 0xf5, 0x8e, 0x03, 0x17, 0x7b, 0xbd, 0x56, 0xf3, 0xd4,
|
||||
0xa5, 0x61, 0x31, 0xcb, 0x37, 0x01, 0x84, 0xad, 0x6c, 0x49, 0xa3, 0xb2, 0x55, 0xdd, 0x9d, 0xb5,
|
||||
0x25, 0x8c, 0xf5, 0x5b, 0xb0, 0x26, 0x89, 0x29, 0x6d, 0xb3, 0xf5, 0x9d, 0x01, 0x0f, 0x6c, 0xdc,
|
||||
0x1b, 0x76, 0xf1, 0x9d, 0xed, 0xf8, 0x18, 0x66, 0x13, 0x90, 0xbb, 0xb0, 0x6e, 0xa7, 0x08, 0xcd,
|
||||
0xca, 0x6a, 0xc6, 0xca, 0xaf, 0x60, 0xa7, 0x80, 0x1e, 0xe5, 0x0d, 0xfd, 0xbd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80, 0xc4, 0x11, 0x89, 0xdf,
|
||||
0xc1, 0x21, 0x42, 0xfc, 0x0a, 0x6e, 0xa8, 0xaa, 0xfa, 0xa3, 0xaa, 0xba, 0x67, 0xa6, 0xd3, 0x8e,
|
||||
0x72, 0x9b, 0xf7, 0xfa, 0xd5, 0xfb, 0xae, 0x57, 0xaf, 0x5e, 0x0d, 0xac, 0x39, 0xbd, 0x81, 0xeb,
|
||||
0x9d, 0x77, 0x07, 0x74, 0x37, 0xf9, 0xb5, 0x43, 0x02, 0x3f, 0xf4, 0xd1, 0x74, 0x82, 0x30, 0xb7,
|
||||
0x5f, 0x10, 0xec, 0x3d, 0x6a, 0x9d, 0x3c, 0xea, 0xe0, 0xe0, 0x06, 0x07, 0xbb, 0xe4, 0xb2, 0xbf,
|
||||
0xcb, 0x89, 0x76, 0x69, 0xef, 0xf2, 0xfc, 0x1b, 0xba, 0xfb, 0x4d, 0xb4, 0xc8, 0x7a, 0x02, 0x70,
|
||||
0xe0, 0x0f, 0x06, 0xbe, 0x67, 0x63, 0x4a, 0x50, 0x03, 0x26, 0x71, 0x10, 0x1c, 0xf8, 0x3d, 0xdc,
|
||||
0x30, 0x36, 0x8c, 0xed, 0xba, 0x1d, 0x83, 0x68, 0x15, 0x26, 0x70, 0x10, 0x9c, 0xd0, 0x7e, 0xa3,
|
||||
0xb2, 0x61, 0x6c, 0x4f, 0xdb, 0x11, 0x64, 0x75, 0x61, 0x6e, 0x9f, 0x89, 0x3d, 0xf6, 0xfb, 0xae,
|
||||
0x67, 0xe3, 0x37, 0x68, 0x03, 0x66, 0x7c, 0x82, 0x03, 0x27, 0x74, 0x7d, 0xaf, 0xd5, 0xe4, 0x6c,
|
||||
0xa6, 0x6d, 0x19, 0xc5, 0x84, 0x70, 0x4d, 0x5b, 0xcd, 0x88, 0x57, 0x0c, 0x32, 0x21, 0x14, 0x77,
|
||||
0x03, 0x1c, 0x36, 0xaa, 0x42, 0x88, 0x80, 0xac, 0x3f, 0x1a, 0x30,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0xd9, 0xfa, 0xde, 0x80, 0x87, 0x36, 0xee,
|
||||
0x5d, 0x77, 0xf1, 0x9d, 0xed, 0xf8, 0x04, 0xa6, 0x13, 0x90, 0xbb, 0xb0, 0x6e, 0xa7, 0x08, 0xcd,
|
||||
0xca, 0x6a, 0xc6, 0xca, 0xaf, 0x61, 0xab, 0x80, 0x1e, 0xe5, 0x0d, 0xfd, 0xbd, 0x01, 0x9b, 0x51,
|
||||
0xa2, 0xdc, 0xc9, 0xca, 0x26, 0x00, 0x71, 0xfa, 0xae, 0x97, 0x9a, 0x39, 0xb3, 0xf7, 0x70, 0x87,
|
||||
0xf2, 0x72, 0x72, 0xee, 0x10, 0xf7, 0x9c, 0x38, 0x81, 0x33, 0xa0, 0x3b, 0x36, 0x7e, 0x73, 0x8d,
|
||||
0x69, 0xd8, 0x4e, 0x68, 0x6d, 0x69, 0x9d, 0xf5, 0x5f, 0x03, 0xac, 0x71, 0xda, 0x50, 0x82, 0x7e,
|
||||
0x01, 0xb3, 0xdc, 0x45, 0xde, 0x85, 0xcf, 0xdd, 0x66, 0x6c, 0x54, 0xb7, 0x67, 0xf6, 0x1e, 0xe4,
|
||||
0x88, 0x3b, 0x8b, 0xc8, 0x6c, 0x65, 0x01, 0x7a, 0x96, 0xa3, 0xed, 0x56, 0xae, 0xb6, 0x94, 0xf8,
|
||||
0x1e, 0xc5, 0xf9, 0xea, 0x6a, 0x3e, 0xaf, 0x16, 0xf5, 0xf9, 0x3f, 0x2b, 0x30, 0x7f, 0x84, 0xc3,
|
||||
0x83, 0xd7, 0x4e, 0x78, 0xec, 0xf7, 0x29, 0x73, 0x70, 0x03, 0x26, 0xbb, 0xbe, 0x17, 0x62, 0x2f,
|
||||
0x8c, 0x9c, 0x1b, 0x83, 0xa2, 0xc6, 0x31, 0xeb, 0xe3, 0x02, 0x20, 0x20, 0x86, 0x0f, 0x70, 0xf7,
|
||||
0x26, 0xda, 0xfc, 0xb3, 0x76, 0x04, 0xb1, 0x92, 0xc6, 0x28, 0xf8, 0xc6, 0xac, 0x89, 0x92, 0x16,
|
||||
0xc3, 0x2c, 0x8c, 0x14, 0x53, 0xea, 0xfa, 0xde, 0x8b, 0x5b, 0x82, 0x1b, 0x75, 0x9e, 0x8c, 0x32,
|
||||
0x8a, 0x51, 0x44, 0x82, 0x39, 0xc5, 0x94, 0xa0, 0x90, 0x50, 0x5a, 0xa0, 0xa7, 0xcb, 0x05, 0x5a,
|
||||
0x4f, 0xa8, 0x99, 0x4c, 0x42, 0x59, 0x7f, 0xaf, 0xc1, 0x74, 0xe4, 0x21, 0xa1, 0x37, 0x13, 0x70,
|
||||
0x46, 0xfb, 0x69, 0xfa, 0x49, 0x28, 0xae, 0xf7, 0xb5, 0x8b, 0xbd, 0x50, 0x50, 0x08, 0x57, 0xc9,
|
||||
0x28, 0xc9, 0x8f, 0xd5, 0x11, 0x7e, 0xac, 0x29, 0x7e, 0x6c, 0xc0, 0x74, 0x3f, 0xf0, 0x87, 0xa4,
|
||||
0xd5, 0xe4, 0x7e, 0x9a, 0xb5, 0x63, 0x10, 0x59, 0x30, 0xcf, 0x68, 0xce, 0xdd, 0xee, 0x95, 0xc7,
|
||||
0x0e, 0x8e, 0x29, 0xfe, 0x59, 0xc1, 0xa1, 0x9f, 0xc0, 0x32, 0xe3, 0x8f, 0x83, 0x76, 0x5a, 0xa4,
|
||||
0xa7, 0xb9, 0x33, 0x33, 0x78, 0xf4, 0x29, 0x2c, 0x0a, 0x5c, 0xc2, 0x51, 0xb8, 0x43, 0xc3, 0xa2,
|
||||
0x07, 0xb0, 0x20, 0x30, 0xc7, 0xd1, 0xb1, 0x34, 0xcb, 0xc9, 0x54, 0x24, 0x2b, 0x37, 0x5c, 0x51,
|
||||
0x7e, 0xa6, 0x01, 0xa7, 0x48, 0x11, 0x7a, 0x06, 0xcc, 0x65, 0x33, 0xa0, 0x01, 0xd3, 0x03, 0xda,
|
||||
0x3f, 0x0e, 0xfc, 0x41, 0x63, 0x5e, 0x1c, 0xe9, 0x11, 0xa8, 0xe7, 0xc6, 0x42, 0x36, 0x37, 0xa4,
|
||||
0x2c, 0x5e, 0xcc, 0x66, 0x71, 0xe8, 0x84, 0x43, 0xda, 0x58, 0xe2, 0xcb, 0x22, 0x48, 0xc9, 0xd6,
|
||||
0x65, 0x7e, 0x8c, 0xa4, 0xd9, 0xba, 0x09, 0xd0, 0x0d, 0xb0, 0x13, 0x62, 0xfe, 0x75, 0x85, 0x7f,
|
||||
0x95, 0x30, 0x68, 0x11, 0x2a, 0xf8, 0x6d, 0x03, 0x71, 0x41, 0x15, 0xfc, 0xd6, 0xfa, 0x8f, 0xc1,
|
||||
0x0f, 0xd8, 0x74, 0x5b, 0x51, 0x82, 0xf6, 0x60, 0xa6, 0x1b, 0xc1, 0x51, 0x95, 0x40, 0xf2, 0xfe,
|
||||
0x14, 0x9f, 0xec, 0x84, 0xe6, 0x7d, 0x15, 0x06, 0xe6, 0xaa, 0x88, 0xe5, 0xf9, 0x70, 0x10, 0x1d,
|
||||
0xcf, 0x32, 0xaa, 0x6c, 0x0f, 0xf1, 0x08, 0x16, 0x3a, 0xa1, 0x13, 0xba, 0x34, 0x74, 0xbb, 0xbc,
|
||||
0x70, 0x20, 0xa8, 0x5d, 0xb2, 0x58, 0x89, 0x3d, 0xc1, 0x7f, 0x33, 0xc7, 0x84, 0x7e, 0xb4, 0x07,
|
||||
0x2a, 0xa1, 0x6f, 0x85, 0xbc, 0x17, 0x38, 0xec, 0x86, 0xee, 0x4d, 0x74, 0x8c, 0xbc, 0x41, 0x8f,
|
||||
0x61, 0x81, 0xca, 0x8c, 0xa2, 0x13, 0xa3, 0x21, 0xa9, 0xa0, 0x08, 0xb2, 0x55, 0x72, 0x7d, 0x03,
|
||||
0x57, 0xb2, 0x1b, 0xf8, 0x2b, 0x98, 0x11, 0xc2, 0x28, 0x61, 0x61, 0xf6, 0xdc, 0xee, 0x15, 0xcf,
|
||||
0x49, 0xa1, 0x69, 0x02, 0x8f, 0xeb, 0x70, 0x06, 0x98, 0x52, 0xa7, 0x8f, 0x53, 0x17, 0x4a, 0x18,
|
||||
0x6b, 0x08, 0x2b, 0x9a, 0x55, 0x94, 0xa0, 0x1f, 0x43, 0x9d, 0xfd, 0x8e, 0x83, 0xbd, 0x2a, 0x99,
|
||||
0x13, 0xd3, 0xd8, 0x82, 0x42, 0x8b, 0x40, 0xa5, 0x68, 0x04, 0x64, 0xb1, 0x27, 0x6c, 0x5f, 0x7d,
|
||||
0x18, 0x6f, 0xfe, 0xd9, 0x80, 0xd9, 0x48, 0x1c, 0x25, 0x6c, 0x93, 0x9f, 0x24, 0x9b, 0x5c, 0x38,
|
||||
0x34, 0x45, 0xb0, 0x6d, 0xc8, 0x81, 0x56, 0x2f, 0x6e, 0x98, 0x23, 0x90, 0xf9, 0xf4, 0x2c, 0xe3,
|
||||
0xd3, 0x14, 0x53, 0x36, 0x2b, 0x6f, 0x01, 0xe9, 0x3e, 0xa1, 0x04, 0x7d, 0x06, 0x53, 0x1c, 0x88,
|
||||
0x83, 0xb1, 0x26, 0x31, 0x4a, 0xa8, 0xec, 0x88, 0xa6, 0x6c, 0x38, 0x1e, 0xc1, 0x5c, 0xd3, 0x09,
|
||||
0x99, 0xf2, 0xfc, 0x60, 0x47, 0x50, 0x63, 0x60, 0xbc, 0x1d, 0xd8, 0x6f, 0xb4, 0x0c, 0x55, 0x66,
|
||||
0xad, 0x68, 0xbd, 0xd8, 0x4f, 0xeb, 0x1b, 0xf8, 0xe8, 0x04, 0x87, 0x91, 0xdd, 0xea, 0x7e, 0x7a,
|
||||
0xac, 0x6d, 0xb0, 0xc9, 0x91, 0xec, 0xe8, 0x91, 0x7c, 0x9e, 0x8d, 0xa4, 0x84, 0xb2, 0xfe, 0x55,
|
||||
0x81, 0x46, 0xbe, 0x74, 0xee, 0xb3, 0x95, 0x76, 0xe0, 0xde, 0x38, 0x21, 0x96, 0xe2, 0x24, 0xae,
|
||||
0x56, 0xd9, 0x0f, 0x68, 0x17, 0x96, 0xb8, 0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7, 0xb9, 0xe6, 0x27, 0x63, 0xbe, 0x52, 0x82,
|
||||
0x2e, 0xf8, 0x30, 0x23, 0x33, 0xc0, 0x43, 0x96, 0xba, 0x2c, 0x6f, 0xbe, 0x68, 0xfe, 0x70, 0x22,
|
||||
0x0d, 0x25, 0xe8, 0xd7, 0xbc, 0x1e, 0x6a, 0x23, 0x26, 0xb4, 0xa5, 0x2e, 0xcd, 0x4e, 0xbf, 0xcc,
|
||||
0xed, 0x09, 0x14, 0x94, 0xa0, 0x2f, 0x92, 0xc3, 0x44, 0xe2, 0xfc, 0x83, 0x6c, 0x80, 0x55, 0xc6,
|
||||
0x5b, 0xe3, 0x09, 0x28, 0x41, 0x98, 0x9d, 0xf5, 0x79, 0x57, 0x6b, 0xf4, 0x40, 0x59, 0x3b, 0xe2,
|
||||
0xc2, 0x6f, 0xee, 0x14, 0xa0, 0x4a, 0x3c, 0xa3, 0x5d, 0x0b, 0x75, 0xcf, 0x64, 0xaf, 0xe2, 0xba,
|
||||
0x67, 0xf2, 0xee, 0x95, 0x6d, 0x58, 0xd2, 0xee, 0x52, 0x48, 0xce, 0x83, 0xec, 0x85, 0xcd, 0xdc,
|
||||
0x1c, 0xf7, 0x99, 0x12, 0x51, 0xd2, 0xe2, 0x4b, 0x88, 0x56, 0xd2, 0xa4, 0xcb, 0x8f, 0x56, 0xd2,
|
||||
0x94, 0x5b, 0xcb, 0x33, 0x58, 0x50, 0x2e, 0x0e, 0xca, 0x2e, 0xd0, 0x2f, 0x26, 0xca, 0x2e, 0xc8,
|
||||
0xde, 0x37, 0x5e, 0xc3, 0x47, 0x23, 0x1a, 0x71, 0xb4, 0xa3, 0x5b, 0x92, 0x7b, 0xb9, 0x30, 0x3f,
|
||||
0x2d, 0x42, 0x46, 0x09, 0xfa, 0x12, 0x56, 0x73, 0x9a, 0x5f, 0xb4, 0x9d, 0xad, 0xa7, 0xba, 0x04,
|
||||
0x6b, 0x12, 0x89, 0x48, 0xe1, 0x4c, 0x9b, 0xaa, 0xa4, 0x70, 0x5e, 0x9b, 0xac, 0xa4, 0x70, 0x7e,
|
||||
0x97, 0xfb, 0x25, 0xac, 0xe6, 0xb4, 0x9c, 0x48, 0x4b, 0x9d, 0x9c, 0x06, 0xd2, 0xb4, 0x26, 0x91,
|
||||
0x08, 0xee, 0x9d, 0x09, 0xdc, 0x3b, 0x93, 0xb9, 0x8f, 0xea, 0x2d, 0x45, 0x85, 0x93, 0x3a, 0x28,
|
||||
0xbd, 0xc2, 0xa9, 0xed, 0xa3, 0x5e, 0xe1, 0xf4, 0xd6, 0x2b, 0x3d, 0x41, 0x46, 0xb4, 0x05, 0x79,
|
||||
0x27, 0xc8, 0xe8, 0x06, 0x26, 0xef, 0x04, 0x19, 0xd7, 0x6f, 0x9c, 0xc0, 0xbc, 0xfc, 0xe7, 0x25,
|
||||
0x64, 0x66, 0x97, 0xc7, 0x7f, 0xa1, 0x32, 0xef, 0x8f, 0xfc, 0x46, 0xc9, 0x93, 0x1f, 0xfd, 0x66,
|
||||
0xe7, 0x39, 0xc1, 0xde, 0x45, 0xeb, 0x4c, 0xfa, 0x4b, 0x5b, 0x42, 0xff, 0xf3, 0xe4, 0xd7, 0xab,
|
||||
0x29, 0xfe, 0xe9, 0xd1, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x1b, 0xac, 0x59, 0x2f, 0x27,
|
||||
0x00, 0x00,
|
||||
0x26, 0xda, 0xfc, 0xd3, 0x76, 0x04, 0xb1, 0x92, 0xc6, 0x28, 0xf8, 0xc6, 0xac, 0x89, 0x92, 0x16,
|
||||
0xc3, 0x2c, 0x8c, 0x14, 0x53, 0xea, 0xfa, 0xde, 0xcb, 0x5b, 0x82, 0x1b, 0x75, 0x9e, 0x8c, 0x32,
|
||||
0x8a, 0x51, 0x44, 0x82, 0x39, 0xc5, 0x84, 0xa0, 0x90, 0x50, 0x5a, 0xa0, 0x27, 0xcb, 0x05, 0x5a,
|
||||
0x4f, 0xa8, 0xa9, 0x6c, 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
0xa1, 0x45, 0xa0, 0x52, 0x34, 0x02, 0xb2, 0xd8, 0x23, 0xb6, 0xaf, 0x3e, 0x8e, 0x37, 0xff, 0x6c,
|
||||
0xc0, 0x74, 0x24, 0x8e, 0x12, 0xb6, 0xc9, 0x8f, 0x92, 0x4d, 0x2e, 0x1c, 0x9a, 0x22, 0xd8, 0x36,
|
||||
0xe4, 0x40, 0xab, 0x17, 0x37, 0xd3, 0x11, 0xc8, 0x7c, 0x7a, 0x92, 0xf1, 0x69, 0x8a, 0x29, 0x9b,
|
||||
0x95, 0xb7, 0x80, 0x74, 0x9f, 0x50, 0x82, 0x3e, 0x87, 0x09, 0x0e, 0xc4, 0xc1, 0x58, 0x91, 0x18,
|
||||
0x25, 0x54, 0x76, 0x44, 0x53, 0x36, 0x1c, 0x8f, 0x61, 0xa6, 0xe9, 0x84, 0x4c, 0x79, 0x7e, 0xe8,
|
||||
0x23, 0xa8, 0x31, 0x30, 0xde, 0x0e, 0xec, 0x37, 0x5a, 0x84, 0x2a, 0xb3, 0x56, 0xb4, 0x65, 0xec,
|
||||
0xa7, 0xf5, 0x2d, 0xdc, 0x3f, 0xc2, 0x61, 0x64, 0xb7, 0xba, 0x9f, 0x9e, 0x68, 0x1b, 0x6c, 0x7c,
|
||||
0x24, 0x3b, 0x7a, 0x24, 0x5f, 0x64, 0x23, 0x29, 0xa1, 0xac, 0x7f, 0x55, 0xa0, 0x91, 0x2f, 0x9d,
|
||||
0xfb, 0x6c, 0xa9, 0x1d, 0xb8, 0x37, 0x4e, 0x88, 0xa5, 0x38, 0x89, 0x6b, 0x57, 0xf6, 0x03, 0xda,
|
||||
0x86, 0x05, 0xee, 0x3d, 0x89, 0x56, 0x58, 0xa9, 0xa3, 0xd1, 0x31, 0xdc, 0xcb, 0x2c, 0x4f, 0xba,
|
||||
0xd1, 0x99, 0xbd, 0x55, 0xc9, 0x3c, 0xc9, 0x9d, 0x76, 0xfe, 0x22, 0xf4, 0x4b, 0x58, 0xd6, 0x04,
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0x97, 0x66, 0xa7, 0x5f, 0xe6, 0xe6, 0x18, 0x0a, 0x4a, 0xd0,
|
||||
0x97, 0xc9, 0x61, 0x22, 0x71, 0xfe, 0x41, 0x36, 0xc0, 0x2a, 0xe3, 0x8d, 0xd1, 0x04, 0x94, 0x20,
|
||||
0xcc, 0xce, 0xfa, 0xbc, 0xab, 0x35, 0x7a, 0xa8, 0xac, 0x1d, 0x72, 0xe1, 0x37, 0xb7, 0x0a, 0x50,
|
||||
0x25, 0x9e, 0xd1, 0xae, 0x85, 0xba, 0x67, 0xb2, 0x57, 0x71, 0xdd, 0x33, 0x79, 0xf7, 0xca, 0x36,
|
||||
0x2c, 0x68, 0x77, 0x29, 0x24, 0xe7, 0x41, 0xf6, 0xc2, 0x66, 0xae, 0x8f, 0xfa, 0x4c, 0x89, 0x28,
|
||||
0x69, 0xf1, 0x25, 0x44, 0x2b, 0x69, 0xd2, 0xe5, 0x47, 0x2b, 0x69, 0xca, 0xad, 0xe5, 0x39, 0xcc,
|
||||
0x29, 0x17, 0x07, 0x65, 0x17, 0xe8, 0x17, 0x13, 0x65, 0x17, 0x64, 0xef, 0x1b, 0xaf, 0xe1, 0xfe,
|
||||
0x90, 0x46, 0x1c, 0x6d, 0xe9, 0x96, 0xe4, 0x5e, 0x2e, 0xcc, 0xcf, 0x8a, 0x90, 0x51, 0x82, 0xbe,
|
||||
0x82, 0xe5, 0x9c, 0xe6, 0x17, 0x6d, 0x66, 0xeb, 0xa9, 0x2e, 0xc1, 0x1a, 0x47, 0x22, 0x52, 0x38,
|
||||
0xd3, 0xa6, 0x2a, 0x29, 0x9c, 0xd7, 0x26, 0x2b, 0x29, 0x9c, 0xdf, 0xe5, 0x7e, 0x05, 0xcb, 0x39,
|
||||
0x2d, 0x27, 0xd2, 0x52, 0x27, 0xa7, 0x81, 0x34, 0xad, 0x71, 0x24, 0x82, 0x7b, 0x67, 0x0c, 0xf7,
|
||||
0xce, 0x78, 0xee, 0xc3, 0x7a, 0x4b, 0x51, 0xe1, 0xa4, 0x0e, 0x4a, 0xaf, 0x70, 0x6a, 0xfb, 0xa8,
|
||||
0x57, 0x38, 0xbd, 0xf5, 0x4a, 0x4f, 0x90, 0x21, 0x6d, 0x41, 0xde, 0x09, 0x32, 0xbc, 0x81, 0xc9,
|
||||
0x3b, 0x41, 0x46, 0xf5, 0x1b, 0x47, 0x30, 0x2b, 0xff, 0xb1, 0x09, 0x99, 0xd9, 0xe5, 0xf1, 0xdf,
|
||||
0xab, 0xcc, 0x07, 0x43, 0xbf, 0x51, 0xf2, 0xf4, 0x47, 0xbf, 0xd9, 0x7a, 0x41, 0xb0, 0x77, 0xde,
|
||||
0x3a, 0x91, 0xfe, 0xee, 0x96, 0xd0, 0xff, 0x3c, 0xf9, 0xf5, 0x6a, 0x82, 0x7f, 0x7a, 0xfc, 0xff,
|
||||
0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x1c, 0xab, 0x91, 0x4b, 0x27, 0x00, 0x00,
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ message GetChatLogsReq {
|
||||
int32 contentType = 6;
|
||||
server_api_params.RequestPagination pagination = 7;
|
||||
string operationID = 8;
|
||||
|
||||
string opUserID = 9;
|
||||
}
|
||||
|
||||
message ChatLog {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -146,6 +146,7 @@ message GetGroupMembersInfoReq {
|
||||
repeated string memberList = 2;
|
||||
string OpUserID = 3; //No verification permission
|
||||
string OperationID = 4;
|
||||
bool noCache = 5;
|
||||
}
|
||||
|
||||
message GetGroupMembersInfoResp {
|
||||
@ -375,6 +376,27 @@ message GetGroupAbstractInfoResp{
|
||||
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{
|
||||
rpc createGroup(CreateGroupReq) returns(CreateGroupResp);
|
||||
@ -408,6 +430,8 @@ service group{
|
||||
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
|
||||
rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
|
||||
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
@ -154,26 +154,140 @@ message GetWriteDiffMsgResp{
|
||||
server_api_params.MsgData msgData = 3;
|
||||
}
|
||||
|
||||
message ModifyMsgReq {
|
||||
message ModifyMessageReactionExtensionsReq {
|
||||
string operationID = 1;
|
||||
string ID = 2;
|
||||
int32 Index = 3;
|
||||
int32 msgIndex = 4;
|
||||
string opUserID = 5;
|
||||
string userID = 6;
|
||||
bool isFirstModify = 7;
|
||||
string clientMsgID = 8;
|
||||
google.protobuf.StringValue value = 9;
|
||||
google.protobuf.StringValue ex = 10;
|
||||
google.protobuf.StringValue attachedInfo = 11;
|
||||
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 ModifyMsgResp {
|
||||
message SetMessageReactionExtensionsReq {
|
||||
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;
|
||||
string errMsg = 2;
|
||||
int32 Index = 4;
|
||||
int32 msgIndex = 3;
|
||||
string clientMsgID = 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 {
|
||||
rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp);
|
||||
@ -189,5 +303,8 @@ service msg {
|
||||
rpc GetWriteDiffMsg(GetWriteDiffMsgReq) returns(GetWriteDiffMsgResp);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} }
|
||||
func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*OnlinePushMsgReq) ProtoMessage() {}
|
||||
func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_relay_fe7346d2191b0ff8, []int{0}
|
||||
return fileDescriptor_relay_8a2a5bc32d9acd54, []int{0}
|
||||
}
|
||||
func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error {
|
||||
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 (*OnlinePushMsgResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*SingelMsgToUserResultList) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*OnlineBatchPushOneMsgReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*OnlineBatchPushOneMsgResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*SingleMsgToUserPlatform) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUsersOnlineStatusReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUsersOnlineStatusResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*KickUserOfflineReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*KickUserOfflineResp) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*MultiTerminalLoginCheckReq) ProtoMessage() {}
|
||||
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 {
|
||||
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 (*MultiTerminalLoginCheckResp) ProtoMessage() {}
|
||||
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 {
|
||||
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)
|
||||
KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, 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 {
|
||||
@ -897,6 +898,15 @@ func (c *relayClient) MultiTerminalLoginCheck(ctx context.Context, in *MultiTerm
|
||||
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
|
||||
|
||||
type RelayServer interface {
|
||||
@ -906,6 +916,7 @@ type RelayServer interface {
|
||||
SuperGroupOnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error)
|
||||
KickUserOffline(context.Context, *KickUserOfflineReq) (*KickUserOfflineResp, error)
|
||||
MultiTerminalLoginCheck(context.Context, *MultiTerminalLoginCheckReq) (*MultiTerminalLoginCheckResp, error)
|
||||
SuperGroupBackgroundOnlinePush(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
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{
|
||||
ServiceName: "relay.relay",
|
||||
HandlerType: (*RelayServer)(nil),
|
||||
@ -1048,66 +1077,71 @@ var _Relay_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "MultiTerminalLoginCheck",
|
||||
Handler: _Relay_MultiTerminalLoginCheck_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SuperGroupBackgroundOnlinePush",
|
||||
Handler: _Relay_SuperGroupBackgroundOnlinePush_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
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{
|
||||
// 844 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xe3, 0x44,
|
||||
0x14, 0x97, 0x37, 0xc9, 0xee, 0xf6, 0xb5, 0x85, 0xee, 0xd0, 0x25, 0xae, 0x91, 0x92, 0xac, 0x0f,
|
||||
var fileDescriptor_relay_8a2a5bc32d9acd54 = []byte{
|
||||
// 857 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44,
|
||||
0x14, 0x96, 0x37, 0xc9, 0xee, 0xf6, 0xb5, 0x85, 0xee, 0xd0, 0x25, 0xae, 0x91, 0x92, 0xac, 0x0f,
|
||||
0x28, 0x42, 0x34, 0x91, 0x02, 0x37, 0x6e, 0xd9, 0x68, 0x4b, 0x44, 0xa3, 0x54, 0x93, 0x45, 0xa0,
|
||||
0xbd, 0x04, 0xd7, 0x99, 0x38, 0x56, 0x1c, 0xcf, 0x74, 0xc6, 0x6e, 0xd5, 0x0b, 0x1c, 0xb9, 0x20,
|
||||
0x0e, 0x7c, 0x00, 0x0e, 0x7c, 0x45, 0xbe, 0x00, 0x9a, 0x3f, 0x31, 0x76, 0x12, 0x37, 0x14, 0xa9,
|
||||
0x97, 0x36, 0xef, 0xe7, 0xf7, 0xef, 0xf7, 0x7b, 0x6f, 0xc6, 0x86, 0x57, 0x9c, 0x44, 0xde, 0x7d,
|
||||
0x57, 0xfd, 0xed, 0x30, 0x4e, 0x13, 0x8a, 0x6a, 0xca, 0x70, 0xda, 0x63, 0x46, 0xe2, 0xf3, 0xe1,
|
||||
0xe8, 0x7c, 0x42, 0xf8, 0x2d, 0xe1, 0x5d, 0xb6, 0x0c, 0xba, 0xca, 0xa1, 0x2b, 0x66, 0xcb, 0xe9,
|
||||
0x9d, 0xe8, 0xde, 0x09, 0x1d, 0xe0, 0xfe, 0x6e, 0xc1, 0xc9, 0x38, 0x8e, 0xc2, 0x98, 0x5c, 0xa5,
|
||||
0x62, 0x31, 0x12, 0x01, 0x26, 0x37, 0xa8, 0x05, 0x87, 0x63, 0x46, 0xb8, 0x97, 0x84, 0x34, 0x1e,
|
||||
0x0e, 0x6c, 0xab, 0x65, 0xb5, 0x0f, 0x70, 0x1e, 0x42, 0x5f, 0xc3, 0x8b, 0x95, 0x08, 0x06, 0x5e,
|
||||
0xe2, 0xd9, 0xcf, 0x5a, 0x56, 0xfb, 0xb0, 0xe7, 0x74, 0x84, 0x2a, 0x35, 0xf5, 0x58, 0x38, 0x65,
|
||||
0x1e, 0xf7, 0x56, 0xa2, 0x33, 0xd2, 0x1e, 0x78, 0xed, 0x8a, 0x5c, 0x38, 0x62, 0xa9, 0x58, 0xbc,
|
||||
0xa7, 0xdf, 0x0b, 0xc2, 0x87, 0x03, 0xbb, 0xa2, 0x12, 0x17, 0x30, 0xf7, 0x02, 0x5e, 0x6d, 0xf4,
|
||||
0x23, 0x18, 0xea, 0x41, 0x95, 0x13, 0xc1, 0x6c, 0xab, 0x55, 0x69, 0x1f, 0xf6, 0x1a, 0x1d, 0x4d,
|
||||
0x79, 0x12, 0xc6, 0x41, 0x44, 0x46, 0x22, 0xd0, 0xc1, 0x57, 0x91, 0x97, 0xcc, 0x29, 0x5f, 0x61,
|
||||
0xe5, 0xeb, 0xfe, 0x6a, 0xc1, 0x99, 0xf4, 0x20, 0x51, 0xe6, 0x81, 0x89, 0x48, 0xa3, 0xe4, 0x32,
|
||||
0x14, 0x09, 0xfa, 0x14, 0x9e, 0xa7, 0xba, 0x09, 0xcd, 0xce, 0x58, 0x59, 0xa5, 0x67, 0xff, 0xbd,
|
||||
0x12, 0x6a, 0x00, 0xd0, 0xac, 0x65, 0x45, 0xea, 0x25, 0xce, 0x21, 0xee, 0x9f, 0x16, 0xd8, 0x9a,
|
||||
0x53, 0xdf, 0x4b, 0xfc, 0x85, 0xc4, 0xc6, 0x31, 0x79, 0x62, 0xad, 0xbf, 0x80, 0x93, 0xbc, 0xae,
|
||||
0x92, 0xb4, 0x5d, 0x69, 0x55, 0xda, 0x07, 0x78, 0x0b, 0x77, 0x43, 0x38, 0x2b, 0xe9, 0x4f, 0x30,
|
||||
0x74, 0x09, 0x27, 0x42, 0xd1, 0x97, 0xb8, 0x56, 0xd0, 0xcc, 0xa1, 0x95, 0x53, 0x67, 0xa7, 0xca,
|
||||
0x78, 0x2b, 0xd2, 0xbd, 0x87, 0x7a, 0x89, 0x98, 0x52, 0x46, 0xed, 0xf4, 0x96, 0xce, 0x88, 0x12,
|
||||
0xa2, 0x82, 0x73, 0x88, 0x1c, 0x19, 0x26, 0xfe, 0xed, 0x70, 0xa0, 0x64, 0x38, 0xc0, 0xc6, 0x42,
|
||||
0x9f, 0xc3, 0x47, 0xf2, 0x97, 0xcc, 0xf3, 0x8e, 0xf2, 0x95, 0xd9, 0xab, 0x1a, 0xde, 0x40, 0xdd,
|
||||
0x3b, 0xa8, 0x5f, 0x90, 0x44, 0x96, 0x14, 0x9a, 0xed, 0x24, 0xf1, 0x92, 0x54, 0xc8, 0x21, 0x34,
|
||||
0x00, 0xd2, 0x7f, 0x65, 0xb2, 0x94, 0x4c, 0x39, 0x44, 0x0e, 0x89, 0xe6, 0x86, 0xa4, 0xeb, 0xe7,
|
||||
0x21, 0xe4, 0xc0, 0x4b, 0xca, 0x0a, 0x6b, 0x9d, 0xd9, 0xee, 0xdf, 0x55, 0xb0, 0x77, 0x57, 0x16,
|
||||
0x0c, 0xd9, 0xf0, 0x82, 0x70, 0x9e, 0x51, 0xae, 0xe1, 0xb5, 0x29, 0xf9, 0x12, 0xce, 0x47, 0x22,
|
||||
0x58, 0xf3, 0xd5, 0x16, 0x9a, 0xc0, 0xb1, 0x48, 0x7d, 0x9f, 0x08, 0x61, 0xa6, 0x51, 0x51, 0xd3,
|
||||
0x38, 0x37, 0xd3, 0x28, 0xab, 0xd4, 0x99, 0xe4, 0x83, 0x70, 0x31, 0x07, 0xba, 0x82, 0xa3, 0xb9,
|
||||
0x17, 0x46, 0x64, 0x66, 0x72, 0x56, 0x55, 0xce, 0x2f, 0xf7, 0xe5, 0x7c, 0xa7, 0x62, 0x06, 0x24,
|
||||
0xf1, 0xc2, 0x08, 0x17, 0x32, 0x38, 0xbf, 0xc0, 0xb1, 0xa9, 0xa8, 0x1f, 0x4b, 0x89, 0x98, 0x99,
|
||||
0xb5, 0x59, 0xf3, 0xcc, 0x96, 0x5c, 0x85, 0xca, 0xba, 0xe6, 0xaa, 0x2d, 0x89, 0xfb, 0x34, 0x8e,
|
||||
0x33, 0x51, 0x8d, 0x25, 0x6f, 0x92, 0x50, 0xf4, 0x3d, 0x7f, 0x19, 0x70, 0x9a, 0xc6, 0x33, 0xbb,
|
||||
0xaa, 0x0e, 0x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ba, 0x9c, 0x10, 0xfe, 0x9e, 0xf0, 0x2e, 0x5b, 0x06, 0x5d, 0x15, 0xd0, 0x15, 0xb3, 0xe5, 0xf4,
|
||||
0x56, 0x74, 0x6f, 0x85, 0x4e, 0x70, 0x7f, 0xb7, 0xe0, 0x6c, 0x1c, 0x47, 0x61, 0x4c, 0x6e, 0x52,
|
||||
0xb1, 0x18, 0x89, 0x00, 0x93, 0x77, 0xa8, 0x05, 0xc7, 0x63, 0x46, 0xb8, 0x97, 0x84, 0x34, 0x1e,
|
||||
0x0e, 0x6c, 0xab, 0x65, 0xb5, 0x8f, 0x70, 0xde, 0x85, 0xbe, 0x86, 0x27, 0x2b, 0x11, 0x0c, 0xbc,
|
||||
0xc4, 0xb3, 0x1f, 0xb5, 0xac, 0xf6, 0x71, 0xcf, 0xe9, 0x08, 0xd5, 0x6a, 0xea, 0xb1, 0x70, 0xca,
|
||||
0x3c, 0xee, 0xad, 0x44, 0x67, 0xa4, 0x23, 0xf0, 0x3a, 0x14, 0xb9, 0x70, 0xc2, 0x52, 0xb1, 0x78,
|
||||
0x4d, 0xbf, 0x17, 0x84, 0x0f, 0x07, 0x76, 0x45, 0x15, 0x2e, 0xf8, 0xdc, 0x2b, 0x78, 0xb6, 0x35,
|
||||
0x8f, 0x60, 0xa8, 0x07, 0x55, 0x4e, 0x04, 0xb3, 0xad, 0x56, 0xa5, 0x7d, 0xdc, 0x6b, 0x74, 0x34,
|
||||
0xe4, 0x49, 0x18, 0x07, 0x11, 0x19, 0x89, 0x40, 0x27, 0xdf, 0x44, 0x5e, 0x32, 0xa7, 0x7c, 0x85,
|
||||
0x55, 0xac, 0xfb, 0xab, 0x05, 0x17, 0x32, 0x82, 0x44, 0x59, 0x04, 0x26, 0x22, 0x8d, 0x92, 0xeb,
|
||||
0x50, 0x24, 0xe8, 0x53, 0x78, 0x9c, 0xea, 0x21, 0x34, 0x3a, 0x63, 0x65, 0x9d, 0x1e, 0xfd, 0xfb,
|
||||
0x4e, 0xa8, 0x01, 0x40, 0xb3, 0x91, 0x15, 0xa8, 0xa7, 0x38, 0xe7, 0x71, 0xff, 0xb0, 0xc0, 0xd6,
|
||||
0x98, 0xfa, 0x5e, 0xe2, 0x2f, 0xa4, 0x6f, 0x1c, 0x93, 0x07, 0xe6, 0xfa, 0x0b, 0x38, 0xcb, 0xf3,
|
||||
0x2a, 0x41, 0xdb, 0x95, 0x56, 0xa5, 0x7d, 0x84, 0x77, 0xfc, 0x6e, 0x08, 0x17, 0x25, 0xf3, 0x09,
|
||||
0x86, 0xae, 0xe1, 0x4c, 0x28, 0xf8, 0xd2, 0xaf, 0x19, 0x34, 0x3a, 0xb4, 0x72, 0xec, 0xec, 0x65,
|
||||
0x19, 0xef, 0x64, 0xba, 0x1f, 0xa0, 0x5e, 0x42, 0xa6, 0xa4, 0x51, 0x07, 0xbd, 0xa4, 0x33, 0xa2,
|
||||
0x88, 0xa8, 0xe0, 0x9c, 0x47, 0x4a, 0x86, 0x89, 0xff, 0x7e, 0x38, 0x50, 0x34, 0x1c, 0x61, 0x63,
|
||||
0xa1, 0xcf, 0xe1, 0x23, 0xf9, 0x4b, 0xd6, 0x79, 0x45, 0xf9, 0xca, 0xec, 0x55, 0x0d, 0x6f, 0x79,
|
||||
0xdd, 0x5b, 0xa8, 0x5f, 0x91, 0x44, 0xb6, 0x14, 0x1a, 0xed, 0x24, 0xf1, 0x92, 0x54, 0x48, 0x11,
|
||||
0x1a, 0x00, 0xe9, 0x86, 0x26, 0x4b, 0xd1, 0x94, 0xf3, 0x48, 0x91, 0x68, 0x4e, 0x24, 0xdd, 0x3f,
|
||||
0xef, 0x42, 0x0e, 0x3c, 0xa5, 0xac, 0xb0, 0xd6, 0x99, 0xed, 0xfe, 0x55, 0x05, 0x7b, 0x7f, 0x67,
|
||||
0xc1, 0x90, 0x0d, 0x4f, 0x08, 0xe7, 0x19, 0xe4, 0x1a, 0x5e, 0x9b, 0x12, 0x2f, 0xe1, 0x7c, 0x24,
|
||||
0x82, 0x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 0xb9, 0xa2, 0x36, 0x7a,
|
||||
0xff, 0x0f, 0x84, 0xf4, 0x5f, 0xbc, 0x69, 0xca, 0xcf, 0xbe, 0xe9, 0x70, 0x94, 0xfb, 0xde, 0x53,
|
||||
0x49, 0xdf, 0xb0, 0xb7, 0x58, 0xfe, 0x7f, 0xfb, 0x58, 0x39, 0xbf, 0xfa, 0x27, 0x00, 0x00, 0xff,
|
||||
0xff, 0x6b, 0x3f, 0x3b, 0x05, 0x3a, 0x0a, 0x00, 0x00,
|
||||
}
|
||||
|
@ -98,5 +98,6 @@ service relay {
|
||||
rpc SuperGroupOnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp);
|
||||
rpc KickUserOffline(KickUserOfflineReq) returns(KickUserOfflineResp);
|
||||
rpc MultiTerminalLoginCheck(MultiTerminalLoginCheckReq) returns(MultiTerminalLoginCheckResp);
|
||||
rpc SuperGroupBackgroundOnlinePush(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ message GroupInfo{
|
||||
string creatorUserID = 11;
|
||||
int32 groupType = 12;
|
||||
int32 needVerification = 13;
|
||||
int32 lookMemberInfo =14;
|
||||
int32 lookMemberInfo = 14;
|
||||
int32 applyMemberFriend = 15;
|
||||
uint32 notificationUpdateTime = 16;
|
||||
string notificationUserID = 17;
|
||||
@ -34,9 +34,9 @@ message GroupInfoForSet{
|
||||
string introduction = 4;
|
||||
string faceURL = 5;
|
||||
string ex = 6;
|
||||
google.protobuf.Int32Value needVerification = 7;
|
||||
google.protobuf.Int32Value lookMemberInfo = 8;
|
||||
google.protobuf.Int32Value applyMemberFriend = 9;
|
||||
google.protobuf.Int32Value needVerification = 7;
|
||||
google.protobuf.Int32Value lookMemberInfo = 8;
|
||||
google.protobuf.Int32Value applyMemberFriend = 9;
|
||||
}
|
||||
|
||||
|
||||
@ -141,34 +141,34 @@ message Department {
|
||||
uint32 createTime = 7;
|
||||
uint32 subDepartmentNum = 8;
|
||||
uint32 memberNum = 9;
|
||||
string ex = 10;
|
||||
string ex = 10;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message OrganizationUser {
|
||||
string userID = 1;
|
||||
string nickname = 2;
|
||||
string englishName = 3;
|
||||
string faceURL = 4;
|
||||
int32 gender = 5;
|
||||
string mobile = 6;
|
||||
string telephone = 7;
|
||||
uint32 birth = 8;
|
||||
string email = 9;
|
||||
uint32 createTime = 10;
|
||||
string ex = 11;
|
||||
string birthStr = 12;
|
||||
string userID = 1;
|
||||
string nickname = 2;
|
||||
string englishName = 3;
|
||||
string faceURL = 4;
|
||||
int32 gender = 5;
|
||||
string mobile = 6;
|
||||
string telephone = 7;
|
||||
uint32 birth = 8;
|
||||
string email = 9;
|
||||
uint32 createTime = 10;
|
||||
string ex = 11;
|
||||
string birthStr = 12;
|
||||
}
|
||||
|
||||
message DepartmentMember {
|
||||
string userID = 1;
|
||||
string departmentID = 2;
|
||||
int32 order = 3;
|
||||
string position = 4;
|
||||
int32 leader = 5;
|
||||
int32 status = 6;
|
||||
string ex = 7;
|
||||
string userID = 1;
|
||||
string departmentID = 2;
|
||||
int32 order = 3;
|
||||
string position = 4;
|
||||
int32 leader = 5;
|
||||
int32 status = 6;
|
||||
string ex = 7;
|
||||
}
|
||||
|
||||
|
||||
@ -203,12 +203,12 @@ message PullMessageBySeqListReq{
|
||||
}
|
||||
|
||||
message seqList {
|
||||
repeated uint32 seqList = 1;
|
||||
repeated uint32 seqList = 1;
|
||||
}
|
||||
|
||||
|
||||
message MsgDataList {
|
||||
repeated MsgData msgDataList = 1;
|
||||
repeated MsgData msgDataList = 1;
|
||||
}
|
||||
|
||||
message PullMessageBySeqListResp {
|
||||
@ -221,9 +221,9 @@ message PullMessageBySeqListResp {
|
||||
|
||||
|
||||
message GetMaxAndMinSeqReq {
|
||||
repeated string groupIDList = 1;
|
||||
string userID = 2;
|
||||
string operationID =3;
|
||||
repeated string groupIDList = 1;
|
||||
string userID = 2;
|
||||
string operationID = 3;
|
||||
}
|
||||
message MaxAndMinSeq{
|
||||
uint32 maxSeq = 1;
|
||||
@ -266,6 +266,9 @@ message MsgData {
|
||||
bytes msgDataList = 21;
|
||||
string attachedInfo = 22;
|
||||
string ex = 23;
|
||||
bool isReact = 24;
|
||||
bool isExternalExtensions = 25;
|
||||
int64 msgFirstModifyTime = 26;
|
||||
|
||||
}
|
||||
message OfflinePushInfo{
|
||||
@ -330,6 +333,7 @@ message GroupApplicationAcceptedTips{
|
||||
GroupInfo group = 1;
|
||||
GroupMemberFullInfo opUser = 2;
|
||||
string handleMsg = 4;
|
||||
int32 receiverAs = 5; // admin(==1) or applicant(==0)
|
||||
}
|
||||
|
||||
// OnApplicationGroupRejected()
|
||||
@ -337,6 +341,7 @@ message GroupApplicationRejectedTips{
|
||||
GroupInfo group = 1;
|
||||
GroupMemberFullInfo opUser = 2;
|
||||
string handleMsg = 4;
|
||||
int32 receiverAs = 5; // admin(==1) or applicant(==0)
|
||||
}
|
||||
|
||||
// OnTransferGroupOwner()
|
||||
@ -451,7 +456,7 @@ message FriendApplicationApprovedTips{
|
||||
//FromUserID accept or reject ToUserID
|
||||
message FriendApplicationRejectedTips{
|
||||
FromToUserID fromToUserID = 1;
|
||||
string handleMsg = 2;
|
||||
string handleMsg = 2;
|
||||
}
|
||||
|
||||
|
||||
@ -488,23 +493,23 @@ message UserInfoUpdatedTips{
|
||||
|
||||
//////////////////////conversation/////////////////////
|
||||
message ConversationUpdateTips{
|
||||
string UserID = 1;
|
||||
repeated string conversationIDList = 2;
|
||||
int64 updateUnreadCountTime = 3;
|
||||
string UserID = 1;
|
||||
repeated string conversationIDList = 2;
|
||||
int64 updateUnreadCountTime = 3;
|
||||
|
||||
|
||||
}
|
||||
|
||||
message ConversationSetPrivateTips{
|
||||
string recvID = 1;
|
||||
string sendID = 2;
|
||||
bool isPrivate = 3;
|
||||
string recvID = 1;
|
||||
string sendID = 2;
|
||||
bool isPrivate = 3;
|
||||
}
|
||||
|
||||
////////////////////message///////////////////////
|
||||
message DeleteMessageTips{
|
||||
string opUserID = 1;
|
||||
string userID =2;
|
||||
string userID = 2;
|
||||
repeated uint32 seqList = 3;
|
||||
}
|
||||
///cms
|
||||
@ -522,24 +527,24 @@ message ResponsePagination {
|
||||
///////////////////signal//////////////
|
||||
message SignalReq {
|
||||
oneof payload {
|
||||
SignalInviteReq invite = 1;
|
||||
SignalInviteInGroupReq inviteInGroup= 2;
|
||||
SignalCancelReq cancel = 3;
|
||||
SignalAcceptReq accept = 4;
|
||||
SignalHungUpReq hungUp = 5;
|
||||
SignalRejectReq reject = 6;
|
||||
SignalGetRoomByGroupIDReq getRoomByGroupID = 7;
|
||||
SignalInviteReq invite = 1;
|
||||
SignalInviteInGroupReq inviteInGroup = 2;
|
||||
SignalCancelReq cancel = 3;
|
||||
SignalAcceptReq accept = 4;
|
||||
SignalHungUpReq hungUp = 5;
|
||||
SignalRejectReq reject = 6;
|
||||
SignalGetRoomByGroupIDReq getRoomByGroupID = 7;
|
||||
|
||||
SignalOnRoomParticipantConnectedReq onRoomParticipantConnectedReq = 8;
|
||||
SignalOnRoomParticipantDisconnectedReq onRoomParticipantDisconnectedReq = 9;
|
||||
SignalGetTokenByRoomIDReq getTokenByRoomID = 10;
|
||||
SignalOnRoomParticipantConnectedReq onRoomParticipantConnectedReq = 8;
|
||||
SignalOnRoomParticipantDisconnectedReq onRoomParticipantDisconnectedReq = 9;
|
||||
SignalGetTokenByRoomIDReq getTokenByRoomID = 10;
|
||||
}
|
||||
}
|
||||
|
||||
message SignalResp {
|
||||
oneof payload {
|
||||
SignalInviteReply invite = 1;
|
||||
SignalInviteInGroupReply inviteInGroup= 2;
|
||||
SignalInviteInGroupReply inviteInGroup = 2;
|
||||
SignalCancelReply cancel = 3;
|
||||
SignalAcceptReply accept = 4;
|
||||
SignalHungUpReply hungUp = 5;
|
||||
@ -551,30 +556,30 @@ message SignalResp {
|
||||
|
||||
|
||||
message InvitationInfo {
|
||||
string inviterUserID = 1;
|
||||
repeated string inviteeUserIDList = 2;
|
||||
string customData = 3;
|
||||
string groupID = 4;
|
||||
string roomID = 5;
|
||||
int32 timeout = 6;
|
||||
string mediaType = 7;
|
||||
int32 platformID = 8;
|
||||
int32 sessionType = 9;
|
||||
int32 initiateTime = 10;
|
||||
repeated string busyLineUserIDList = 11;
|
||||
string inviterUserID = 1;
|
||||
repeated string inviteeUserIDList = 2;
|
||||
string customData = 3;
|
||||
string groupID = 4;
|
||||
string roomID = 5;
|
||||
int32 timeout = 6;
|
||||
string mediaType = 7;
|
||||
int32 platformID = 8;
|
||||
int32 sessionType = 9;
|
||||
int32 initiateTime = 10;
|
||||
repeated string busyLineUserIDList = 11;
|
||||
}
|
||||
|
||||
message ParticipantMetaData{
|
||||
GroupInfo groupInfo = 1;
|
||||
GroupMemberFullInfo groupMemberInfo = 2;
|
||||
PublicUserInfo userInfo = 3;
|
||||
GroupInfo groupInfo = 1;
|
||||
GroupMemberFullInfo groupMemberInfo = 2;
|
||||
PublicUserInfo userInfo = 3;
|
||||
}
|
||||
|
||||
message SignalInviteReq {
|
||||
string opUserID = 1;
|
||||
InvitationInfo invitation = 2;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
ParticipantMetaData participant = 4;
|
||||
string opUserID = 1;
|
||||
InvitationInfo invitation = 2;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
ParticipantMetaData participant = 4;
|
||||
|
||||
}
|
||||
|
||||
@ -588,7 +593,7 @@ message SignalInviteReply {
|
||||
message SignalInviteInGroupReq {
|
||||
string opUserID = 1;
|
||||
InvitationInfo invitation = 2;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
ParticipantMetaData participant = 4;
|
||||
}
|
||||
|
||||
@ -602,7 +607,7 @@ message SignalInviteInGroupReply {
|
||||
message SignalCancelReq {
|
||||
string opUserID = 1;
|
||||
InvitationInfo invitation = 2;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
ParticipantMetaData participant = 4;
|
||||
}
|
||||
|
||||
@ -613,7 +618,7 @@ message SignalCancelReply {
|
||||
message SignalAcceptReq {
|
||||
string opUserID = 1;
|
||||
InvitationInfo invitation = 2;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
ParticipantMetaData participant = 4;
|
||||
int32 opUserPlatformID = 5;
|
||||
}
|
||||
@ -627,7 +632,7 @@ message SignalAcceptReply {
|
||||
message SignalHungUpReq {
|
||||
string opUserID = 1;
|
||||
InvitationInfo invitation = 2;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
}
|
||||
|
||||
message SignalHungUpReply {
|
||||
@ -638,7 +643,7 @@ message SignalHungUpReply {
|
||||
message SignalRejectReq {
|
||||
string opUserID = 1;
|
||||
InvitationInfo invitation = 2;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
OfflinePushInfo offlinePushInfo = 3;
|
||||
ParticipantMetaData participant = 4;
|
||||
int32 opUserPlatformID = 5;
|
||||
}
|
||||
@ -685,10 +690,10 @@ message SignalGetTokenByRoomIDReply {
|
||||
|
||||
|
||||
message DelMsgListReq{
|
||||
string opUserID = 1;
|
||||
string userID = 2;
|
||||
repeated uint32 seqList = 3;
|
||||
string operationID = 4;
|
||||
string opUserID = 1;
|
||||
string userID = 2;
|
||||
repeated uint32 seqList = 3;
|
||||
string operationID = 4;
|
||||
}
|
||||
|
||||
message DelMsgListResp{
|
||||
@ -707,25 +712,27 @@ message SetAppBackgroundStatusResp {
|
||||
}
|
||||
|
||||
message ExtendMsgSet {
|
||||
string ID = 1;
|
||||
repeated ExtendMsg extendMsgs = 2;
|
||||
int32 latestUpdateTime = 3;
|
||||
string attachedInfo = 4;
|
||||
string ex = 5;
|
||||
int32 extendMsgNum = 6;
|
||||
int32 createTime = 7;
|
||||
string sourceID = 1;
|
||||
int32 sessionType = 2;
|
||||
map <string, ExtendMsg>extendMsgs = 3;
|
||||
int64 MaxMsgUpdateTime = 4;
|
||||
int32 extendMsgNum = 5;
|
||||
int64 createTime = 6;
|
||||
}
|
||||
|
||||
message ExtendMsg {
|
||||
repeated ReactionExtendMsgSet content = 1;
|
||||
map <string, KeyValue>reactionExtensionList = 1;
|
||||
string clientMsgID = 2;
|
||||
int32 createTime = 3;
|
||||
int32 latestUpdateTime = 4;
|
||||
int64 msgFirstModifyTime = 3;
|
||||
string attachedInfo = 4;
|
||||
string ex = 5;
|
||||
}
|
||||
|
||||
message ReactionExtendMsgSet {
|
||||
string userKey = 1;
|
||||
message KeyValue {
|
||||
string typeKey = 1;
|
||||
string value = 2;
|
||||
int32 latestUpdateTime = 3;
|
||||
int64 latestUpdateTime = 3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
176
pkg/tools/batcher/batcher.go
Normal file
176
pkg/tools/batcher/batcher.go
Normal 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()
|
||||
}
|
@ -119,6 +119,22 @@ func DifferenceString(slice1, slice2 []string) []string {
|
||||
}
|
||||
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 {
|
||||
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 {
|
||||
return proto.Unmarshal([]byte(s), pb)
|
||||
err := jsonpb.UnmarshalString(s, pb)
|
||||
return err
|
||||
}
|
||||
|
||||
func Map2Pb(m map[string]string) (pb proto.Message, err error) {
|
||||
|
@ -54,13 +54,13 @@ else
|
||||
fi
|
||||
|
||||
|
||||
#check=$(ps aux | grep -w ./${cron_task_name} | grep -v grep | wc -l)
|
||||
#if [ $check -ge 1 ]; then
|
||||
# echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImCronTask"${COLOR_SUFFIX}
|
||||
#else
|
||||
# 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}
|
||||
# exit -1
|
||||
#fi
|
||||
#
|
||||
#echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX}
|
||||
check=$(ps aux | grep -w ./${cron_task_name} | grep -v grep | wc -l)
|
||||
if [ $check -ge 1 ]; then
|
||||
echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImCronTask"${COLOR_SUFFIX}
|
||||
else
|
||||
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}
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX}
|
||||
|
@ -10,6 +10,7 @@ need_to_start_server_shell=(
|
||||
msg_transfer_start.sh
|
||||
sdk_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
|
||||
|
@ -1,12 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
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........................................"
|
||||
user=`whoami`
|
||||
if [ $user == "root" ] ; then
|
||||
echo -e ${GREEN_PREFIX} "ok: login user is root" ${COLOR_SUFFIX}
|
||||
echo -e ${GREEN_PREFIX} "ok: login user is root" ${COLOR_SUFFIX}
|
||||
else
|
||||
echo -e ${RED_PREFIX}"Warning: The current user is not root "${COLOR_SUFFIX}
|
||||
echo -e ${RED_PREFIX}"Warning: The current user is not root "${COLOR_SUFFIX}
|
||||
fi
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ need_to_start_server_shell=(
|
||||
sdk_svr_start.sh
|
||||
msg_gateway_start.sh
|
||||
demo_svr_start.sh
|
||||
# start_cron.sh
|
||||
start_cron.sh
|
||||
)
|
||||
time=`date +"%Y-%m-%d %H:%M:%S"`
|
||||
echo "==========================================================">>../logs/openIM.log 2>&1 &
|
||||
|
Loading…
x
Reference in New Issue
Block a user