Compare commits

...

9 Commits

Author SHA1 Message Date
Gordon 2c26efb5a9 log remove 2022-02-25 15:02:02 +08:00
Gordon fe9e2aa287 config update 2022-02-25 11:49:52 +08:00
Gordon 2585014ace Merge remote-tracking branch 'origin/tuoyun' into tuoyun
# Conflicts:
#	config/config.yaml
2022-02-24 18:14:25 +08:00
Gordon 0410003ceb api update 2022-02-24 18:08:53 +08:00
wangchuxiao e1a0c2fc48 fix bug 2022-02-24 14:47:21 +08:00
wangchuxiao b0a8c0a35a Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-02-23 19:55:49 +08:00
wangchuxiao 65ba2d2e27 Merge branch 'main' of github.com:OpenIMSDK/Open-IM-Server into tuoyun 2022-02-23 17:19:30 +08:00
wenxu12345 effb21bc6c dbMysqlDatabaseName: openIM_v2 2022-02-23 10:35:16 +08:00
Gordon d66a567b8f shell update 2022-02-22 19:02:39 +08:00
8 changed files with 37 additions and 25 deletions
+15 -12
View File
@@ -178,10 +178,13 @@ tokenpolicy:
# Token effective time day as a unit
accessExpire: 3650 #token过期时间(天) 默认即可
messagecallback: #暂时不要使用 还需完善
messagecallback:
callbackSwitch: false
callbackUrl: "http://www.xxx.com/msg/judge"
#TimeOut use second as unit
callbackTimeOut: 10
messagejudge:
isJudgeFriend: true
# c2c:
# callbackBeforeSendMsg:
# switch: false
@@ -255,7 +258,7 @@ notification:
desc: "groupApplicationAccepted desc"
ext: "groupApplicationAccepted ext"
defaultTips:
tips: "allowed to join the group" # group info changed by xx
tips: "was allowed to join the group" # group info changed by xx
groupApplicationRejected:
conversation:
@@ -267,7 +270,7 @@ notification:
desc: " desc"
ext: " ext"
defaultTips:
tips: "rejected into the group" # group info changed by xx
tips: "was rejected into the group" # group info changed by xx
groupOwnerTransferred:
conversation:
@@ -291,7 +294,7 @@ notification:
desc: "memberKicked desc"
ext: "memberKicked ext"
defaultTips:
tips: "kicked out of the group" # group info changed by xx
tips: "was kicked out of the group" # group info changed by xx
memberInvited:
conversation:
@@ -303,7 +306,7 @@ notification:
desc: "memberInvited desc"
ext: "memberInvited ext"
defaultTips:
tips: "invited into the group" # group info changed by xx
tips: "was invited into the group" # group info changed by xx
memberEnter:
conversation:
@@ -461,17 +464,17 @@ demoswitch: true
demo:
openImDemoPort: [ 42233 ] #demo对外服务端口,默认即可,需要开放此端口或做nginx转发
alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,必须修改
accessKeyId: LTAI5tJPkn4HuuePdiLdGqe71
accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV1
signName: OpenIM Corporation
verificationCodeTemplateCode: SMS_2268101641
accessKeyId: LTAI5tJPkn4HuuePdiLdGqe7
accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV
signName: 托云信息技术
verificationCodeTemplateCode: SMS_226810164
superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代
# second
codeTTL: 60
codeTTL: 300
mail: #仅支持qq邮箱,具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改
title: "openIM"
senderMail: "1765567899@qq.com"
senderAuthorizationCode: "1gxyausfoevlzbfag"
senderMail: "765567899@qq.com"
senderAuthorizationCode: "gxyausfoevlzbfag"
smtpAddr: "smtp.qq.com"
smtpPort: 25 #需开放此端口 出口方向
+10 -10
View File
@@ -7,12 +7,14 @@
package manage
import (
api "Open_IM/pkg/base_info"
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/grpc-etcdv3/getcdv3"
pbChat "Open_IM/pkg/proto/chat"
"Open_IM/pkg/proto/sdk_ws"
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
"context"
@@ -40,11 +42,13 @@ func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq {
newContent = utils.StructToJsonString(params.Content)
default:
}
options := make(map[string]bool, 2)
var options map[string]bool
if params.IsOnlineOnly {
options = make(map[string]bool, 5)
utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false)
utils.SetSwitchFromOptions(options, constant.IsHistory, false)
utils.SetSwitchFromOptions(options, constant.IsPersistent, false)
utils.SetSwitchFromOptions(options, constant.IsSenderSync, false)
}
pbData := pbChat.SendMsgReq{
OperationID: params.OperationID,
@@ -152,20 +156,16 @@ func ManagementSendMsg(c *gin.Context) {
log.Info("", "", "api ManagementSendMsg call, api call rpc...")
reply, err := client.SendMsg(context.Background(), pbData)
RpcResp, err := client.SendMsg(context.Background(), pbData)
if err != nil {
log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"})
return
}
log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String())
c.JSON(http.StatusOK, gin.H{
"errCode": reply.ErrCode,
"errMsg": reply.ErrMsg,
"sendTime": reply.SendTime,
"msgID": reply.ClientMsgID,
})
log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String())
resp := api.ManagementSendMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, ResultList: server_api_params.UserSendMsgResp{ServerMsgID: RpcResp.ServerMsgID, ClientMsgID: RpcResp.ClientMsgID, SendTime: RpcResp.SendTime}}
log.Info(params.OperationID, "ManagementSendMsg return", resp)
c.JSON(http.StatusOK, resp)
}
+1
View File
@@ -746,6 +746,7 @@ func (s *groupServer) GetGroups(_ context.Context, req *pbGroup.GetGroupsReq) (*
OwnerUserID: v.CreatorUserID,
Status: v.Status,
CreatorUserID: v.CreatorUserID,
CreateTime: uint32(v.CreateTime.Unix()),
},
GroupMasterId: groupMember.UserID,
GroupMasterName: groupMember.Nickname,
+6
View File
@@ -2,6 +2,7 @@ package base_info
import (
pbRelay "Open_IM/pkg/proto/relay"
"Open_IM/pkg/proto/sdk_ws"
pbUser "Open_IM/pkg/proto/user"
)
@@ -36,3 +37,8 @@ type AccountCheckResp struct {
CommResp
ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"`
}
type ManagementSendMsgResp struct {
CommResp
ResultList server_api_params.UserSendMsgResp `json:"data"`
}
+2 -2
View File
@@ -10,8 +10,8 @@ type GetUsersInfoReq struct {
}
type GetUsersInfoResp struct {
CommResp
UserInfoList []*open_im_sdk.PublicUserInfo
Data []map[string]interface{} `json:"data"`
UserInfoList []*open_im_sdk.PublicUserInfo `json:"-"`
Data []map[string]interface{} `json:"data"`
}
type UpdateSelfUserInfoReq struct {
+1
View File
@@ -0,0 +1 @@
package call_back_struct
+1
View File
@@ -0,0 +1 @@
package call_back_struct
@@ -11,7 +11,7 @@ func GetRegister(account string) (*db.Register, error) {
return nil, err
}
var r db.Register
return &r, dbConn.Debug().Table("registers").Where("account = ?",
return &r, dbConn.Table("registers").Where("account = ?",
account).Take(&r).Error
}