mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-31 11:51:28 +08:00
Merge branch 'tuoyun' of github.com:OpenIMSDK/Open-IM-Server into tuoyun
This commit is contained in:
commit
51146a4ed5
@ -1 +1 @@
|
||||
Subproject commit 539290887aff41515b291b7ecf174af25887f870
|
||||
Subproject commit b0897aa3abe719729c2ce099404f08806917bfe3
|
@ -15,6 +15,7 @@ func main() {
|
||||
router := cms_api.NewGinRouter()
|
||||
router.Use(utils.CorsHandler())
|
||||
ginPort := flag.Int("port", 8000, "get ginServerPort from cmd,default 8000 as port")
|
||||
flag.Parse()
|
||||
fmt.Println("start cms api server, port: ", ginPort)
|
||||
router.Run(":" + strconv.Itoa(*ginPort))
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ func main() {
|
||||
r := gin.Default()
|
||||
r.Use(utils.CorsHandler())
|
||||
|
||||
authRouterGroup := r.Group("/auth")
|
||||
authRouterGroup := r.Group("/demo")
|
||||
{
|
||||
authRouterGroup.POST("/code", register.SendVerificationCode)
|
||||
authRouterGroup.POST("/verify", register.Verify)
|
||||
|
@ -76,11 +76,11 @@ endpoints:
|
||||
rpc_office: openim_rpc_office
|
||||
|
||||
api:
|
||||
openImApiPort: [ 10000 ] #api服务端口,默认即可,需要开放此端口或做nginx转发
|
||||
openImApiPort: [ 10002 ] #api服务端口,默认即可,需要开放此端口或做nginx转发
|
||||
cmsapi:
|
||||
openImCmsApiPort: [ 8000 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发
|
||||
openImCmsApiPort: [ 10006 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发
|
||||
sdk:
|
||||
openImSdkWsPort: [ 30000 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发
|
||||
openImSdkWsPort: [ 10003 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发
|
||||
#对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器)
|
||||
credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改
|
||||
tencent:
|
||||
@ -92,8 +92,8 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申
|
||||
minio: #MinIO 发送图片、视频、文件时需要,请自行申请后替换,必须修改。 客户端初始化InitSDK,中 object_storage参数为minio
|
||||
bucket: openim
|
||||
location: us-east-1
|
||||
endpoint: http://127.0.0.1:9000 #minio外网ip 这个ip是给客户端访问的
|
||||
endpointInner: http://127.0.0.1:9000 #minio内网地址 如果im server 可以通过内网访问到 minio就可以填写
|
||||
endpoint: http://127.0.0.1:10005 #minio外网ip 这个ip是给客户端访问的
|
||||
endpointInner: http://127.0.0.1:10005 #minio内网地址 如果im server 可以通过内网访问到 minio就可以填写
|
||||
endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化,IM server连接minio走内网地址访问
|
||||
accessKeyID: user12345
|
||||
secretAccessKey: key12345
|
||||
@ -111,19 +111,19 @@ credential: #腾讯cos,发送图片、视频、文件时需要,请自行申
|
||||
|
||||
|
||||
rpcport: #rpc服务端口 默认即可
|
||||
openImUserPort: [ 10100 ]
|
||||
openImFriendPort: [ 10200 ]
|
||||
openImMessagePort: [ 10300 ]
|
||||
openImMessageGatewayPort: [ 10400 ]
|
||||
openImGroupPort: [ 10500 ]
|
||||
openImAuthPort: [ 10600 ]
|
||||
openImPushPort: [ 10700 ]
|
||||
openImStatisticsPort: [ 10800 ]
|
||||
openImMessageCmsPort: [ 10900 ]
|
||||
openImAdminCmsPort: [ 11000 ]
|
||||
openImOfficePort: [ 11100 ]
|
||||
openImOrganizationPort: [ 11200 ]
|
||||
openImConversationPort: [ 11400 ]
|
||||
openImUserPort: [ 10110 ]
|
||||
openImFriendPort: [ 10120 ]
|
||||
openImMessagePort: [ 10130 ]
|
||||
openImMessageGatewayPort: [ 10140 ]
|
||||
openImGroupPort: [ 10150 ]
|
||||
openImAuthPort: [ 10160 ]
|
||||
openImPushPort: [ 10170 ]
|
||||
openImStatisticsPort: [ 10180 ]
|
||||
openImMessageCmsPort: [ 10190 ]
|
||||
openImAdminCmsPort: [ 10200 ]
|
||||
openImOfficePort: [ 10210 ]
|
||||
openImOrganizationPort: [ 10220 ]
|
||||
openImConversationPort: [ 10230 ]
|
||||
c2c:
|
||||
callbackBeforeSendMsg:
|
||||
switch: false
|
||||
@ -166,7 +166,7 @@ modulename: #日志文件按模块命名,默认即可
|
||||
pushName: push
|
||||
|
||||
longconnsvr:
|
||||
openImWsPort: [ 17778 ] # ws服务端口,默认即可,要开放此端口或做nginx转发
|
||||
openImWsPort: [ 10001 ] # ws服务端口,默认即可,要开放此端口或做nginx转发
|
||||
websocketMaxConnNum: 10000
|
||||
websocketMaxMsgLen: 4096
|
||||
websocketTimeOut: 10
|
||||
@ -634,7 +634,7 @@ notification:
|
||||
demoswitch: true
|
||||
demo:
|
||||
#demo对外服务端口,默认即可,需要开放此端口或做nginx转发
|
||||
openImDemoPort: [ 42233 ]
|
||||
openImDemoPort: [ 10004 ]
|
||||
alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,必须修改
|
||||
accessKeyId: LTAI5tJPkn4HuuePdiLdGqe7
|
||||
accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV
|
||||
|
@ -42,11 +42,11 @@ func Login(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if r.Password != params.Password {
|
||||
log.NewError(params.OperationID, "password err", params.Password, account, r.Password, r.Account)
|
||||
log.NewError(params.OperationID, "password err", params.Password, account, r.Password, r.Account)
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"})
|
||||
return
|
||||
}
|
||||
url := fmt.Sprintf("http://%s:10000/auth/user_token", utils.ServerIP)
|
||||
url := fmt.Sprintf("http://%s:%d/auth/user_token", utils.ServerIP, config.Config.Api.GinPort[0])
|
||||
openIMGetUserToken := api.UserTokenReq{}
|
||||
openIMGetUserToken.OperationID = params.OperationID
|
||||
openIMGetUserToken.Platform = params.Platform
|
||||
|
@ -47,7 +47,7 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo
|
||||
if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil {
|
||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req.Conversation, err.Error())
|
||||
}
|
||||
haveUserID, _ := imdb.GetExistConversationUserIDList(req.Conversation.ConversationID)
|
||||
haveUserID, _ := imdb.GetExistConversationUserIDList(req.UserIDList, req.Conversation.ConversationID)
|
||||
switch req.FieldType {
|
||||
case constant.FieldRecvMsgOpt:
|
||||
for _, v := range req.UserIDList {
|
||||
|
@ -93,13 +93,13 @@ func GetMultipleUserConversationByConversationID(ownerUserIDList []string, conve
|
||||
err = dbConn.Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Find(&conversations).Error
|
||||
return conversations, err
|
||||
}
|
||||
func GetExistConversationUserIDList(conversationID string) ([]string, error) {
|
||||
func GetExistConversationUserIDList(ownerUserIDList []string, conversationID string) ([]string, error) {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var resultArr []string
|
||||
err = dbConn.Table("conversations").Where(" conversation_id=?", conversationID).Pluck("owner_user_id", &resultArr).Error
|
||||
err = dbConn.Table("conversations").Where(" owner_user_id IN (?) and conversation_id=?", ownerUserIDList, conversationID).Pluck("owner_user_id", &resultArr).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -140,6 +140,6 @@ func UpdateColumnsConversations(ownerUserIDList []string, conversationID string,
|
||||
return err
|
||||
}
|
||||
dbConn.LogMode(false)
|
||||
return dbConn.Model(&db.Conversation{}).Where("owner_user_id IN ? and conversation_id=?", ownerUserIDList, conversationID).Updates(args).Error
|
||||
return dbConn.Debug().Model(&db.Conversation{}).Where("owner_user_id IN (?) and conversation_id=?", ownerUserIDList, conversationID).Updates(args).Error
|
||||
|
||||
}
|
||||
|
@ -4,8 +4,11 @@ source ./style_info.cfg
|
||||
source ./path_info.cfg
|
||||
source ./function.sh
|
||||
service_port_name=(
|
||||
openImCmsApiPort
|
||||
openImWsPort
|
||||
openImApiPort
|
||||
openImSdkWsPort
|
||||
openImDemoPort
|
||||
openImCmsApiPort
|
||||
openImUserPort
|
||||
openImFriendPort
|
||||
openImMessagePort
|
||||
@ -13,12 +16,9 @@ service_port_name=(
|
||||
openImGroupPort
|
||||
openImAuthPort
|
||||
openImPushPort
|
||||
openImWsPort
|
||||
openImSdkWsPort
|
||||
openImDemoPort
|
||||
openImAdminCmsPort
|
||||
openImMessageCmsPort
|
||||
openImStatisticsPort
|
||||
openImMessageCmsPort
|
||||
openImAdminCmsPort
|
||||
openImOfficePort
|
||||
openImOrganizationPort
|
||||
openImConversationPort
|
||||
|
Loading…
x
Reference in New Issue
Block a user