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