Merge remote-tracking branch 'origin/v2.3.0release' into main

# Conflicts:
#	config/config.yaml
This commit is contained in:
Gordon
2022-08-24 17:51:28 +08:00
134 changed files with 6643 additions and 3356 deletions
+58 -18
View File
@@ -155,13 +155,6 @@ const docTemplate = `{
"summary": "用户注册",
"operationId": "UserRegister",
"parameters": [
{
"type": "string",
"description": "im token",
"name": "token",
"in": "header",
"required": true
},
{
"description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID \u003cbr\u003e ex为拓展字段 \u003cbr\u003e gender为性别, 0为女, 1为男",
"name": "req",
@@ -209,13 +202,6 @@ const docTemplate = `{
"summary": "用户登录",
"operationId": "UserToken",
"parameters": [
{
"type": "string",
"description": "im token",
"name": "token",
"in": "header",
"required": true
},
{
"description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID",
"name": "req",
@@ -4596,7 +4582,6 @@ const docTemplate = `{
"Open_IM_internal_api_manage.OANotificationElem": {
"type": "object",
"required": [
"notificationFaceURL",
"notificationName",
"notificationType",
"text"
@@ -5946,13 +5931,21 @@ const docTemplate = `{
"base_info.GetGroupAllMemberReq": {
"type": "object",
"required": [
"count",
"groupID",
"offset",
"operationID"
],
"properties": {
"count": {
"type": "integer"
},
"groupID": {
"type": "string"
},
"offset": {
"type": "integer"
},
"operationID": {
"type": "string"
}
@@ -6521,7 +6514,11 @@ const docTemplate = `{
],
"properties": {
"roleLevel": {
"type": "integer"
"type": "integer",
"enum": [
1,
3
]
},
"userID": {
"type": "string"
@@ -6652,6 +6649,12 @@ const docTemplate = `{
"groupID": {
"type": "string"
},
"inviterUserID": {
"type": "string"
},
"joinSource": {
"type": "integer"
},
"operationID": {
"type": "string"
},
@@ -6751,6 +6754,9 @@ const docTemplate = `{
"sessionType"
],
"properties": {
"businessOperationID": {
"type": "string"
},
"contentType": {
"type": "integer"
},
@@ -6760,6 +6766,9 @@ const docTemplate = `{
"isOnlineOnly": {
"type": "boolean"
},
"notOfflinePush": {
"type": "boolean"
},
"offlinePushInfo": {
"$ref": "#/definitions/server_api_params.OfflinePushInfo"
},
@@ -6798,6 +6807,9 @@ const docTemplate = `{
"sessionType"
],
"properties": {
"businessOperationID": {
"type": "string"
},
"contentType": {
"type": "integer"
},
@@ -6807,6 +6819,9 @@ const docTemplate = `{
"isOnlineOnly": {
"type": "boolean"
},
"notOfflinePush": {
"type": "boolean"
},
"offlinePushInfo": {
"$ref": "#/definitions/server_api_params.OfflinePushInfo"
},
@@ -7063,7 +7078,6 @@ const docTemplate = `{
"required": [
"fromUserID",
"operationID",
"remark",
"toUserID"
],
"properties": {
@@ -7129,6 +7143,9 @@ const docTemplate = `{
"operationID"
],
"properties": {
"applyMemberFriend": {
"type": "integer"
},
"ex": {
"type": "string"
},
@@ -7144,6 +7161,9 @@ const docTemplate = `{
"introduction": {
"type": "string"
},
"lookMemberInfo": {
"type": "integer"
},
"needVerification": {
"type": "integer"
},
@@ -7747,7 +7767,6 @@ const docTemplate = `{
"internal_api_manage.OANotificationElem": {
"type": "object",
"required": [
"notificationFaceURL",
"notificationName",
"notificationType",
"text"
@@ -8231,6 +8250,9 @@ const docTemplate = `{
"server_api_params.GroupInfo": {
"type": "object",
"properties": {
"applyMemberFriend": {
"type": "integer"
},
"createTime": {
"type": "integer"
},
@@ -8255,6 +8277,9 @@ const docTemplate = `{
"introduction": {
"type": "string"
},
"lookMemberInfo": {
"type": "integer"
},
"memberCount": {
"type": "integer"
},
@@ -8264,6 +8289,12 @@ const docTemplate = `{
"notification": {
"type": "string"
},
"notificationUpdateTime": {
"type": "integer"
},
"notificationUserID": {
"type": "string"
},
"ownerUserID": {
"type": "string"
},
@@ -8287,6 +8318,9 @@ const docTemplate = `{
"groupID": {
"type": "string"
},
"inviterUserID": {
"type": "string"
},
"joinSource": {
"type": "integer"
},
@@ -8331,6 +8365,12 @@ const docTemplate = `{
"handleUserID": {
"type": "string"
},
"inviterUserID": {
"type": "string"
},
"joinSource": {
"type": "integer"
},
"reqMsg": {
"type": "string"
},
+58 -18
View File
@@ -147,13 +147,6 @@
"summary": "用户注册",
"operationId": "UserRegister",
"parameters": [
{
"type": "string",
"description": "im token",
"name": "token",
"in": "header",
"required": true
},
{
"description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID \u003cbr\u003e ex为拓展字段 \u003cbr\u003e gender为性别, 0为女, 1为男",
"name": "req",
@@ -201,13 +194,6 @@
"summary": "用户登录",
"operationId": "UserToken",
"parameters": [
{
"type": "string",
"description": "im token",
"name": "token",
"in": "header",
"required": true
},
{
"description": "secret为openIM密钥, 详细见服务端config.yaml secret字段 \u003cbr\u003e platform为平台ID",
"name": "req",
@@ -4588,7 +4574,6 @@
"Open_IM_internal_api_manage.OANotificationElem": {
"type": "object",
"required": [
"notificationFaceURL",
"notificationName",
"notificationType",
"text"
@@ -5938,13 +5923,21 @@
"base_info.GetGroupAllMemberReq": {
"type": "object",
"required": [
"count",
"groupID",
"offset",
"operationID"
],
"properties": {
"count": {
"type": "integer"
},
"groupID": {
"type": "string"
},
"offset": {
"type": "integer"
},
"operationID": {
"type": "string"
}
@@ -6513,7 +6506,11 @@
],
"properties": {
"roleLevel": {
"type": "integer"
"type": "integer",
"enum": [
1,
3
]
},
"userID": {
"type": "string"
@@ -6644,6 +6641,12 @@
"groupID": {
"type": "string"
},
"inviterUserID": {
"type": "string"
},
"joinSource": {
"type": "integer"
},
"operationID": {
"type": "string"
},
@@ -6743,6 +6746,9 @@
"sessionType"
],
"properties": {
"businessOperationID": {
"type": "string"
},
"contentType": {
"type": "integer"
},
@@ -6752,6 +6758,9 @@
"isOnlineOnly": {
"type": "boolean"
},
"notOfflinePush": {
"type": "boolean"
},
"offlinePushInfo": {
"$ref": "#/definitions/server_api_params.OfflinePushInfo"
},
@@ -6790,6 +6799,9 @@
"sessionType"
],
"properties": {
"businessOperationID": {
"type": "string"
},
"contentType": {
"type": "integer"
},
@@ -6799,6 +6811,9 @@
"isOnlineOnly": {
"type": "boolean"
},
"notOfflinePush": {
"type": "boolean"
},
"offlinePushInfo": {
"$ref": "#/definitions/server_api_params.OfflinePushInfo"
},
@@ -7055,7 +7070,6 @@
"required": [
"fromUserID",
"operationID",
"remark",
"toUserID"
],
"properties": {
@@ -7121,6 +7135,9 @@
"operationID"
],
"properties": {
"applyMemberFriend": {
"type": "integer"
},
"ex": {
"type": "string"
},
@@ -7136,6 +7153,9 @@
"introduction": {
"type": "string"
},
"lookMemberInfo": {
"type": "integer"
},
"needVerification": {
"type": "integer"
},
@@ -7739,7 +7759,6 @@
"internal_api_manage.OANotificationElem": {
"type": "object",
"required": [
"notificationFaceURL",
"notificationName",
"notificationType",
"text"
@@ -8223,6 +8242,9 @@
"server_api_params.GroupInfo": {
"type": "object",
"properties": {
"applyMemberFriend": {
"type": "integer"
},
"createTime": {
"type": "integer"
},
@@ -8247,6 +8269,9 @@
"introduction": {
"type": "string"
},
"lookMemberInfo": {
"type": "integer"
},
"memberCount": {
"type": "integer"
},
@@ -8256,6 +8281,12 @@
"notification": {
"type": "string"
},
"notificationUpdateTime": {
"type": "integer"
},
"notificationUserID": {
"type": "string"
},
"ownerUserID": {
"type": "string"
},
@@ -8279,6 +8310,9 @@
"groupID": {
"type": "string"
},
"inviterUserID": {
"type": "string"
},
"joinSource": {
"type": "integer"
},
@@ -8323,6 +8357,12 @@
"handleUserID": {
"type": "string"
},
"inviterUserID": {
"type": "string"
},
"joinSource": {
"type": "integer"
},
"reqMsg": {
"type": "string"
},
+39 -13
View File
@@ -38,7 +38,6 @@ definitions:
videoElem:
$ref: '#/definitions/Open_IM_internal_api_manage.VideoElem'
required:
- notificationFaceURL
- notificationName
- notificationType
- text
@@ -910,12 +909,18 @@ definitions:
type: object
base_info.GetGroupAllMemberReq:
properties:
count:
type: integer
groupID:
type: string
offset:
type: integer
operationID:
type: string
required:
- count
- groupID
- offset
- operationID
type: object
base_info.GetGroupAllMemberResp:
@@ -1285,6 +1290,9 @@ definitions:
base_info.GroupAddMemberInfo:
properties:
roleLevel:
enum:
- 1
- 3
type: integer
userID:
type: string
@@ -1372,6 +1380,10 @@ definitions:
properties:
groupID:
type: string
inviterUserID:
type: string
joinSource:
type: integer
operationID:
type: string
reqMessage:
@@ -1436,12 +1448,16 @@ definitions:
type: object
base_info.ManagementBatchSendMsgReq:
properties:
businessOperationID:
type: string
contentType:
type: integer
groupID:
type: string
isOnlineOnly:
type: boolean
notOfflinePush:
type: boolean
offlinePushInfo:
$ref: '#/definitions/server_api_params.OfflinePushInfo'
operationID:
@@ -1468,12 +1484,16 @@ definitions:
type: object
base_info.ManagementSendMsgReq:
properties:
businessOperationID:
type: string
contentType:
type: integer
groupID:
type: string
isOnlineOnly:
type: boolean
notOfflinePush:
type: boolean
offlinePushInfo:
$ref: '#/definitions/server_api_params.OfflinePushInfo'
operationID:
@@ -1657,7 +1677,6 @@ definitions:
required:
- fromUserID
- operationID
- remark
- toUserID
type: object
base_info.SetFriendRemarkResp:
@@ -1689,6 +1708,8 @@ definitions:
type: object
base_info.SetGroupInfoReq:
properties:
applyMemberFriend:
type: integer
ex:
type: string
faceURL:
@@ -1699,6 +1720,8 @@ definitions:
type: string
introduction:
type: string
lookMemberInfo:
type: integer
needVerification:
type: integer
notification:
@@ -2134,7 +2157,6 @@ definitions:
videoElem:
$ref: '#/definitions/internal_api_manage.VideoElem'
required:
- notificationFaceURL
- notificationName
- notificationType
- text
@@ -2428,6 +2450,8 @@ definitions:
type: object
server_api_params.GroupInfo:
properties:
applyMemberFriend:
type: integer
createTime:
type: integer
creatorUserID:
@@ -2444,12 +2468,18 @@ definitions:
type: integer
introduction:
type: string
lookMemberInfo:
type: integer
memberCount:
type: integer
needVerification:
type: integer
notification:
type: string
notificationUpdateTime:
type: integer
notificationUserID:
type: string
ownerUserID:
type: string
status:
@@ -2465,6 +2495,8 @@ definitions:
type: string
groupID:
type: string
inviterUserID:
type: string
joinSource:
type: integer
joinTime:
@@ -2494,6 +2526,10 @@ definitions:
type: integer
handleUserID:
type: string
inviterUserID:
type: string
joinSource:
type: integer
reqMsg:
type: string
reqTime:
@@ -2702,11 +2738,6 @@ paths:
description: 用户注册
operationId: UserRegister
parameters:
- description: im token
in: header
name: token
required: true
type: string
- description: secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID
<br> ex为拓展字段 <br> gender为性别, 0为女, 1为男
in: body
@@ -2739,11 +2770,6 @@ paths:
description: 获取用户的token
operationId: UserToken
parameters:
- description: im token
in: header
name: token
required: true
type: string
- description: secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID
in: body
name: req
+10 -1
View File
@@ -3,6 +3,7 @@ package main
import (
_ "Open_IM/cmd/open_im_api/docs"
apiAuth "Open_IM/internal/api/auth"
clientInit "Open_IM/internal/api/client_init"
"Open_IM/internal/api/conversation"
"Open_IM/internal/api/friend"
"Open_IM/internal/api/group"
@@ -43,7 +44,7 @@ func main() {
gin.SetMode(gin.ReleaseMode)
f, _ := os.Create("../logs/api.log")
gin.DefaultWriter = io.MultiWriter(f)
gin.SetMode(gin.DebugMode)
// gin.SetMode(gin.DebugMode)
r := gin.Default()
r.Use(utils.CorsHandler())
@@ -108,6 +109,8 @@ func main() {
groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup)
groupRouterGroup.POST("/set_group_member_nickname", group.SetGroupMemberNickname)
groupRouterGroup.POST("/set_group_member_info", group.SetGroupMemberInfo)
groupRouterGroup.POST("/get_group_abstract_info", group.GetGroupAbstractInfo)
//groupRouterGroup.POST("/get_group_all_member_list_by_split", group.GetGroupAllMemberListBySplit)
}
superGroupRouterGroup := r.Group("/super_group")
{
@@ -204,6 +207,12 @@ func main() {
}
initGroup := r.Group("/init")
{
initGroup.POST("/set_client_config", clientInit.SetClientInitConfig)
initGroup.POST("/get_client_config", clientInit.GetClientInitConfig)
}
go apiThird.MinioInit()
defaultPorts := config.Config.Api.GinPort
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10002 as port")
+23
View File
@@ -0,0 +1,23 @@
.PHONY: all build run gotool install clean help
BINARY_NAME=open_im_cron_task
BIN_DIR=../../bin/
all: gotool build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s"
run:
@go run ./
gotool:
go fmt ./
go vet ./
install:
make build
mv ${BINARY_NAME} ${BIN_DIR}
clean:
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
+11
View File
@@ -0,0 +1,11 @@
package main
import (
"Open_IM/internal/cron_task"
"fmt"
)
func main() {
fmt.Println("start cronTask")
cronTask.StartCronTask()
}
+16 -1
View File
@@ -40,8 +40,22 @@ func main() {
demoRouterGroup.POST("/login", register.Login)
demoRouterGroup.POST("/reset_password", register.ResetPassword)
}
cmsRouterGroup := r.Group("/cms_admin")
{
cmsRouterGroup.POST("/generate_invitation_code", register.GenerateInvitationCode)
cmsRouterGroup.POST("/query_invitation_code", register.QueryInvitationCode)
cmsRouterGroup.POST("/get_invitation_codes", register.GetInvitationCodes)
cmsRouterGroup.POST("/query_user_ip_limit_login", register.QueryUserIDLimitLogin)
cmsRouterGroup.POST("/add_user_ip_limit_login", register.AddUserIPLimitLogin)
cmsRouterGroup.POST("/remove_user_ip_limit_login", register.RemoveUserIPLimitLogin)
cmsRouterGroup.POST("/query_ip_register", register.QueryIPRegister)
cmsRouterGroup.POST("/add_ip_limit", register.AddIPLimit)
cmsRouterGroup.POST("/remove_ip_Limit", register.RemoveIPLimit)
}
defaultPorts := config.Config.Demo.Port
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 42233 as port")
ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10004 as port")
flag.Parse()
fmt.Println("start demo api server, port: ", *ginPort)
address := "0.0.0.0:" + strconv.Itoa(*ginPort)
@@ -51,6 +65,7 @@ func main() {
address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort)
fmt.Println("start demo api server address: ", address)
go register.OnboardingProcessRoutine()
go register.ImportFriendRoutine()
err := r.Run(address)
if err != nil {
log.Error("", "run failed ", *ginPort, err.Error())