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