pull/258/head
skiffer-git 2 years ago
parent 2b3bb92357
commit f383d6c636

@ -3,11 +3,11 @@ package main
import ( import (
_ "Open_IM/cmd/open_im_api/docs" _ "Open_IM/cmd/open_im_api/docs"
apiAuth "Open_IM/internal/api/auth" apiAuth "Open_IM/internal/api/auth"
apiChat "Open_IM/internal/api/chat"
"Open_IM/internal/api/conversation" "Open_IM/internal/api/conversation"
"Open_IM/internal/api/friend" "Open_IM/internal/api/friend"
"Open_IM/internal/api/group" "Open_IM/internal/api/group"
"Open_IM/internal/api/manage" "Open_IM/internal/api/manage"
apiChat "Open_IM/internal/api/msg"
"Open_IM/internal/api/office" "Open_IM/internal/api/office"
"Open_IM/internal/api/organization" "Open_IM/internal/api/organization"
apiThird "Open_IM/internal/api/third" apiThird "Open_IM/internal/api/third"

@ -230,7 +230,7 @@ secret: tuoyun
# 1多平台登录Android、iOS、Windows、Mac 每种平台只能一个在线web端可以多个同时在线 # 1多平台登录Android、iOS、Windows、Mac 每种平台只能一个在线web端可以多个同时在线
multiloginpolicy: 1 multiloginpolicy: 1
#chat log insert to db #msg log insert to db
chatpersistencemysql: true chatpersistencemysql: true
#可靠性存储 #可靠性存储
reliablestorage: false reliablestorage: false
@ -344,7 +344,7 @@ notification:
desc: "memberQuit desc" desc: "memberQuit desc"
ext: "memberQuit ext" ext: "memberQuit ext"
defaultTips: defaultTips:
tips: "quit group chat" # group info changed by xx tips: "quit group msg" # group info changed by xx
groupApplicationAccepted: groupApplicationAccepted:
conversation: conversation:

@ -13,7 +13,7 @@ import (
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify" "Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat" pbChat "Open_IM/pkg/proto/msg"
"Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/proto/sdk_ws"
open_im_sdk "Open_IM/pkg/proto/sdk_ws" open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"

@ -1,4 +1,4 @@
package apiChat package msg
import ( import (
api "Open_IM/pkg/base_info" api "Open_IM/pkg/base_info"
@ -61,7 +61,7 @@ func DelMsg(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return return
} }
msgClient := rpc.NewChatClient(grpcConn) msgClient := rpc.NewMsgClient(grpcConn)
respPb, err := msgClient.DelMsgList(context.Background(), &reqPb) respPb, err := msgClient.DelMsgList(context.Background(), &reqPb)
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb)
@ -134,7 +134,7 @@ func DelSuperGroupMsg(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return return
} }
client := rpc.NewChatClient(etcdConn) client := rpc.NewMsgClient(etcdConn)
log.Info(req.OperationID, "", "api DelSuperGroupMsg call, api call rpc...") log.Info(req.OperationID, "", "api DelSuperGroupMsg call, api call rpc...")
@ -193,7 +193,7 @@ func ClearMsg(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return return
} }
client := rpc.NewChatClient(etcdConn) client := rpc.NewMsgClient(etcdConn)
RpcResp, err := client.ClearMsg(context.Background(), req) RpcResp, err := client.ClearMsg(context.Background(), req)
if err != nil { if err != nil {
log.NewError(req.OperationID, " CleanUpMsg failed ", err.Error(), req.String(), RpcResp.ErrMsg) log.NewError(req.OperationID, " CleanUpMsg failed ", err.Error(), req.String(), RpcResp.ErrMsg)
@ -241,7 +241,7 @@ func SetMsgMinSeq(c *gin.Context) {
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return return
} }
client := rpc.NewChatClient(etcdConn) client := rpc.NewMsgClient(etcdConn)
RpcResp, err := client.SetMsgMinSeq(context.Background(), req) RpcResp, err := client.SetMsgMinSeq(context.Background(), req)
if err != nil { if err != nil {
log.NewError(req.OperationID, " SetMsgMinSeq failed ", err.Error(), req.String(), RpcResp.ErrMsg) log.NewError(req.OperationID, " SetMsgMinSeq failed ", err.Error(), req.String(), RpcResp.ErrMsg)

@ -1,4 +1,4 @@
package apiChat package msg
import ( import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
@ -35,7 +35,7 @@ func GetSeq(c *gin.Context) {
pbData := sdk_ws.GetMaxAndMinSeqReq{} pbData := sdk_ws.GetMaxAndMinSeqReq{}
pbData.UserID = params.SendID pbData.UserID = params.SendID
pbData.OperationID = params.OperationID pbData.OperationID = params.OperationID
grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, pbData.OperationID) grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, pbData.OperationID)
if grpcConn == nil { if grpcConn == nil {
errMsg := pbData.OperationID + " getcdv3.GetConn == nil" errMsg := pbData.OperationID + " getcdv3.GetConn == nil"
log.NewError(pbData.OperationID, errMsg) log.NewError(pbData.OperationID, errMsg)
@ -43,7 +43,7 @@ func GetSeq(c *gin.Context) {
return return
} }
msgClient := pbChat.NewChatClient(grpcConn) msgClient := pbChat.NewMsgClient(grpcConn)
reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData)
if err != nil { if err != nil {
log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error()) log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error())

@ -1,4 +1,4 @@
package apiChat package msg
import ( import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"

@ -1,9 +1,9 @@
package apiChat package msg
import ( import (
"Open_IM/pkg/common/config" "Open_IM/pkg/common/config"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/chat" pbChat "Open_IM/pkg/proto/msg"
open_im_sdk "Open_IM/pkg/proto/sdk_ws" open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"context" "context"
@ -71,14 +71,14 @@ func SendMsg(c *gin.Context) {
pbData := newUserSendMsgReq(token, &params) pbData := newUserSendMsgReq(token, &params)
log.Info(params.OperationID, "", "api SendMsg call start..., [data: %s]", pbData.String()) log.Info(params.OperationID, "", "api SendMsg call start..., [data: %s]", pbData.String())
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName, params.OperationID) etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMsgName, params.OperationID)
if etcdConn == nil { if etcdConn == nil {
errMsg := params.OperationID + "getcdv3.GetConn == nil" errMsg := params.OperationID + "getcdv3.GetConn == nil"
log.NewError(params.OperationID, errMsg) log.NewError(params.OperationID, errMsg)
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg})
return return
} }
client := pbChat.NewChatClient(etcdConn) client := pbChat.NewMsgClient(etcdConn)
log.Info("", "", "api SendMsg call, api call rpc...") log.Info("", "", "api SendMsg call, api call rpc...")

@ -3,7 +3,7 @@ package logic
import ( import (
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
pbMsg "Open_IM/pkg/proto/chat" pbMsg "Open_IM/pkg/proto/msg"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
) )

@ -7,7 +7,7 @@ import (
kfk "Open_IM/pkg/common/kafka" kfk "Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
"Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/grpc-etcdv3/getcdv3"
pbMsg "Open_IM/pkg/proto/chat" pbMsg "Open_IM/pkg/proto/msg"
pbPush "Open_IM/pkg/proto/push" pbPush "Open_IM/pkg/proto/push"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"context" "context"

@ -6,7 +6,7 @@ import (
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
kfk "Open_IM/pkg/common/kafka" kfk "Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
pbMsg "Open_IM/pkg/proto/chat" pbMsg "Open_IM/pkg/proto/msg"
server_api_params "Open_IM/pkg/proto/sdk_ws" server_api_params "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"github.com/Shopify/sarama" "github.com/Shopify/sarama"

@ -12,7 +12,7 @@ import (
"Open_IM/pkg/common/db/mysql_model/im_mysql_msg_model" "Open_IM/pkg/common/db/mysql_model/im_mysql_msg_model"
kfk "Open_IM/pkg/common/kafka" kfk "Open_IM/pkg/common/kafka"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
pbMsg "Open_IM/pkg/proto/chat" pbMsg "Open_IM/pkg/proto/msg"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"github.com/Shopify/sarama" "github.com/Shopify/sarama"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"

@ -1909,10 +1909,10 @@ func (s *groupServer) SetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGr
if req.RoleLevel != nil { if req.RoleLevel != nil {
switch req.RoleLevel.Value { switch req.RoleLevel.Value {
case constant.GroupOrdinaryUsers: case constant.GroupOrdinaryUsers:
//chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToOrdinaryUserNotification) //msg.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToOrdinaryUserNotification)
chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID)
case constant.GroupAdmin, constant.GroupOwner: case constant.GroupAdmin, constant.GroupOwner:
//chat.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToAdminNotification) //msg.GroupMemberRoleLevelChangeNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, constant.GroupMemberSetToAdminNotification)
chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) chat.GroupMemberInfoSetNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID)
} }
} else { } else {

@ -151,7 +151,7 @@ func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.Batc
continue continue
} }
resp.Success = append(resp.Success, v.ConversationID) resp.Success = append(resp.Success, v.ConversationID)
// if is set private chat operationthen peer user need to sync and set tips\ // if is set private msg operationthen peer user need to sync and set tips\
if v.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification { if v.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification {
if err := syncPeerUserConversation(v, req.OperationID); err != nil { if err := syncPeerUserConversation(v, req.OperationID); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error())

@ -10,7 +10,7 @@ import (
"Open_IM/pkg/common/constant" "Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db" "Open_IM/pkg/common/db"
"Open_IM/pkg/common/log" "Open_IM/pkg/common/log"
pbMsg "Open_IM/pkg/proto/chat" pbMsg "Open_IM/pkg/proto/msg"
"Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils" "Open_IM/pkg/utils"
"github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/jsonpb"

@ -7,7 +7,7 @@ package multi_terminal_login
// "Open_IM/pkg/common/config" // "Open_IM/pkg/common/config"
// "Open_IM/pkg/common/constant" // "Open_IM/pkg/common/constant"
// "Open_IM/pkg/common/db" // "Open_IM/pkg/common/db"
// pbChat "Open_IM/pkg/proto/chat" // pbChat "Open_IM/pkg/proto/msg"
// "Open_IM/pkg/utils" // "Open_IM/pkg/utils"
//) //)
// //

Loading…
Cancel
Save