diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..f106438e3 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ main ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ main ] + schedule: + - cron: '23 2 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.gitignore b/.gitignore index 605efd510..f75d03c97 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,9 @@ bin logs +.devcontainer +components +logs +out-test +.github + +tmp diff --git a/README.md b/README.md index 86938f001..6d3bbf89f 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ By deployment of the Open-IM-Server on the customer's server, developers can int ``` #cd Open-IM-server/script - + chmod +x *.sh ``` @@ -98,11 +98,58 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server 5. Check service ``` - ./docker_check_service.sh + ./docker_check_service.sh ``` ![OpenIMServersondockerpng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-docker.png) +#### How to develop + +1. Install [Go environment](https://golang.org/doc/install). Make sure Go version is at least 1.15. + +2. Install `Nodejs` and `pm2` + +``` + curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - + npm install pm2 -g +``` + +2. Clone the Open-IM project to your server. + + ``` + git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive + ``` + +3. Start Service. + + ``` + # run etcd/mongodb/mysql/redis/kafka + docker-compose -f docker-compose.local.yaml up -d + + # run open-im services + pm2 start app.yaml --watch + pm2 ls + pm2 logs + ``` + +or try with `docker-compose` + +``` + docker-compose -f docker-compose.dev.yaml up -d + docker-compose -f docker-compose.dev.yaml ps + docker-compose -f docker-compose.dev.yaml logs -f +``` + +### Api Swagger +run service by `pm2` firstly, then run visit `[ip]:10000/swagger/index.html` + +run following command to generate swagger docs +``` +go get -u github.com/swaggo/swag/cmd/swag +export PATH=$(go env GOPATH)/bin:$PATH +swag init --generalInfo cmd/open_im_api/main.go +``` + ### CONFIGURATION INSTRUCTIONS > Open-IM configuration is divided into basic component configuration and business internal service configuration. Developers need to fill in the address of each component as the address of their server component when using the product, and ensure that the internal service port of the business is not occupied @@ -144,7 +191,7 @@ All images are available at https://hub.docker.com/r/lyt1123/open_im_server - start_all.sh&&stop_all.sh - Total script, start all services and close all services -## Authentication Clow Chart +## Authentication Clow Chart ![avatar](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/open-im-server.png) diff --git a/app.yaml b/app.yaml new file mode 100644 index 000000000..5f2458f74 --- /dev/null +++ b/app.yaml @@ -0,0 +1,44 @@ + +apps: +- name: open_im_api + script: "go run main.go" + cwd: "cmd/open_im_api" + env: + OPEN_IM_SWAGGER_API: true + watch: ["docs", "cmd", "internal", "pkg"] + +- name: open_im_auth + script: "go run main.go" + cwd: "cmd/rpc/open_im_auth" + +- name: open_im_offline_msg + script: "go run main.go" + cwd: "cmd/rpc/open_im_msg" + +- name: open_im_friend + script: "go run main.go" + cwd: "cmd/rpc/open_im_friend" + +- name: open_im_group + script: "go run main.go" + cwd: "cmd/rpc/open_im_group" + +- name: open_im_user + script: "go run main.go" + cwd: "cmd/rpc/open_im_user" + +- name: open_im_push + script: "go run main.go" + cwd: "cmd/open_im_push" + +- name: open_im_timed_task + script: "go run main.go" + cwd: "cmd/open_im_timer_task" + +- name: open_im_msg_transfer + script: "go run main.go" + cwd: "cmd/open_im_msg_transfer" + +- name: open_im_msg_gateway + script: "go run main.go" + cwd: "cmd/open_im_msg_gateway" \ No newline at end of file diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core new file mode 160000 index 000000000..a85c10dbf --- /dev/null +++ b/cmd/Open-IM-SDK-Core @@ -0,0 +1 @@ +Subproject commit a85c10dbffbb797b5b2091e209ff67a5534b9bfc diff --git a/cmd/open_im_api/Makefile b/cmd/open_im_api/Makefile index d8fe26099..1f96bca5a 100644 --- a/cmd/open_im_api/Makefile +++ b/cmd/open_im_api/Makefile @@ -3,10 +3,11 @@ BINARY_NAME=open_im_api BIN_DIR=../../bin/ + all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 82b50dd8e..a42c3c706 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -1,6 +1,7 @@ package main import ( + docs "Open_IM/docs" apiAuth "Open_IM/internal/api/auth" apiChat "Open_IM/internal/api/chat" "Open_IM/internal/api/friend" @@ -12,9 +13,12 @@ import ( "Open_IM/pkg/utils" "flag" "strconv" - "github.com/gin-gonic/gin" + //"syscall" + + swaggerfiles "github.com/swaggo/files" + ginSwagger "github.com/swaggo/gin-swagger" ) func main() { @@ -29,6 +33,12 @@ func main() { //log.Info("", "", "api server running...") r := gin.Default() r.Use(utils.CorsHandler()) + + if os.Getenv("OPEN_IM_SWAGGER_API") == "true" { + docs.SwaggerInfo.BasePath = "/" + r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler)) + } + // user routing group, which handles user registration and login services userRouterGroup := r.Group("/user") { @@ -84,9 +94,10 @@ func main() { //Message chatGroup := r.Group("/chat") { - chatGroup.POST("/newest_seq", apiChat.UserNewestSeq) + chatGroup.POST("/newest_seq", apiChat.UserGetSeq) chatGroup.POST("/pull_msg", apiChat.UserPullMsg) chatGroup.POST("/send_msg", apiChat.UserSendMsg) + chatGroup.POST("/pull_msg_by_seq", apiChat.UserPullMsgBySeqList) } //Manager managementGroup := r.Group("/manager") @@ -98,5 +109,6 @@ func main() { log.NewPrivateLog("api") ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") flag.Parse() + r.Run(utils.ServerIP + ":" + strconv.Itoa(*ginPort)) } diff --git a/cmd/open_im_msg_gateway/main.go b/cmd/open_im_msg_gateway/main.go index 8a022b0d8..196e6c005 100644 --- a/cmd/open_im_msg_gateway/main.go +++ b/cmd/open_im_msg_gateway/main.go @@ -7,8 +7,8 @@ import ( ) func main() { - rpcPort := flag.Int("rpc_port", 10500, "rpc listening port") - wsPort := flag.Int("ws_port", 10800, "ws listening port") + rpcPort := flag.Int("rpc_port", 10400, "rpc listening port") + wsPort := flag.Int("ws_port", 17778, "ws listening port") flag.Parse() var wg sync.WaitGroup wg.Add(1) diff --git a/cmd/open_im_msg_transfer/Makefile b/cmd/open_im_msg_transfer/Makefile index fb4946585..6a67b9bee 100644 --- a/cmd/open_im_msg_transfer/Makefile +++ b/cmd/open_im_msg_transfer/Makefile @@ -3,6 +3,7 @@ BINARY_NAME=open_im_msg_transfer BIN_DIR=../../bin/ + all: gotool build build: diff --git a/cmd/open_im_push/main.go b/cmd/open_im_push/main.go index a57a56ba0..590793fbe 100644 --- a/cmd/open_im_push/main.go +++ b/cmd/open_im_push/main.go @@ -7,7 +7,7 @@ import ( ) func main() { - rpcPort := flag.Int("port", -1, "rpc listening port") + rpcPort := flag.Int("port", 10700, "rpc listening port") flag.Parse() var wg sync.WaitGroup wg.Add(1) diff --git a/cmd/open_im_timed_task/main.go b/cmd/open_im_timed_task/main.go deleted file mode 100644 index 1119ce577..000000000 --- a/cmd/open_im_timed_task/main.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/db" - "fmt" - "time" -) - -func main() { - for { - fmt.Println("start delete mongodb expired record") - timeUnixBegin := time.Now().Unix() - count, _ := db.DB.MgoUserCount() - fmt.Println("mongodb record count: ", count) - for i := 0; i < count; i++ { - time.Sleep(1 * time.Millisecond) - uid, _ := db.DB.MgoSkipUID(i) - fmt.Println("operate uid: ", uid) - err := db.DB.DelUserChat(uid) - if err != nil { - fmt.Println("operate uid failed: ", uid, err.Error()) - } - } - - timeUnixEnd := time.Now().Unix() - costTime := timeUnixEnd - timeUnixBegin - if costTime > int64(config.Config.Mongo.DBRetainChatRecords*24*3600) { - continue - } else { - sleepTime := 0 - if int64(config.Config.Mongo.DBRetainChatRecords*24*3600)-costTime > 24*3600 { - sleepTime = 24 * 3600 - } else { - sleepTime = config.Config.Mongo.DBRetainChatRecords*24*3600 - int(costTime) - } - fmt.Println("sleep: ", sleepTime) - time.Sleep(time.Duration(sleepTime) * time.Second) - } - } - -} diff --git a/cmd/open_im_timer_task/Makefile b/cmd/open_im_timer_task/Makefile new file mode 100644 index 000000000..6c6d713d8 --- /dev/null +++ b/cmd/open_im_timer_task/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_timer_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 + + diff --git a/cmd/open_im_timer_task/main.go b/cmd/open_im_timer_task/main.go new file mode 100644 index 000000000..d5cf8150c --- /dev/null +++ b/cmd/open_im_timer_task/main.go @@ -0,0 +1,65 @@ +package main + +import ( + commonDB "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "time" +) + +func main() { + log.NewPrivateLog("timer") + //for { + // fmt.Println("start delete mongodb expired record") + // timeUnixBegin := time.Now().Unix() + // count, _ := db.DB.MgoUserCount() + // fmt.Println("mongodb record count: ", count) + // for i := 0; i < count; i++ { + // time.Sleep(1 * time.Millisecond) + // uid, _ := db.DB.MgoSkipUID(i) + // fmt.Println("operate uid: ", uid) + // err := db.DB.DelUserChat(uid) + // if err != nil { + // fmt.Println("operate uid failed: ", uid, err.Error()) + // } + // } + // + // timeUnixEnd := time.Now().Unix() + // costTime := timeUnixEnd - timeUnixBegin + // if costTime > int64(config.Config.Mongo.DBRetainChatRecords*24*3600) { + // continue + // } else { + // sleepTime := 0 + // if int64(config.Config.Mongo.DBRetainChatRecords*24*3600)-costTime > 24*3600 { + // sleepTime = 24 * 3600 + // } else { + // sleepTime = config.Config.Mongo.DBRetainChatRecords*24*3600 - int(costTime) + // } + // fmt.Println("sleep: ", sleepTime) + // time.Sleep(time.Duration(sleepTime) * time.Second) + // } + //} + for { + uidList, err := im_mysql_model.SelectAllUID() + if err != nil { + log.NewError("999999", err.Error()) + } else { + for _, v := range uidList { + minSeq, err := commonDB.DB.GetMinSeqFromMongo(v) + if err != nil { + log.NewError("999999", "get user minSeq err", err.Error(), v) + continue + } else { + err := commonDB.DB.SetUserMinSeq(v, minSeq) + if err != nil { + log.NewError("999999", "set user minSeq err", err.Error(), v) + } + } + time.Sleep(time.Duration(100) * time.Millisecond) + } + + } + + } + +} diff --git a/cmd/rpc/open_im_auth/Makefile b/cmd/rpc/open_im_auth/Makefile index 845503757..da280c3b5 100644 --- a/cmd/rpc/open_im_auth/Makefile +++ b/cmd/rpc/open_im_auth/Makefile @@ -6,7 +6,7 @@ BIN_DIR=../../../bin/ all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/cmd/rpc/open_im_auth/main.go b/cmd/rpc/open_im_auth/main.go index ed4656d35..6c6f3da1c 100644 --- a/cmd/rpc/open_im_auth/main.go +++ b/cmd/rpc/open_im_auth/main.go @@ -6,7 +6,7 @@ import ( ) func main() { - rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800") + rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10600") flag.Parse() rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort) rpcServer.Run() diff --git a/cmd/rpc/open_im_friend/Makefile b/cmd/rpc/open_im_friend/Makefile index 8720ed80f..c47cbcf1d 100644 --- a/cmd/rpc/open_im_friend/Makefile +++ b/cmd/rpc/open_im_friend/Makefile @@ -6,7 +6,7 @@ BIN_DIR=../../../bin/ all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/cmd/rpc/open_im_group/Makefile b/cmd/rpc/open_im_group/Makefile index 6cd93dfd4..e7d1cb29d 100644 --- a/cmd/rpc/open_im_group/Makefile +++ b/cmd/rpc/open_im_group/Makefile @@ -6,7 +6,7 @@ BIN_DIR=../../../bin/ all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/cmd/rpc/open_im_msg/main.go b/cmd/rpc/open_im_msg/main.go index 68f5c8931..0dffe8aaa 100644 --- a/cmd/rpc/open_im_msg/main.go +++ b/cmd/rpc/open_im_msg/main.go @@ -2,13 +2,12 @@ package main import ( rpcChat "Open_IM/internal/rpc/chat" - "Open_IM/pkg/utils" "flag" ) func main() { - rpcPort := flag.String("port", "", "rpc listening port") + rpcPort := flag.Int("port", 10300, "rpc listening port") flag.Parse() - rpcServer := rpcChat.NewRpcChatServer(utils.StringToInt(*rpcPort)) + rpcServer := rpcChat.NewRpcChatServer(*rpcPort) rpcServer.Run() } diff --git a/cmd/rpc/open_im_user/Makefile b/cmd/rpc/open_im_user/Makefile index 4e124cc3a..c379db284 100644 --- a/cmd/rpc/open_im_user/Makefile +++ b/cmd/rpc/open_im_user/Makefile @@ -6,7 +6,7 @@ BIN_DIR=../../../bin/ all: gotool build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" run: @go run ./ diff --git a/config/config.dev.yaml b/config/config.dev.yaml new file mode 100644 index 000000000..2b9537bef --- /dev/null +++ b/config/config.dev.yaml @@ -0,0 +1,147 @@ + +# The class cannot be named by Pascal or camel case. +# If it is not used, the corresponding structure will not be set, +# and it will not be read naturally. +serverversion: 1.0.0 +#---------------Infrastructure configuration---------------------# +etcd: + etcdSchema: openIM + etcdAddr: [ etcd:2379 ] + +mysql: + dbMysqlAddress: [ mysql:3306 ] + dbMysqlUserName: root + dbMysqlPassword: openIM + dbMysqlDatabaseName: openIM + dbTableName: eMsg + dbMsgTableNum: 1 + dbMaxOpenConns: 20 + dbMaxIdleConns: 10 + dbMaxLifeTime: 120 + +mongo: + dbAddress: [ mongodb:27017 ] + dbDirect: false + dbTimeout: 10 + dbDatabase: openIM + dbSource: admin + dbUserName: + dbPassword: + dbMaxPoolSize: 20 + dbRetainChatRecords: 7 + +redis: + dbAddress: redis:6379 + dbMaxIdle: 128 + dbMaxActive: 0 + dbIdleTimeout: 120 + dbPassWord: openIM + +kafka: + ws2mschat: + addr: [ kafka:9092 ] + topic: "ws2ms_chat" + ms2pschat: + addr: [ kafka:9092 ] + topic: "ms2ps_chat" + consumergroupid: + msgToMongo: mongo + msgToMySql: mysql + msgToPush: push + + + +#---------------Internal service configuration---------------------# + +# The service ip default is empty, +# automatically obtain the machine's valid network card ip as the service ip, +# otherwise the configuration ip is preferred +serverip: + +api: + openImApiPort: [ 10000 ] +sdk: + openImSdkWsPort: [ 30000 ] + +credential: + tencent: + appID: 1302656840 + region: ap-chengdu + bucket: echat-1302656840 + secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC + secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe + + +rpcport: + openImUserPort: [ 10100 ] + openImFriendPort: [ 10200 ] + openImOfflineMessagePort: [ 10300 ] + openImOnlineRelayPort: [ 10400 ] + openImGroupPort: [ 10500 ] + openImAuthPort: [ 10600 ] + openImPushPort: [ 10700 ] + + +rpcregistername: + openImUserName: User + openImFriendName: Friend + openImOfflineMessageName: OfflineMessage + openImPushName: Push + openImOnlineMessageRelayName: OnlineMessageRelay + openImGroupName: Group + openImAuthName: Auth + +log: + storageLocation: ../logs/ + rotationTime: 24 + remainRotationCount: 5 + remainLogLevel: 6 + elasticSearchSwitch: false + elasticSearchAddr: [ 127.0.0.1:9201 ] + elasticSearchUser: "" + elasticSearchPassword: "" + +modulename: + longConnSvrName: msg_gateway + msgTransferName: msg_transfer + pushName: push + +longconnsvr: + openImWsPort: [ 17778 ] + websocketMaxConnNum: 10000 + websocketMaxMsgLen: 4096 + websocketTimeOut: 10 + +push: + tpns: + ios: + accessID: 1600018281 + secretKey: 3cd68a77a95b89e5089a1aca523f318f + android: + accessID: 111 + secretKey: 111 + jpns: + appKey: 2783339cee4de379cc798fe1 + masterSecret: 66e5f309e032c68cc668c28a + pushUrl: "https://api.jpush.cn/v3/push" +manager: + appManagerUid: ["openIM123456","openIM654321"] + secrets: ["openIM1","openIM2"] + +secret: tuoyun + +multiloginpolicy: + onlyOneTerminalAccess: false + mobileAndPCTerminalAccessButOtherTerminalKickEachOther: true + allTerminalAccess: false + +#token config +tokenpolicy: + accessSecret: "open_im_server" + # Token effective time seconds as a unit + #Seven days 7*24*60*60 + accessExpire: 604800 + +messagecallback: + callbackSwitch: false + callbackUrl: "http://www.xxx.com/msg/judge" \ No newline at end of file diff --git a/config/config.yaml b/config/config.yaml index 37f7c4af1..e65f23926 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,16 +1,16 @@ # The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. - +serverversion: 1.0.3 #---------------Infrastructure configuration---------------------# etcd: etcdSchema: openIM - etcdAddr: [ 81.68.126.69:2379 ] + etcdAddr: [ 127.0.0.1:2379 ] mysql: - dbMysqlAddress: [ 81.68.126.69:13306 ] - dbMysqlUserName: openIM - dbMysqlPassword: 12345 + dbMysqlAddress: [ 127.0.0.1:3306 ] + dbMysqlUserName: root + dbMysqlPassword: openIM dbMysqlDatabaseName: openIM dbTableName: eMsg dbMsgTableNum: 1 @@ -19,18 +19,18 @@ mysql: dbMaxLifeTime: 120 mongo: - dbAddress: [ 81.68.126.69:27017 ] + dbAddress: [ 127.0.0.1:27017 ] dbDirect: false dbTimeout: 10 dbDatabase: openIM - dbSource: openIM - dbUserName: openIM - dbPassword: 12345 + dbSource: admin + dbUserName: + dbPassword: dbMaxPoolSize: 20 dbRetainChatRecords: 7 redis: - dbAddress: 81.68.126.69:16379 + dbAddress: 127.0.0.1:6379 dbMaxIdle: 128 dbMaxActive: 0 dbIdleTimeout: 120 @@ -38,10 +38,10 @@ redis: kafka: ws2mschat: - addr: [ 81.68.126.69:9092 ] + addr: [ 127.0.0.1:9092 ] topic: "ws2ms_chat" ms2pschat: - addr: [ 81.68.126.69:9092 ] + addr: [ 127.0.0.1:9092 ] topic: "ms2ps_chat" consumergroupid: msgToMongo: mongo @@ -74,7 +74,7 @@ credential: rpcport: openImUserPort: [ 10100 ] openImFriendPort: [ 10200 ] - openImOfflineMessagePort: [ 10300 ] + openImOfflineMessagePort: [ 10300] openImOnlineRelayPort: [ 10400 ] openImGroupPort: [ 10500 ] openImAuthPort: [ 10600 ] @@ -119,6 +119,10 @@ push: android: accessID: 111 secretKey: 111 + jpns: + appKey: cf47465a368f24c659608e7e + masterSecret: 02204efe3f3832947a236ee5 + pushUrl: "https://api.jpush.cn/v3/push" manager: appManagerUid: ["openIM123456","openIM654321"] secrets: ["openIM1","openIM2"] @@ -133,9 +137,8 @@ multiloginpolicy: #token config tokenpolicy: accessSecret: "open_im_server" - # Token effective time seconds as a unit - #Seven days 7*24*60*60 - accessExpire: 604800 + # Token effective time day as a unit + accessExpire: 7 messagecallback: callbackSwitch: false diff --git a/dev.Dockerfile b/dev.Dockerfile new file mode 100644 index 000000000..4b20d744f --- /dev/null +++ b/dev.Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.16 as base + +FROM base as dev + +ENV GO111MODULE=on +ENV GOPROXY=https://goproxy.cn,direct + + +RUN curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin + +CMD ["air"] \ No newline at end of file diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 000000000..202450a33 --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,381 @@ +version: "3" +services: + mysql: + image: mysql:5.7 + ports: + - 3306:3306 + container_name: mysql + volumes: + - ./components/mysql/data:/var/lib/mysql + - /etc/localtime:/etc/localtime + environment: + MYSQL_ROOT_PASSWORD: openIM + restart: always + + mongodb: + image: mongo:4.0 + ports: + - 27017:27017 + container_name: mongo + volumes: + - ./components/mongodb/data:/data/db + environment: + TZ: Asia/Shanghai + restart: always + + redis: + image: redis + ports: + - 6379:6379 + container_name: redis + volumes: + - ./components/redis/data:/data + #redis config file + #- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf + environment: + TZ: Asia/Shanghai + restart: always + sysctls: + net.core.somaxconn: 1024 + command: redis-server --requirepass openIM --appendonly yes + + + zookeeper: + image: wurstmeister/zookeeper + ports: + - 2181:2181 + container_name: zookeeper + volumes: + - /etc/localtime:/etc/localtime + environment: + TZ: Asia/Shanghai + restart: always + + + kafka: + image: wurstmeister/kafka + container_name: kafka + restart: always + environment: + TZ: Asia/Shanghai + KAFKA_BROKER_ID: 0 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_LISTENERS: PLAINTEXT://kafka:9092 + depends_on: + - zookeeper + links: + - zookeeper + ports: + - 9092:9092 + + etcd: + image: quay.io/coreos/etcd + ports: + - 2379:2379 + - 2380:2380 + container_name: etcd + volumes: + - /etc/timezone:/etc/timezone + - /etc/localtime:/etc/localtime + environment: + ETCDCTL_API: 3 + restart: always + command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new + + open_im_api: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_api + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/open_im_api + ports: + - 10000:10000 + links: + - kafka + - mysql + - mongodb + - redis + - etcd + + open_im_auth: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_auth + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/rpc/open_im_auth + ports: + - 10600:10600 + + open_im_user: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_user + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/rpc/open_im_user + ports: + - 10100:10100 + + open_im_friend: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_friend + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/rpc/open_im_friend + ports: + - 10200:10200 + + open_im_group: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_group + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/rpc/open_im_group + ports: + - 10500:10500 + + open_im_push: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_push + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/open_im_push + ports: + - 10700:10700 + + open_im_timed_task: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_timed_task + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/open_im_timer_task + + open_im_offline_msg: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_offline_msg + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/rpc/open_im_msg + ports: + - 10300:10300 + + open_im_msg_transfer: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_msg_transfer + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/open_im_msg_transfer + + open_im_msg_gateway: + build: + dockerfile: dev.Dockerfile + context: . + target: dev + network: host + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + links: + - kafka + - mysql + - mongodb + - redis + - etcd + container_name: open_im_msg_gateway + volumes: + - ./cmd:/Open-IM-Server/cmd + - ./config/config.dev.yaml:/Open-IM-Server/config/config.yaml + - ./internal:/Open-IM-Server/internal + - ./pkg:/Open-IM-Server/pkg + - ./go.mod:/Open-IM-Server/go.mod + - ./go.sum:/Open-IM-Server/go.sum + working_dir: /Open-IM-Server/cmd/open_im_msg_gateway + ports: + - 10400:10400 + - 17778:17778 \ No newline at end of file diff --git a/docker-compose.local.yaml b/docker-compose.local.yaml new file mode 100644 index 000000000..4755f4118 --- /dev/null +++ b/docker-compose.local.yaml @@ -0,0 +1,85 @@ +version: "3" +services: + mysql: + image: mysql:5.7 + ports: + - 3306:3306 + container_name: mysql + volumes: + - ./components/mysql/data:/var/lib/mysql + - /etc/localtime:/etc/localtime + environment: + MYSQL_ROOT_PASSWORD: openIM + restart: always + + mongodb: + image: mongo:4.0 + ports: + - 27017:27017 + container_name: mongo + volumes: + - ./components/mongodb/data:/data/db + environment: + TZ: Asia/Shanghai + restart: always + + redis: + image: redis + ports: + - 6379:6379 + container_name: redis + volumes: + - ./components/redis/data:/data + #redis config file + #- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf + environment: + TZ: Asia/Shanghai + restart: always + sysctls: + net.core.somaxconn: 1024 + command: redis-server --requirepass openIM --appendonly yes + + + zookeeper: + image: wurstmeister/zookeeper + ports: + - 2181:2181 + container_name: zookeeper + volumes: + - /etc/localtime:/etc/localtime + environment: + TZ: Asia/Shanghai + restart: always + + + kafka: + image: wurstmeister/kafka + container_name: kafka + restart: always + environment: + TZ: Asia/Shanghai + KAFKA_BROKER_ID: 0 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092 + KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 + # network_mode: "host" + depends_on: + - zookeeper + links: + - zookeeper + ports: + - 9092:9092 + + etcd: + image: quay.io/coreos/etcd + ports: + - 2379:2379 + - 2380:2380 + container_name: etcd + volumes: + - /etc/timezone:/etc/timezone + - /etc/localtime:/etc/localtime + environment: + ETCDCTL_API: 3 + restart: always + command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new diff --git a/docker-compose.yaml b/docker-compose.yaml index a9fa9a1c9..1d64dcd9f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,7 +15,7 @@ services: restart: always mongodb: - image: mongo + image: mongo:4.0 ports: - 27017:27017 container_name: mongo diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 000000000..9de23d1c1 --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,3480 @@ +// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// This file was generated by swaggo/swag +package docs + +import ( + "bytes" + "encoding/json" + "strings" + "text/template" + + "github.com/swaggo/swag" +) + +var doc = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/auth/user_register": { + "post": { + "description": "register a new user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "parameters": [ + { + "description": "new user params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiAuth.paramsUserRegister" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apiAuth.resultUserRegister" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/auth/user_token": { + "post": { + "description": "get token", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "parameters": [ + { + "description": "get token params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiAuth.paramsUserToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apiAuth.resultUserRegister" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/newest_seq": { + "post": { + "description": "get latest message seq", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "user get latest seq params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserNewestSeq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/apiChat.resultUserNewestSeq" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/pull_msg": { + "post": { + "description": "user pull messages", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "user pull messages", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserPullMsg" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "reqIdentifier": { + "type": "integer" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/pull_msg_by_seq": { + "post": { + "description": "user pull msg by seq", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "pull msg by seq", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserPullMsgBySeqList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "reqIdentifier": { + "type": "integer" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/send_msg": { + "post": { + "description": "user send messages", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "user send messages", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserSendMsg" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apiChat.resultSendMsg" + }, + "reqIdentifier": { + "type": "integer" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/add_blacklist": { + "post": { + "description": "add a user into black list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "add black list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/add_friend": { + "post": { + "description": "add a new friend by uid", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "add friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsAddFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/add_friend_response": { + "post": { + "description": "the response of adding friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "response of adding friend", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsAddFriendResponse" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/delete_friend": { + "post": { + "description": "delete friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "delete friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_blacklist": { + "post": { + "description": "get black list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get black list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.blackListUserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_friend_apply_list": { + "post": { + "description": "get friend apply list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get friend apply list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsGetApplyList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.UserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_friend_list": { + "post": { + "description": "get friend apply list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get friend apply list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsGetFriendLIst" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.friendInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_friends_info": { + "post": { + "description": "get friend info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "search friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_self_apply_list": { + "post": { + "description": "get friend apply list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get friend apply list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsGetApplyList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.UserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/import_friend": { + "post": { + "description": "import friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "import friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsImportFriendReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/friend.resultImportFriend" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/is_friend": { + "post": { + "description": "check is friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "is friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/remove_blacklist": { + "post": { + "description": "remove black list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "remove black list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/set_friend_comment": { + "post": { + "description": "set friend comment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "set friend comment", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSetFriendComment" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/create_group": { + "post": { + "description": "create group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "create group params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsCreateGroup" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_all_member_list": { + "post": { + "description": "get group all members", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group all members params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.getGroupAllMemberReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetGroupMemberListResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_applicationList": { + "post": { + "description": "get group application list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group application list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsGroupApplicationList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/group.resultGroupApplication" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_member_list": { + "post": { + "description": "get group member list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group member list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.GetGroupMemberListReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetGroupMemberListResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_members_info": { + "post": { + "description": "get group members info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group members info params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.GetGroupMembersInfoReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetGroupMembersInfoResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_groups_info": { + "post": { + "description": "get groups info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get groups info params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsGetGroupInfo" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/group.GroupInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_joined_group_list": { + "post": { + "description": "get joined group list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get joined group list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.GetJoinedGroupListReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetJoinedGroupListResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/group_application_response": { + "post": { + "description": "response of application group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "application group param", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsGroupApplicationResponse" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/invite_user_to_group": { + "post": { + "description": "invite user to group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "invite user to group params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.InviteUserToGroupReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.InviteUserToGroupResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/kick_group": { + "post": { + "description": "kick member from group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "kick member from group params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsKickGroupMember" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.KickGroupMemberResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/set_group_info": { + "post": { + "description": "set group info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "set group info params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsSetGroupInfo" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/transfer_group": { + "post": { + "description": "transfer group owner", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "transfer group owner param", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsTransferGroupOwner" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/manager/delete_user": { + "post": { + "description": "delete user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "manage" + ], + "parameters": [ + { + "description": "user to be deleted", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/manage.paramsDeleteUsers" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/manage.deleteUserResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/manager/get_all_users_uid": { + "post": { + "description": "get all user ids", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "manage" + ], + "parameters": [ + { + "description": "all user ids", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/manage.paramsGetAllUsersUid" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/manage.uidListResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/manage.uidListResult" + } + } + } + } + }, + "/manager/send_msg": { + "post": { + "description": "manage send message", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "manage" + ], + "parameters": [ + { + "description": "manage send message", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/manage.paramsManagementSendMsg" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/manage.sendMsgResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/third/user_register": { + "post": { + "description": "get Tencent cloud storage credential", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "third" + ], + "parameters": [ + { + "description": "get Tencent cloud storage credential params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiThird.paramsTencentCloudStorageCredential" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/apiThird.resultTencentCredential" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/user/get_user_info": { + "post": { + "description": "get user info by uid list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "parameters": [ + { + "description": "get userInfo by uidList", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.queryUserInfoParam" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/user.userInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/user/update_user_info": { + "post": { + "description": "update user info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "parameters": [ + { + "description": "new user info", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.updateUserInfoParam" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + } + }, + "definitions": { + "apiAuth.paramsUserRegister": { + "type": "object", + "required": [ + "name", + "platform", + "secret", + "uid" + ], + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "platform": { + "type": "integer" + }, + "secret": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "apiAuth.paramsUserToken": { + "type": "object", + "required": [ + "platform", + "secret", + "uid" + ], + "properties": { + "platform": { + "type": "integer" + }, + "secret": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "apiAuth.resultUserRegister": { + "type": "object", + "properties": { + "expiredTime": { + "type": "integer" + }, + "token": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "apiChat.paramsUserNewestSeq": { + "type": "object", + "required": [ + "msgIncr", + "operationID", + "reqIdentifier", + "sendID" + ], + "properties": { + "msgIncr": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + } + } + }, + "apiChat.paramsUserPullMsg": { + "type": "object", + "required": [ + "operationID", + "reqIdentifier", + "sendID" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "seqBegin", + "seqEnd" + ], + "properties": { + "seqBegin": { + "type": "integer" + }, + "seqEnd": { + "type": "integer" + } + } + }, + "operationID": { + "type": "string" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + } + } + }, + "apiChat.paramsUserPullMsgBySeqList": { + "type": "object", + "required": [ + "operationID", + "reqIdentifier", + "sendID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + }, + "seqList": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "apiChat.paramsUserSendMsg": { + "type": "object", + "required": [ + "operationID", + "platformID", + "reqIdentifier", + "sendID" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "clientMsgID", + "content", + "contentType", + "msgFrom", + "recvID", + "sessionType" + ], + "properties": { + "clientMsgID": { + "type": "string" + }, + "content": { + "type": "string" + }, + "contentType": { + "type": "integer" + }, + "ext": { + "type": "object", + "additionalProperties": true + }, + "forceList": { + "type": "array", + "items": { + "type": "string" + } + }, + "msgFrom": { + "type": "integer" + }, + "offlineInfo": { + "type": "object", + "additionalProperties": true + }, + "options": { + "type": "object", + "additionalProperties": true + }, + "recvID": { + "type": "string" + }, + "sessionType": { + "type": "integer" + } + } + }, + "operationID": { + "type": "string" + }, + "platformID": { + "type": "integer" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + }, + "senderFaceUrl": { + "type": "string" + }, + "senderNickName": { + "type": "string" + } + } + }, + "apiChat.resultSendMsg": { + "type": "object", + "properties": { + "clientMsgID": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "serverMsgID": { + "type": "string" + } + } + }, + "apiChat.resultUserNewestSeq": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "maxSeq": { + "type": "integer" + }, + "minSeq": { + "type": "integer" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + }, + "msgIncr": { + "type": "integer" + }, + "reqIdentifier": { + "type": "integer" + } + } + }, + "apiThird.paramsTencentCloudStorageCredential": { + "type": "object", + "properties": { + "operationID": { + "type": "string" + }, + "token": { + "type": "string" + } + } + }, + "apiThird.resultTencentCredential": { + "type": "object", + "properties": { + "bucket": { + "type": "string" + }, + "data": {}, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + }, + "region": { + "type": "string" + } + } + }, + "friend.UserInfo": { + "type": "object", + "properties": { + "applyTime": { + "type": "string" + }, + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "flag": { + "type": "integer" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "reqMessage": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.blackListUserInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.friendInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "isInBlackList": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsAddFriend": { + "type": "object", + "required": [ + "operationID", + "uid" + ], + "properties": { + "operationID": { + "type": "string" + }, + "reqMessage": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsAddFriendResponse": { + "type": "object", + "required": [ + "flag", + "operationID", + "uid" + ], + "properties": { + "flag": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsGetApplyList": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "friend.paramsGetFriendLIst": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "friend.paramsImportFriendReq": { + "type": "object", + "required": [ + "operationID", + "ownerUid", + "uidList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "ownerUid": { + "type": "string" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "friend.paramsSearchFriend": { + "type": "object", + "required": [ + "operationID", + "uid" + ], + "properties": { + "operationID": { + "type": "string" + }, + "ownerUid": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsSetFriendComment": { + "type": "object", + "required": [ + "operationID", + "uid" + ], + "properties": { + "comment": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.resultFriendInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.resultImportFriend": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "failedUidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "group.GetGroupMemberListReq": { + "type": "object", + "properties": { + "filter": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "nextSeq": { + "type": "integer" + }, + "operationID": { + "type": "string" + } + } + }, + "group.GetGroupMemberListResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "$ref": "#/definitions/group.GroupMemberFullInfo" + } + }, + "nextSeq": { + "type": "integer" + } + } + }, + "group.GetGroupMembersInfoReq": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "group.GetGroupMembersInfoResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/group.MemberResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "group.GetJoinedGroupListReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "group.GetJoinedGroupListResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "groupList": { + "type": "array", + "items": { + "$ref": "#/definitions/group.GroupInfo" + } + } + } + }, + "group.GroupInfo": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "faceUrl": { + "type": "string" + }, + "groupId": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "memberCount": { + "type": "integer" + }, + "notification": { + "type": "string" + }, + "ownerId": { + "type": "string" + } + } + }, + "group.GroupMemberFullInfo": { + "type": "object", + "properties": { + "faceUrl": { + "type": "string" + }, + "joinTime": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "role": { + "type": "integer" + }, + "userId": { + "type": "string" + } + } + }, + "group.Id2Result": { + "type": "object", + "properties": { + "result": { + "type": "integer" + }, + "uId": { + "type": "string" + } + } + }, + "group.InviteUserToGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID", + "uidList" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "group.InviteUserToGroupResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "id2result": { + "type": "array", + "items": { + "$ref": "#/definitions/group.Id2Result" + } + } + } + }, + "group.KickGroupMemberResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "id2result": { + "type": "array", + "items": { + "$ref": "#/definitions/group.Id2Result" + } + } + } + }, + "group.MemberResult": { + "type": "object", + "properties": { + "faceUrl": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "joinTime": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "role": { + "type": "integer" + }, + "userId": { + "type": "string" + } + } + }, + "group.getGroupAllMemberReq": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsCreateGroup": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "ex": { + "type": "string" + }, + "faceUrl": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "memberList": { + "type": "object", + "properties": { + "setRole": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsGetGroupInfo": { + "type": "object", + "required": [ + "groupIDList", + "operationID" + ], + "properties": { + "groupIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsGroupApplicationList": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "group.paramsGroupApplicationListRet": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "flag": { + "type": "integer" + }, + "fromUserFaceURL": { + "type": "string" + }, + "fromUserID": { + "type": "string" + }, + "fromUserNickName": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleStatus": { + "type": "integer" + }, + "handledMsg": { + "type": "string" + }, + "handledUser": { + "type": "string" + }, + "id": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "toUserFaceURL": { + "type": "string" + }, + "toUserID": { + "type": "string" + }, + "toUserNickName": { + "type": "string" + }, + "type": { + "type": "integer" + } + } + }, + "group.paramsGroupApplicationResponse": { + "type": "object", + "required": [ + "fromUserID", + "groupID", + "operationID", + "toUserID" + ], + "properties": { + "addTime": { + "type": "integer" + }, + "fromUserFaceUrl": { + "type": "string" + }, + "fromUserID": { + "type": "string" + }, + "fromUserNickName": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleStatus": { + "type": "integer" + }, + "handledMsg": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "requestMsg": { + "type": "string" + }, + "toUserFaceUrl": { + "type": "string" + }, + "toUserID": { + "type": "string" + }, + "toUserNickName": { + "type": "string" + }, + "type": { + "type": "integer" + } + } + }, + "group.paramsJoinGroup": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "message": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsKickGroupMember": { + "type": "object", + "required": [ + "operationID", + "uidListInfo" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "uidListInfo": { + "type": "array", + "items": { + "type": "object", + "properties": { + "faceUrl": { + "type": "string" + }, + "joinTime": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "role": { + "type": "integer" + }, + "userId": { + "type": "string" + } + } + } + } + } + }, + "group.paramsQuitGroup": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsSetGroupInfo": { + "type": "object", + "required": [ + "groupId", + "operationID" + ], + "properties": { + "faceUrl": { + "type": "string" + }, + "groupId": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsTransferGroupOwner": { + "type": "object", + "required": [ + "groupID", + "operationID", + "uid" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "group.resultGroupApplication": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "user": { + "type": "array", + "items": { + "$ref": "#/definitions/group.paramsGroupApplicationListRet" + } + } + } + }, + "manage.deleteUserResult": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "failedUidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "manage.paramsDeleteUsers": { + "type": "object", + "required": [ + "deleteUidList", + "operationID" + ], + "properties": { + "deleteUidList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "manage.paramsGetAllUsersUid": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "manage.paramsManagementSendMsg": { + "type": "object", + "required": [ + "content", + "contentType", + "operationID", + "recvID", + "sendID", + "sessionType" + ], + "properties": { + "content": { + "type": "object", + "additionalProperties": true + }, + "contentType": { + "type": "integer" + }, + "forceList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "recvID": { + "type": "string" + }, + "sendID": { + "type": "string" + }, + "senderFaceURL": { + "type": "string" + }, + "senderNickName": { + "type": "string" + }, + "sessionType": { + "type": "integer" + } + } + }, + "manage.sendMsgResult": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "msgID": { + "type": "string" + }, + "sendTime": { + "type": "integer" + } + } + }, + "manage.uidListResult": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "user.queryUserInfoParam": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "user.result": { + "type": "object", + "properties": { + "data": {}, + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + } + } + }, + "user.updateUserInfoParam": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "user.userInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + } + } +}` + +type swaggerInfo struct { + Version string + Host string + BasePath string + Schemes []string + Title string + Description string +} + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = swaggerInfo{ + Version: "", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "", + Description: "", +} + +type s struct{} + +func (s *s) ReadDoc() string { + sInfo := SwaggerInfo + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) + + t, err := template.New("swagger_info").Funcs(template.FuncMap{ + "marshal": func(v interface{}) string { + a, _ := json.Marshal(v) + return string(a) + }, + "escape": func(v interface{}) string { + // escape tabs + str := strings.Replace(v.(string), "\t", "\\t", -1) + // replace " with \", and if that results in \\", replace that with \\\" + str = strings.Replace(str, "\"", "\\\"", -1) + return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) + }, + }).Parse(doc) + if err != nil { + return doc + } + + var tpl bytes.Buffer + if err := t.Execute(&tpl, sInfo); err != nil { + return doc + } + + return tpl.String() +} + +func init() { + swag.Register("swagger", &s{}) +} diff --git a/docs/swagger.json b/docs/swagger.json new file mode 100644 index 000000000..2c1131d0f --- /dev/null +++ b/docs/swagger.json @@ -0,0 +1,3407 @@ +{ + "swagger": "2.0", + "info": { + "contact": {} + }, + "paths": { + "/auth/user_register": { + "post": { + "description": "register a new user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "parameters": [ + { + "description": "new user params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiAuth.paramsUserRegister" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apiAuth.resultUserRegister" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/auth/user_token": { + "post": { + "description": "get token", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "auth" + ], + "parameters": [ + { + "description": "get token params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiAuth.paramsUserToken" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apiAuth.resultUserRegister" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/newest_seq": { + "post": { + "description": "get latest message seq", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "user get latest seq params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserNewestSeq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/apiChat.resultUserNewestSeq" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/pull_msg": { + "post": { + "description": "user pull messages", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "user pull messages", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserPullMsg" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "reqIdentifier": { + "type": "integer" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/pull_msg_by_seq": { + "post": { + "description": "user pull msg by seq", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "pull msg by seq", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserPullMsgBySeqList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "reqIdentifier": { + "type": "integer" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/chat/send_msg": { + "post": { + "description": "user send messages", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "chat" + ], + "parameters": [ + { + "description": "user send messages", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiChat.paramsUserSendMsg" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/apiChat.resultSendMsg" + }, + "reqIdentifier": { + "type": "integer" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/add_blacklist": { + "post": { + "description": "add a user into black list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "add black list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/add_friend": { + "post": { + "description": "add a new friend by uid", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "add friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsAddFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/add_friend_response": { + "post": { + "description": "the response of adding friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "response of adding friend", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsAddFriendResponse" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/delete_friend": { + "post": { + "description": "delete friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "delete friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_blacklist": { + "post": { + "description": "get black list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get black list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.blackListUserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_friend_apply_list": { + "post": { + "description": "get friend apply list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get friend apply list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsGetApplyList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.UserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_friend_list": { + "post": { + "description": "get friend apply list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get friend apply list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsGetFriendLIst" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.friendInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_friends_info": { + "post": { + "description": "get friend info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "search friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/get_self_apply_list": { + "post": { + "description": "get friend apply list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "get friend apply list", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsGetApplyList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/friend.UserInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/import_friend": { + "post": { + "description": "import friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "import friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsImportFriendReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/friend.resultImportFriend" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/is_friend": { + "post": { + "description": "check is friend", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "is friend params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/remove_blacklist": { + "post": { + "description": "remove black list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "remove black list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSearchFriend" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/friend/set_friend_comment": { + "post": { + "description": "set friend comment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "friend" + ], + "parameters": [ + { + "description": "set friend comment", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/friend.paramsSetFriendComment" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/create_group": { + "post": { + "description": "create group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "create group params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsCreateGroup" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_all_member_list": { + "post": { + "description": "get group all members", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group all members params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.getGroupAllMemberReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetGroupMemberListResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_applicationList": { + "post": { + "description": "get group application list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group application list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsGroupApplicationList" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/group.resultGroupApplication" + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_member_list": { + "post": { + "description": "get group member list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group member list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.GetGroupMemberListReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetGroupMemberListResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_group_members_info": { + "post": { + "description": "get group members info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get group members info params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.GetGroupMembersInfoReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetGroupMembersInfoResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_groups_info": { + "post": { + "description": "get groups info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get groups info params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsGetGroupInfo" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/group.GroupInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/get_joined_group_list": { + "post": { + "description": "get joined group list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "get joined group list params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.GetJoinedGroupListReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.GetJoinedGroupListResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/group_application_response": { + "post": { + "description": "response of application group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "application group param", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsGroupApplicationResponse" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/invite_user_to_group": { + "post": { + "description": "invite user to group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "invite user to group params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.InviteUserToGroupReq" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.InviteUserToGroupResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/kick_group": { + "post": { + "description": "kick member from group", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "kick member from group params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsKickGroupMember" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/group.KickGroupMemberResp" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/set_group_info": { + "post": { + "description": "set group info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "set group info params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsSetGroupInfo" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/group/transfer_group": { + "post": { + "description": "transfer group owner", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "group" + ], + "parameters": [ + { + "description": "transfer group owner param", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/group.paramsTransferGroupOwner" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/manager/delete_user": { + "post": { + "description": "delete user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "manage" + ], + "parameters": [ + { + "description": "user to be deleted", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/manage.paramsDeleteUsers" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/manage.deleteUserResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/manager/get_all_users_uid": { + "post": { + "description": "get all user ids", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "manage" + ], + "parameters": [ + { + "description": "all user ids", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/manage.paramsGetAllUsersUid" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/manage.uidListResult" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/manage.uidListResult" + } + } + } + } + }, + "/manager/send_msg": { + "post": { + "description": "manage send message", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "manage" + ], + "parameters": [ + { + "description": "manage send message", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/manage.paramsManagementSendMsg" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/manage.sendMsgResult" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/third/user_register": { + "post": { + "description": "get Tencent cloud storage credential", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "third" + ], + "parameters": [ + { + "description": "get Tencent cloud storage credential params", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/apiThird.paramsTencentCloudStorageCredential" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/apiThird.resultTencentCredential" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/user/get_user_info": { + "post": { + "description": "get user info by uid list", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "parameters": [ + { + "description": "get userInfo by uidList", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.queryUserInfoParam" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/user.result" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/user.userInfo" + } + } + } + } + ] + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + }, + "/user/update_user_info": { + "post": { + "description": "update user info", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "user" + ], + "parameters": [ + { + "description": "new user info", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/user.updateUserInfoParam" + } + }, + { + "type": "string", + "description": "token", + "name": "token", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/user.result" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/user.result" + } + } + } + } + } + }, + "definitions": { + "apiAuth.paramsUserRegister": { + "type": "object", + "required": [ + "name", + "platform", + "secret", + "uid" + ], + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "platform": { + "type": "integer" + }, + "secret": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "apiAuth.paramsUserToken": { + "type": "object", + "required": [ + "platform", + "secret", + "uid" + ], + "properties": { + "platform": { + "type": "integer" + }, + "secret": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "apiAuth.resultUserRegister": { + "type": "object", + "properties": { + "expiredTime": { + "type": "integer" + }, + "token": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "apiChat.paramsUserNewestSeq": { + "type": "object", + "required": [ + "msgIncr", + "operationID", + "reqIdentifier", + "sendID" + ], + "properties": { + "msgIncr": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + } + } + }, + "apiChat.paramsUserPullMsg": { + "type": "object", + "required": [ + "operationID", + "reqIdentifier", + "sendID" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "seqBegin", + "seqEnd" + ], + "properties": { + "seqBegin": { + "type": "integer" + }, + "seqEnd": { + "type": "integer" + } + } + }, + "operationID": { + "type": "string" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + } + } + }, + "apiChat.paramsUserPullMsgBySeqList": { + "type": "object", + "required": [ + "operationID", + "reqIdentifier", + "sendID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + }, + "seqList": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "apiChat.paramsUserSendMsg": { + "type": "object", + "required": [ + "operationID", + "platformID", + "reqIdentifier", + "sendID" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "clientMsgID", + "content", + "contentType", + "msgFrom", + "recvID", + "sessionType" + ], + "properties": { + "clientMsgID": { + "type": "string" + }, + "content": { + "type": "string" + }, + "contentType": { + "type": "integer" + }, + "ext": { + "type": "object", + "additionalProperties": true + }, + "forceList": { + "type": "array", + "items": { + "type": "string" + } + }, + "msgFrom": { + "type": "integer" + }, + "offlineInfo": { + "type": "object", + "additionalProperties": true + }, + "options": { + "type": "object", + "additionalProperties": true + }, + "recvID": { + "type": "string" + }, + "sessionType": { + "type": "integer" + } + } + }, + "operationID": { + "type": "string" + }, + "platformID": { + "type": "integer" + }, + "reqIdentifier": { + "type": "integer" + }, + "sendID": { + "type": "string" + }, + "senderFaceUrl": { + "type": "string" + }, + "senderNickName": { + "type": "string" + } + } + }, + "apiChat.resultSendMsg": { + "type": "object", + "properties": { + "clientMsgID": { + "type": "string" + }, + "sendTime": { + "type": "integer" + }, + "serverMsgID": { + "type": "string" + } + } + }, + "apiChat.resultUserNewestSeq": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "maxSeq": { + "type": "integer" + }, + "minSeq": { + "type": "integer" + } + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + }, + "msgIncr": { + "type": "integer" + }, + "reqIdentifier": { + "type": "integer" + } + } + }, + "apiThird.paramsTencentCloudStorageCredential": { + "type": "object", + "properties": { + "operationID": { + "type": "string" + }, + "token": { + "type": "string" + } + } + }, + "apiThird.resultTencentCredential": { + "type": "object", + "properties": { + "bucket": { + "type": "string" + }, + "data": {}, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + }, + "region": { + "type": "string" + } + } + }, + "friend.UserInfo": { + "type": "object", + "properties": { + "applyTime": { + "type": "string" + }, + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "flag": { + "type": "integer" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "reqMessage": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.blackListUserInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.friendInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "isInBlackList": { + "type": "integer" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsAddFriend": { + "type": "object", + "required": [ + "operationID", + "uid" + ], + "properties": { + "operationID": { + "type": "string" + }, + "reqMessage": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsAddFriendResponse": { + "type": "object", + "required": [ + "flag", + "operationID", + "uid" + ], + "properties": { + "flag": { + "type": "integer" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsGetApplyList": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "friend.paramsGetFriendLIst": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "friend.paramsImportFriendReq": { + "type": "object", + "required": [ + "operationID", + "ownerUid", + "uidList" + ], + "properties": { + "operationID": { + "type": "string" + }, + "ownerUid": { + "type": "string" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "friend.paramsSearchFriend": { + "type": "object", + "required": [ + "operationID", + "uid" + ], + "properties": { + "operationID": { + "type": "string" + }, + "ownerUid": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.paramsSetFriendComment": { + "type": "object", + "required": [ + "operationID", + "uid" + ], + "properties": { + "comment": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.resultFriendInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "friend.resultImportFriend": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "failedUidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "group.GetGroupMemberListReq": { + "type": "object", + "properties": { + "filter": { + "type": "integer" + }, + "groupID": { + "type": "string" + }, + "nextSeq": { + "type": "integer" + }, + "operationID": { + "type": "string" + } + } + }, + "group.GetGroupMemberListResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "$ref": "#/definitions/group.GroupMemberFullInfo" + } + }, + "nextSeq": { + "type": "integer" + } + } + }, + "group.GetGroupMembersInfoReq": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "memberList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "group.GetGroupMembersInfoResp": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/group.MemberResult" + } + }, + "errCode": { + "type": "integer" + }, + "errMsg": { + "type": "string" + } + } + }, + "group.GetJoinedGroupListReq": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "group.GetJoinedGroupListResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "groupList": { + "type": "array", + "items": { + "$ref": "#/definitions/group.GroupInfo" + } + } + } + }, + "group.GroupInfo": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "faceUrl": { + "type": "string" + }, + "groupId": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "memberCount": { + "type": "integer" + }, + "notification": { + "type": "string" + }, + "ownerId": { + "type": "string" + } + } + }, + "group.GroupMemberFullInfo": { + "type": "object", + "properties": { + "faceUrl": { + "type": "string" + }, + "joinTime": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "role": { + "type": "integer" + }, + "userId": { + "type": "string" + } + } + }, + "group.Id2Result": { + "type": "object", + "properties": { + "result": { + "type": "integer" + }, + "uId": { + "type": "string" + } + } + }, + "group.InviteUserToGroupReq": { + "type": "object", + "required": [ + "groupID", + "operationID", + "uidList" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "group.InviteUserToGroupResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "id2result": { + "type": "array", + "items": { + "$ref": "#/definitions/group.Id2Result" + } + } + } + }, + "group.KickGroupMemberResp": { + "type": "object", + "properties": { + "errorCode": { + "type": "integer" + }, + "errorMsg": { + "type": "string" + }, + "id2result": { + "type": "array", + "items": { + "$ref": "#/definitions/group.Id2Result" + } + } + } + }, + "group.MemberResult": { + "type": "object", + "properties": { + "faceUrl": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "joinTime": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "role": { + "type": "integer" + }, + "userId": { + "type": "string" + } + } + }, + "group.getGroupAllMemberReq": { + "type": "object", + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsCreateGroup": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "ex": { + "type": "string" + }, + "faceUrl": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "memberList": { + "type": "object", + "properties": { + "setRole": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsGetGroupInfo": { + "type": "object", + "required": [ + "groupIDList", + "operationID" + ], + "properties": { + "groupIDList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsGroupApplicationList": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "group.paramsGroupApplicationListRet": { + "type": "object", + "properties": { + "createTime": { + "type": "integer" + }, + "flag": { + "type": "integer" + }, + "fromUserFaceURL": { + "type": "string" + }, + "fromUserID": { + "type": "string" + }, + "fromUserNickName": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleStatus": { + "type": "integer" + }, + "handledMsg": { + "type": "string" + }, + "handledUser": { + "type": "string" + }, + "id": { + "type": "string" + }, + "reqMsg": { + "type": "string" + }, + "toUserFaceURL": { + "type": "string" + }, + "toUserID": { + "type": "string" + }, + "toUserNickName": { + "type": "string" + }, + "type": { + "type": "integer" + } + } + }, + "group.paramsGroupApplicationResponse": { + "type": "object", + "required": [ + "fromUserID", + "groupID", + "operationID", + "toUserID" + ], + "properties": { + "addTime": { + "type": "integer" + }, + "fromUserFaceUrl": { + "type": "string" + }, + "fromUserID": { + "type": "string" + }, + "fromUserNickName": { + "type": "string" + }, + "groupID": { + "type": "string" + }, + "handleResult": { + "type": "integer" + }, + "handleStatus": { + "type": "integer" + }, + "handledMsg": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "requestMsg": { + "type": "string" + }, + "toUserFaceUrl": { + "type": "string" + }, + "toUserID": { + "type": "string" + }, + "toUserNickName": { + "type": "string" + }, + "type": { + "type": "integer" + } + } + }, + "group.paramsJoinGroup": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "message": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsKickGroupMember": { + "type": "object", + "required": [ + "operationID", + "uidListInfo" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "uidListInfo": { + "type": "array", + "items": { + "type": "object", + "properties": { + "faceUrl": { + "type": "string" + }, + "joinTime": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "role": { + "type": "integer" + }, + "userId": { + "type": "string" + } + } + } + } + } + }, + "group.paramsQuitGroup": { + "type": "object", + "required": [ + "groupID", + "operationID" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsSetGroupInfo": { + "type": "object", + "required": [ + "groupId", + "operationID" + ], + "properties": { + "faceUrl": { + "type": "string" + }, + "groupId": { + "type": "string" + }, + "groupName": { + "type": "string" + }, + "introduction": { + "type": "string" + }, + "notification": { + "type": "string" + }, + "operationID": { + "type": "string" + } + } + }, + "group.paramsTransferGroupOwner": { + "type": "object", + "required": [ + "groupID", + "operationID", + "uid" + ], + "properties": { + "groupID": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "group.resultGroupApplication": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "user": { + "type": "array", + "items": { + "$ref": "#/definitions/group.paramsGroupApplicationListRet" + } + } + } + }, + "manage.deleteUserResult": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "failedUidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "manage.paramsDeleteUsers": { + "type": "object", + "required": [ + "deleteUidList", + "operationID" + ], + "properties": { + "deleteUidList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + } + } + }, + "manage.paramsGetAllUsersUid": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + } + } + }, + "manage.paramsManagementSendMsg": { + "type": "object", + "required": [ + "content", + "contentType", + "operationID", + "recvID", + "sendID", + "sessionType" + ], + "properties": { + "content": { + "type": "object", + "additionalProperties": true + }, + "contentType": { + "type": "integer" + }, + "forceList": { + "type": "array", + "items": { + "type": "string" + } + }, + "operationID": { + "type": "string" + }, + "recvID": { + "type": "string" + }, + "sendID": { + "type": "string" + }, + "senderFaceURL": { + "type": "string" + }, + "senderNickName": { + "type": "string" + }, + "sessionType": { + "type": "integer" + } + } + }, + "manage.sendMsgResult": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "msgID": { + "type": "string" + }, + "sendTime": { + "type": "integer" + } + } + }, + "manage.uidListResult": { + "type": "object", + "properties": { + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "user.queryUserInfoParam": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "operationID": { + "type": "string" + }, + "uidList": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "user.result": { + "type": "object", + "properties": { + "data": {}, + "errCode": { + "type": "integer", + "example": 0 + }, + "errMsg": { + "type": "string", + "example": "error" + } + } + }, + "user.updateUserInfoParam": { + "type": "object", + "required": [ + "operationID" + ], + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "operationID": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + }, + "user.userInfo": { + "type": "object", + "properties": { + "birth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "ex": { + "type": "string" + }, + "gender": { + "type": "integer" + }, + "icon": { + "type": "string" + }, + "mobile": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uid": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml new file mode 100644 index 000000000..517f009d5 --- /dev/null +++ b/docs/swagger.yaml @@ -0,0 +1,2208 @@ +definitions: + apiAuth.paramsUserRegister: + properties: + birth: + type: string + email: + type: string + ex: + type: string + gender: + type: integer + icon: + type: string + mobile: + type: string + name: + type: string + platform: + type: integer + secret: + type: string + uid: + type: string + required: + - name + - platform + - secret + - uid + type: object + apiAuth.paramsUserToken: + properties: + platform: + type: integer + secret: + type: string + uid: + type: string + required: + - platform + - secret + - uid + type: object + apiAuth.resultUserRegister: + properties: + expiredTime: + type: integer + token: + type: string + uid: + type: string + type: object + apiChat.paramsUserNewestSeq: + properties: + msgIncr: + type: integer + operationID: + type: string + reqIdentifier: + type: integer + sendID: + type: string + required: + - msgIncr + - operationID + - reqIdentifier + - sendID + type: object + apiChat.paramsUserPullMsg: + properties: + data: + properties: + seqBegin: + type: integer + seqEnd: + type: integer + required: + - seqBegin + - seqEnd + type: object + operationID: + type: string + reqIdentifier: + type: integer + sendID: + type: string + required: + - operationID + - reqIdentifier + - sendID + type: object + apiChat.paramsUserPullMsgBySeqList: + properties: + operationID: + type: string + reqIdentifier: + type: integer + sendID: + type: string + seqList: + items: + type: integer + type: array + required: + - operationID + - reqIdentifier + - sendID + type: object + apiChat.paramsUserSendMsg: + properties: + data: + properties: + clientMsgID: + type: string + content: + type: string + contentType: + type: integer + ext: + additionalProperties: true + type: object + forceList: + items: + type: string + type: array + msgFrom: + type: integer + offlineInfo: + additionalProperties: true + type: object + options: + additionalProperties: true + type: object + recvID: + type: string + sessionType: + type: integer + required: + - clientMsgID + - content + - contentType + - msgFrom + - recvID + - sessionType + type: object + operationID: + type: string + platformID: + type: integer + reqIdentifier: + type: integer + sendID: + type: string + senderFaceUrl: + type: string + senderNickName: + type: string + required: + - operationID + - platformID + - reqIdentifier + - sendID + type: object + apiChat.resultSendMsg: + properties: + clientMsgID: + type: string + sendTime: + type: integer + serverMsgID: + type: string + type: object + apiChat.resultUserNewestSeq: + properties: + data: + properties: + maxSeq: + type: integer + minSeq: + type: integer + type: object + errCode: + type: integer + errMsg: + type: string + msgIncr: + type: integer + reqIdentifier: + type: integer + type: object + apiThird.paramsTencentCloudStorageCredential: + properties: + operationID: + type: string + token: + type: string + type: object + apiThird.resultTencentCredential: + properties: + bucket: + type: string + data: {} + errCode: + type: integer + errMsg: + type: string + region: + type: string + type: object + friend.UserInfo: + properties: + applyTime: + type: string + birth: + type: string + email: + type: string + ex: + type: string + flag: + type: integer + gender: + type: integer + icon: + type: string + mobile: + type: string + name: + type: string + reqMessage: + type: string + uid: + type: string + type: object + friend.blackListUserInfo: + properties: + birth: + type: string + email: + type: string + ex: + type: string + gender: + type: integer + icon: + type: string + mobile: + type: string + name: + type: string + uid: + type: string + type: object + friend.friendInfo: + properties: + birth: + type: string + comment: + type: string + email: + type: string + ex: + type: string + gender: + type: integer + icon: + type: string + isInBlackList: + type: integer + mobile: + type: string + name: + type: string + uid: + type: string + type: object + friend.paramsAddFriend: + properties: + operationID: + type: string + reqMessage: + type: string + uid: + type: string + required: + - operationID + - uid + type: object + friend.paramsAddFriendResponse: + properties: + flag: + type: integer + operationID: + type: string + uid: + type: string + required: + - flag + - operationID + - uid + type: object + friend.paramsGetApplyList: + properties: + operationID: + type: string + required: + - operationID + type: object + friend.paramsGetFriendLIst: + properties: + operationID: + type: string + required: + - operationID + type: object + friend.paramsImportFriendReq: + properties: + operationID: + type: string + ownerUid: + type: string + uidList: + items: + type: string + type: array + required: + - operationID + - ownerUid + - uidList + type: object + friend.paramsSearchFriend: + properties: + operationID: + type: string + ownerUid: + type: string + uid: + type: string + required: + - operationID + - uid + type: object + friend.paramsSetFriendComment: + properties: + comment: + type: string + operationID: + type: string + uid: + type: string + required: + - operationID + - uid + type: object + friend.resultFriendInfo: + properties: + birth: + type: string + comment: + type: string + email: + type: string + ex: + type: string + gender: + type: integer + icon: + type: string + mobile: + type: string + name: + type: string + uid: + type: string + type: object + friend.resultImportFriend: + properties: + errCode: + example: 0 + type: integer + errMsg: + example: error + type: string + failedUidList: + items: + type: string + type: array + type: object + group.GetGroupMemberListReq: + properties: + filter: + type: integer + groupID: + type: string + nextSeq: + type: integer + operationID: + type: string + type: object + group.GetGroupMemberListResp: + properties: + errorCode: + type: integer + errorMsg: + type: string + memberList: + items: + $ref: '#/definitions/group.GroupMemberFullInfo' + type: array + nextSeq: + type: integer + type: object + group.GetGroupMembersInfoReq: + properties: + groupID: + type: string + memberList: + items: + type: string + type: array + operationID: + type: string + type: object + group.GetGroupMembersInfoResp: + properties: + data: + items: + $ref: '#/definitions/group.MemberResult' + type: array + errCode: + type: integer + errMsg: + type: string + type: object + group.GetJoinedGroupListReq: + properties: + operationID: + type: string + required: + - operationID + type: object + group.GetJoinedGroupListResp: + properties: + errorCode: + type: integer + errorMsg: + type: string + groupList: + items: + $ref: '#/definitions/group.GroupInfo' + type: array + type: object + group.GroupInfo: + properties: + createTime: + type: integer + faceUrl: + type: string + groupId: + type: string + groupName: + type: string + introduction: + type: string + memberCount: + type: integer + notification: + type: string + ownerId: + type: string + type: object + group.GroupMemberFullInfo: + properties: + faceUrl: + type: string + joinTime: + type: integer + nickName: + type: string + role: + type: integer + userId: + type: string + type: object + group.Id2Result: + properties: + result: + type: integer + uId: + type: string + type: object + group.InviteUserToGroupReq: + properties: + groupID: + type: string + operationID: + type: string + reason: + type: string + uidList: + items: + type: string + type: array + required: + - groupID + - operationID + - uidList + type: object + group.InviteUserToGroupResp: + properties: + errorCode: + type: integer + errorMsg: + type: string + id2result: + items: + $ref: '#/definitions/group.Id2Result' + type: array + type: object + group.KickGroupMemberResp: + properties: + errorCode: + type: integer + errorMsg: + type: string + id2result: + items: + $ref: '#/definitions/group.Id2Result' + type: array + type: object + group.MemberResult: + properties: + faceUrl: + type: string + groupID: + type: string + joinTime: + type: integer + nickName: + type: string + role: + type: integer + userId: + type: string + type: object + group.getGroupAllMemberReq: + properties: + groupID: + type: string + operationID: + type: string + type: object + group.paramsCreateGroup: + properties: + ex: + type: string + faceUrl: + type: string + groupName: + type: string + introduction: + type: string + memberList: + properties: + setRole: + type: string + uid: + type: string + type: object + notification: + type: string + operationID: + type: string + required: + - operationID + type: object + group.paramsGetGroupInfo: + properties: + groupIDList: + items: + type: string + type: array + operationID: + type: string + required: + - groupIDList + - operationID + type: object + group.paramsGroupApplicationList: + properties: + operationID: + type: string + required: + - operationID + type: object + group.paramsGroupApplicationListRet: + properties: + createTime: + type: integer + flag: + type: integer + fromUserFaceURL: + type: string + fromUserID: + type: string + fromUserNickName: + type: string + groupID: + type: string + handleResult: + type: integer + handleStatus: + type: integer + handledMsg: + type: string + handledUser: + type: string + id: + type: string + reqMsg: + type: string + toUserFaceURL: + type: string + toUserID: + type: string + toUserNickName: + type: string + type: + type: integer + type: object + group.paramsGroupApplicationResponse: + properties: + addTime: + type: integer + fromUserFaceUrl: + type: string + fromUserID: + type: string + fromUserNickName: + type: string + groupID: + type: string + handleResult: + type: integer + handleStatus: + type: integer + handledMsg: + type: string + operationID: + type: string + requestMsg: + type: string + toUserFaceUrl: + type: string + toUserID: + type: string + toUserNickName: + type: string + type: + type: integer + required: + - fromUserID + - groupID + - operationID + - toUserID + type: object + group.paramsJoinGroup: + properties: + groupID: + type: string + message: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + group.paramsKickGroupMember: + properties: + groupID: + type: string + operationID: + type: string + reason: + type: string + uidListInfo: + items: + properties: + faceUrl: + type: string + joinTime: + type: integer + nickName: + type: string + role: + type: integer + userId: + type: string + type: object + type: array + required: + - operationID + - uidListInfo + type: object + group.paramsQuitGroup: + properties: + groupID: + type: string + operationID: + type: string + required: + - groupID + - operationID + type: object + group.paramsSetGroupInfo: + properties: + faceUrl: + type: string + groupId: + type: string + groupName: + type: string + introduction: + type: string + notification: + type: string + operationID: + type: string + required: + - groupId + - operationID + type: object + group.paramsTransferGroupOwner: + properties: + groupID: + type: string + operationID: + type: string + uid: + type: string + required: + - groupID + - operationID + - uid + type: object + group.resultGroupApplication: + properties: + count: + type: integer + user: + items: + $ref: '#/definitions/group.paramsGroupApplicationListRet' + type: array + type: object + manage.deleteUserResult: + properties: + errCode: + example: 0 + type: integer + errMsg: + example: error + type: string + failedUidList: + items: + type: string + type: array + type: object + manage.paramsDeleteUsers: + properties: + deleteUidList: + items: + type: string + type: array + operationID: + type: string + required: + - deleteUidList + - operationID + type: object + manage.paramsGetAllUsersUid: + properties: + operationID: + type: string + required: + - operationID + type: object + manage.paramsManagementSendMsg: + properties: + content: + additionalProperties: true + type: object + contentType: + type: integer + forceList: + items: + type: string + type: array + operationID: + type: string + recvID: + type: string + sendID: + type: string + senderFaceURL: + type: string + senderNickName: + type: string + sessionType: + type: integer + required: + - content + - contentType + - operationID + - recvID + - sendID + - sessionType + type: object + manage.sendMsgResult: + properties: + errCode: + example: 0 + type: integer + errMsg: + example: error + type: string + msgID: + type: string + sendTime: + type: integer + type: object + manage.uidListResult: + properties: + errCode: + example: 0 + type: integer + errMsg: + example: error + type: string + uidList: + items: + type: string + type: array + type: object + user.queryUserInfoParam: + properties: + operationID: + type: string + uidList: + items: + type: string + type: array + required: + - operationID + type: object + user.result: + properties: + data: {} + errCode: + example: 0 + type: integer + errMsg: + example: error + type: string + type: object + user.updateUserInfoParam: + properties: + birth: + type: string + email: + type: string + ex: + type: string + gender: + type: integer + icon: + type: string + mobile: + type: string + name: + type: string + operationID: + type: string + uid: + type: string + required: + - operationID + type: object + user.userInfo: + properties: + birth: + type: string + email: + type: string + ex: + type: string + gender: + type: integer + icon: + type: string + mobile: + type: string + name: + type: string + uid: + type: string + type: object +info: + contact: {} +paths: + /auth/user_register: + post: + consumes: + - application/json + description: register a new user + parameters: + - description: new user params + in: body + name: body + required: true + schema: + $ref: '#/definitions/apiAuth.paramsUserRegister' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + $ref: '#/definitions/apiAuth.resultUserRegister' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - auth + /auth/user_token: + post: + consumes: + - application/json + description: get token + parameters: + - description: get token params + in: body + name: body + required: true + schema: + $ref: '#/definitions/apiAuth.paramsUserToken' + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + $ref: '#/definitions/apiAuth.resultUserRegister' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - auth + /chat/newest_seq: + post: + consumes: + - application/json + description: get latest message seq + parameters: + - description: user get latest seq params + in: body + name: body + required: true + schema: + $ref: '#/definitions/apiChat.paramsUserNewestSeq' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/apiChat.resultUserNewestSeq' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - chat + /chat/pull_msg: + post: + consumes: + - application/json + description: user pull messages + parameters: + - description: user pull messages + in: body + name: body + required: true + schema: + $ref: '#/definitions/apiChat.paramsUserPullMsg' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + reqIdentifier: + type: integer + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - chat + /chat/pull_msg_by_seq: + post: + consumes: + - application/json + description: user pull msg by seq + parameters: + - description: pull msg by seq + in: body + name: body + required: true + schema: + $ref: '#/definitions/apiChat.paramsUserPullMsgBySeqList' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + reqIdentifier: + type: integer + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - chat + /chat/send_msg: + post: + consumes: + - application/json + description: user send messages + parameters: + - description: user send messages + in: body + name: body + required: true + schema: + $ref: '#/definitions/apiChat.paramsUserSendMsg' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + $ref: '#/definitions/apiChat.resultSendMsg' + reqIdentifier: + type: integer + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + tags: + - chat + /friend/add_blacklist: + post: + consumes: + - application/json + description: add a user into black list + parameters: + - description: add black list params + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsSearchFriend' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/add_friend: + post: + consumes: + - application/json + description: add a new friend by uid + parameters: + - description: add friend params + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsAddFriend' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/add_friend_response: + post: + consumes: + - application/json + description: the response of adding friend + parameters: + - description: response of adding friend + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsAddFriendResponse' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/delete_friend: + post: + consumes: + - application/json + description: delete friend + parameters: + - description: delete friend params + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsSearchFriend' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/get_blacklist: + post: + consumes: + - application/json + description: get black list + parameters: + - description: get black list + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsSearchFriend' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + items: + $ref: '#/definitions/friend.blackListUserInfo' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/get_friend_apply_list: + post: + consumes: + - application/json + description: get friend apply list + parameters: + - description: get friend apply list + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsGetApplyList' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + items: + $ref: '#/definitions/friend.UserInfo' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/get_friend_list: + post: + consumes: + - application/json + description: get friend apply list + parameters: + - description: get friend apply list + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsGetFriendLIst' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + items: + $ref: '#/definitions/friend.friendInfo' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/get_friends_info: + post: + consumes: + - application/json + description: get friend info + parameters: + - description: search friend params + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsSearchFriend' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/get_self_apply_list: + post: + consumes: + - application/json + description: get friend apply list + parameters: + - description: get friend apply list + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsGetApplyList' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + items: + $ref: '#/definitions/friend.UserInfo' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/import_friend: + post: + consumes: + - application/json + description: import friend + parameters: + - description: import friend params + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsImportFriendReq' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/friend.resultImportFriend' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/is_friend: + post: + consumes: + - application/json + description: check is friend + parameters: + - description: is friend params + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsSearchFriend' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/remove_blacklist: + post: + consumes: + - application/json + description: remove black list + parameters: + - description: remove black list params + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsSearchFriend' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /friend/set_friend_comment: + post: + consumes: + - application/json + description: set friend comment + parameters: + - description: set friend comment + in: body + name: body + required: true + schema: + $ref: '#/definitions/friend.paramsSetFriendComment' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - friend + /group/create_group: + post: + consumes: + - application/json + description: create group + parameters: + - description: create group params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.paramsCreateGroup' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/get_group_all_member_list: + post: + consumes: + - application/json + description: get group all members + parameters: + - description: get group all members params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.getGroupAllMemberReq' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/group.GetGroupMemberListResp' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/get_group_applicationList: + post: + consumes: + - application/json + description: get group application list + parameters: + - description: get group application list params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.paramsGroupApplicationList' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + $ref: '#/definitions/group.resultGroupApplication' + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/get_group_member_list: + post: + consumes: + - application/json + description: get group member list + parameters: + - description: get group member list params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.GetGroupMemberListReq' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/group.GetGroupMemberListResp' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/get_group_members_info: + post: + consumes: + - application/json + description: get group members info + parameters: + - description: get group members info params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.GetGroupMembersInfoReq' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/group.GetGroupMembersInfoResp' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/get_groups_info: + post: + consumes: + - application/json + description: get groups info + parameters: + - description: get groups info params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.paramsGetGroupInfo' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + items: + $ref: '#/definitions/group.GroupInfo' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/get_joined_group_list: + post: + consumes: + - application/json + description: get joined group list + parameters: + - description: get joined group list params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.GetJoinedGroupListReq' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/group.GetJoinedGroupListResp' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/group_application_response: + post: + consumes: + - application/json + description: response of application group + parameters: + - description: application group param + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.paramsGroupApplicationResponse' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/invite_user_to_group: + post: + consumes: + - application/json + description: invite user to group + parameters: + - description: invite user to group params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.InviteUserToGroupReq' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/group.InviteUserToGroupResp' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/kick_group: + post: + consumes: + - application/json + description: kick member from group + parameters: + - description: kick member from group params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.paramsKickGroupMember' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/group.KickGroupMemberResp' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/set_group_info: + post: + consumes: + - application/json + description: set group info + parameters: + - description: set group info params + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.paramsSetGroupInfo' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /group/transfer_group: + post: + consumes: + - application/json + description: transfer group owner + parameters: + - description: transfer group owner param + in: body + name: body + required: true + schema: + $ref: '#/definitions/group.paramsTransferGroupOwner' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - group + /manager/delete_user: + post: + consumes: + - application/json + description: delete user + parameters: + - description: user to be deleted + in: body + name: body + required: true + schema: + $ref: '#/definitions/manage.paramsDeleteUsers' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/manage.deleteUserResult' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - manage + /manager/get_all_users_uid: + post: + consumes: + - application/json + description: get all user ids + parameters: + - description: all user ids + in: body + name: body + required: true + schema: + $ref: '#/definitions/manage.paramsGetAllUsersUid' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/manage.uidListResult' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/manage.uidListResult' + tags: + - manage + /manager/send_msg: + post: + consumes: + - application/json + description: manage send message + parameters: + - description: manage send message + in: body + name: body + required: true + schema: + $ref: '#/definitions/manage.paramsManagementSendMsg' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/manage.sendMsgResult' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - manage + /third/user_register: + post: + consumes: + - application/json + description: get Tencent cloud storage credential + parameters: + - description: get Tencent cloud storage credential params + in: body + name: body + required: true + schema: + $ref: '#/definitions/apiThird.paramsTencentCloudStorageCredential' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/apiThird.resultTencentCredential' + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - third + /user/get_user_info: + post: + consumes: + - application/json + description: get user info by uid list + parameters: + - description: get userInfo by uidList + in: body + name: body + required: true + schema: + $ref: '#/definitions/user.queryUserInfoParam' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/user.result' + - properties: + data: + items: + $ref: '#/definitions/user.userInfo' + type: array + type: object + "400": + description: Bad Request + schema: + $ref: '#/definitions/user.result' + tags: + - user + /user/update_user_info: + post: + consumes: + - application/json + description: update user info + parameters: + - description: new user info + in: body + name: body + required: true + schema: + $ref: '#/definitions/user.updateUserInfoParam' + - description: token + in: header + name: token + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/user.result' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/user.result' + tags: + - user +swagger: "2.0" diff --git a/go.mod b/go.mod index ac0c9edf0..dff96a634 100644 --- a/go.mod +++ b/go.mod @@ -6,18 +6,21 @@ require ( github.com/Shopify/sarama v1.19.0 github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect github.com/antonfisher/nested-logrus-formatter v1.3.0 + github.com/bwmarrin/snowflake v0.3.0 github.com/coreos/go-semver v0.3.0 // indirect - github.com/dgrijalva/jwt-go v3.2.0+incompatible + github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/eapache/go-resiliency v1.2.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect github.com/eapache/queue v1.1.0 // indirect - github.com/frankban/quicktest v1.11.3 // indirect + github.com/frankban/quicktest v1.14.0 // indirect github.com/garyburd/redigo v1.6.2 - github.com/gin-gonic/gin v1.7.0 + github.com/gin-gonic/gin v1.7.4 + github.com/go-openapi/spec v0.20.4 // indirect github.com/go-playground/validator/v10 v10.4.1 + github.com/golang-jwt/jwt/v4 v4.1.0 github.com/golang/protobuf v1.5.2 - github.com/golang/snappy v0.0.3 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/gorilla/websocket v1.4.2 github.com/jinzhu/gorm v1.9.16 github.com/jonboulle/clockwork v0.2.2 // indirect @@ -28,21 +31,25 @@ require ( github.com/mitchellh/mapstructure v1.4.1 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/olivere/elastic/v7 v7.0.23 - github.com/pierrec/lz4 v2.6.0+incompatible // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 - github.com/sirupsen/logrus v1.6.0 + github.com/sirupsen/logrus v1.8.1 + github.com/stretchr/testify v1.7.0 + github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 // indirect + github.com/swaggo/gin-swagger v1.3.3 // indirect + github.com/swaggo/swag v1.7.4 // indirect github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698 golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb - golang.org/x/net v0.0.0-20201110031124-69a78807bb2b - golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect + golang.org/x/net v0.0.0-20211111160137-58aab5ef257a + golang.org/x/sys v0.0.0-20211112143042-c6105e7cf70d // indirect + golang.org/x/tools v0.1.7 // indirect google.golang.org/grpc v1.33.2 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b sigs.k8s.io/yaml v1.2.0 // indirect - ) replace google.golang.org/grpc => google.golang.org/grpc v1.29.1 diff --git a/go.sum b/go.sum index fbbe5ea96..56ac84b4c 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,12 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0 h1:9oksLxC6uxVPHPVYUmq6xhr1BOF/hHobWH2UzO67z1s= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= @@ -15,6 +21,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= +github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= @@ -24,7 +32,12 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -48,32 +61,57 @@ github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/garyburd/redigo v1.6.2 h1:yE/pwKCrbLpLpQICzYTeZ7JsTA/C53wFTJHaEtRqniM= github.com/garyburd/redigo v1.6.2/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/gzip v0.0.3/go.mod h1:YxxswVZIqOvcHEQpsSn+QF5guQtO1dCfy0shBPy4jFc= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.4 h1:QmUZXrvJ9qZ3GfWvQ+2wnW/1ePrTEJqPKMYEU3lD/DM= +github.com/gin-gonic/gin v1.7.4/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/spec v0.20.3 h1:uH9RQ6vdyPSs2pSy9fL8QPspDF2AMIMPtmK5coSSjtQ= +github.com/go-openapi/spec v0.20.3/go.mod h1:gG4F8wdEDN+YPBMVnzE85Rbhf+Th2DTvA9nFPQ5AYEg= +github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= +github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -94,8 +132,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -103,9 +141,10 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= @@ -141,15 +180,16 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= @@ -161,6 +201,9 @@ github.com/lestrrat-go/strftime v1.0.4/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR7 github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -184,12 +227,13 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olivere/elastic/v7 v7.0.23 h1:b7tjMogDMhf2CisGI+L02LXLVa0ZyE82Z15XfW1e8t8= github.com/olivere/elastic/v7 v7.0.23/go.mod h1:OuWmD2DiuYhddWegBKPWQuelVKBLrW0fa/VUYgxuGTY= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= -github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= +github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -214,10 +258,19 @@ github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnH github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v1.1.1/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= github.com/smartystreets/gunit v1.4.2/go.mod h1:ZjM1ozSIMJlAz/ay4SG8PeKF00ckUp+zMHZXV9/bvak= @@ -231,8 +284,16 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= +github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 h1:+iNTcqQJy0OZ5jk6a5NLib47eqXK8uYcPX+O4+cBpEM= +github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= +github.com/swaggo/gin-swagger v1.3.3 h1:XHyYmeNVFG5PbyWHG4jXtxOm2P4kiZapDCWsyDDiQ/I= +github.com/swaggo/gin-swagger v1.3.3/go.mod h1:ymsZuGpbbu+S7ZoQ49QPpZoDBj6uqhb8WizgQPVgWl0= +github.com/swaggo/swag v1.7.4 h1:up+ixy8yOqJKiFcuhMgkuYuF4xnevuhnFAXXF8OSfNg= +github.com/swaggo/swag v1.7.4/go.mod h1:zD8h6h4SPv7t3l+4BKdRquqW1ASWjKZgT6Qv9z3kNqI= github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca h1:G/aIr3WiUesWHL2YGYgEqjM5tCAJ43Ml+0C18wDkWWs= github.com/tencentyun/qcloud-cos-sts-sdk v0.0.0-20210325043845-84a0811633ca/go.mod h1:b18KQa4IxHbxeseW1GcZox53d7J0z39VNONTxvvlkXw= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -242,10 +303,14 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698 h1:jWtjCJX1qxhHISBMLRztWwR+EXkI7MJAF2HjHAE/x/I= @@ -277,6 +342,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -286,31 +352,52 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210917221730-978cfadd31cf h1:R150MpwJIv1MpS0N/pc+NhTM8ajzvlmxlY5OYsrevXQ= +golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211111160137-58aab5ef257a h1:c83jeVQW0KGKNaKBRfelNYNHaev+qawl9yaA825s8XE= +golang.org/x/net v0.0.0-20211111160137-58aab5ef257a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211112143042-c6105e7cf70d h1:jp6PtFmjL+vGsuzd86xYqaJGv6eXdLvmVGzVVLI6EPI= +golang.org/x/sys v0.0.0-20211112143042-c6105e7cf70d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2IVY3KZs6p9mix0ziNYJM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -323,6 +410,10 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= +golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -347,6 +438,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= @@ -355,10 +447,15 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= diff --git a/internal/api/auth/user_register.go b/internal/api/auth/user_register.go index 3f840d1a6..40e039e12 100644 --- a/internal/api/auth/user_register.go +++ b/internal/api/auth/user_register.go @@ -1,16 +1,17 @@ package apiAuth import ( - pbAuth "Open_IM/pkg/proto/auth" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAuth "Open_IM/pkg/proto/auth" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsUserRegister struct type paramsUserRegister struct { Secret string `json:"secret" binding:"required,max=32"` Platform int32 `json:"platform" binding:"required,min=1,max=7"` @@ -24,6 +25,13 @@ type paramsUserRegister struct { Ex string `json:"ex" binding:"omitempty,max=1024"` } +// resultUserRegister struct +type resultUserRegister struct { + UID string `json:"uid"` + Token string `json:"token"` + ExpiredTime int64 `json:"expiredTime"` +} + func newUserRegisterReq(params *paramsUserRegister) *pbAuth.UserRegisterReq { pbData := pbAuth.UserRegisterReq{ UID: params.UID, @@ -38,9 +46,20 @@ func newUserRegisterReq(params *paramsUserRegister) *pbAuth.UserRegisterReq { return &pbData } +// @Summary +// @Schemes +// @Description register a new user +// @Tags auth +// @Accept json +// @Produce json +// @Param body body apiAuth.paramsUserRegister true "new user params" +// @Success 200 {object} user.result{data=apiAuth.resultUserRegister} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /auth/user_register [post] func UserRegister(c *gin.Context) { log.Info("", "", "api user_register init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + etcdConn := getcdv3.GetAuthConn() client := pbAuth.NewAuthClient(etcdConn) //defer etcdConn.Close() @@ -49,6 +68,10 @@ func UserRegister(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } + if params.Secret != config.Config.Secret { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) + return + } pbData := newUserRegisterReq(¶ms) log.Info("", "", "api user_register is server, [data: %s]", pbData.String()) diff --git a/internal/api/auth/user_register_test.go b/internal/api/auth/user_register_test.go new file mode 100644 index 000000000..edebbbf79 --- /dev/null +++ b/internal/api/auth/user_register_test.go @@ -0,0 +1,25 @@ +package apiAuth + +import ( + "bytes" + "net/http" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" +) + +func init() { + gin.SetMode(gin.TestMode) +} + +func Test_UserRegister(t *testing.T) { + res := httptest.NewRecorder() + c, _ := gin.CreateTestContext(res) + c.Request, _ = http.NewRequest("POST", "/", bytes.NewBufferString(`{"secret": "tuoyun", "platform": 1, "uid": "3", "name": "1"}`)) + + UserRegister(c) + + assert.Equal(t, res.Code, 200) +} diff --git a/internal/api/auth/user_token.go b/internal/api/auth/user_token.go index 83c923d21..3f37b9ea9 100644 --- a/internal/api/auth/user_token.go +++ b/internal/api/auth/user_token.go @@ -1,16 +1,17 @@ package apiAuth import ( - pbAuth "Open_IM/pkg/proto/auth" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAuth "Open_IM/pkg/proto/auth" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsUserToken struct type paramsUserToken struct { Secret string `json:"secret" binding:"required,max=32"` Platform int32 `json:"platform" binding:"required,min=1,max=8"` @@ -25,9 +26,20 @@ func newUserTokenReq(params *paramsUserToken) *pbAuth.UserTokenReq { return &pbData } +// @Summary +// @Schemes +// @Description get token +// @Tags auth +// @Accept json +// @Produce json +// @Param body body apiAuth.paramsUserToken true "get token params" +// @Success 200 {object} user.result{data=apiAuth.resultUserRegister} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /auth/user_token [post] func UserToken(c *gin.Context) { log.Info("", "", "api user_token init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + etcdConn := getcdv3.GetAuthConn() client := pbAuth.NewAuthClient(etcdConn) //defer etcdConn.Close() @@ -37,6 +49,10 @@ func UserToken(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return } + if params.Secret != config.Config.Secret { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) + return + } pbData := newUserTokenReq(¶ms) log.Info("", "", "api user_token is server, [data: %s]", pbData.String()) diff --git a/internal/api/chat/newest_seq.go b/internal/api/chat/get_max_min_seq.go similarity index 55% rename from internal/api/chat/newest_seq.go rename to internal/api/chat/get_max_min_seq.go index 06dad284e..916d919e9 100644 --- a/internal/api/chat/newest_seq.go +++ b/internal/api/chat/get_max_min_seq.go @@ -1,17 +1,17 @@ package apiChat import ( - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbMsg "Open_IM/pkg/proto/chat" "Open_IM/pkg/utils" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsUserNewestSeq struct type paramsUserNewestSeq struct { ReqIdentifier int `json:"reqIdentifier" binding:"required"` SendID string `json:"sendID" binding:"required"` @@ -19,7 +19,31 @@ type paramsUserNewestSeq struct { MsgIncr int `json:"msgIncr" binding:"required"` } -func UserNewestSeq(c *gin.Context) { +// resultUserNewestSeq struct +type resultUserNewestSeq struct { + ErrCode int32 `json:"errCode` + ErrMsg string `json:"errMsg"` + MsgIncr int `json:"msgIncr"` + ReqIdentifier int `json:"reqIdentifier"` + Data struct { + MaxSeq int64 `json:"maxSeq,omitempty"` + MinSeq int64 `json:"minSeq,omitempty"` + } `json:"data"` +} + +// @Summary +// @Schemes +// @Description get latest message seq +// @Tags chat +// @Accept json +// @Produce json +// @Param body body apiChat.paramsUserNewestSeq true "user get latest seq params" +// @Param token header string true "token" +// @Success 200 {object} apiChat.resultUserNewestSeq +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /chat/newest_seq [post] +func UserGetSeq(c *gin.Context) { params := paramsUserNewestSeq{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) @@ -31,18 +55,19 @@ func UserNewestSeq(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) return } - pbData := pbMsg.GetNewSeqReq{} + pbData := pbMsg.GetMaxAndMinSeqReq{} pbData.UserID = params.SendID pbData.OperationID = params.OperationID - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetOfflineMessageConn() if grpcConn == nil { log.ErrorByKv("get grpcConn err", pbData.OperationID, "args", params) } msgClient := pbMsg.NewChatClient(grpcConn) - reply, err := msgClient.GetNewSeq(context.Background(), &pbData) + reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) if err != nil { log.ErrorByKv("rpc call failed to getNewSeq", pbData.OperationID, "err", err, "pbData", pbData.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) return } @@ -52,7 +77,8 @@ func UserNewestSeq(c *gin.Context) { "msgIncr": params.MsgIncr, "reqIdentifier": params.ReqIdentifier, "data": gin.H{ - "seq": reply.Seq, + "maxSeq": reply.MaxSeq, + "minSeq": reply.MinSeq, }, }) diff --git a/internal/api/chat/pull_msg.go b/internal/api/chat/pull_msg.go index b8224064d..14103b6e4 100644 --- a/internal/api/chat/pull_msg.go +++ b/internal/api/chat/pull_msg.go @@ -1,17 +1,17 @@ package apiChat import ( - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" - "Open_IM/pkg/proto/chat" + pbChat "Open_IM/pkg/proto/chat" "Open_IM/pkg/utils" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsUserPullMsg struct type paramsUserPullMsg struct { ReqIdentifier *int `json:"reqIdentifier" binding:"required"` SendID string `json:"sendID" binding:"required"` @@ -22,6 +22,18 @@ type paramsUserPullMsg struct { } } +// @Summary +// @Schemes +// @Description user pull messages +// @Tags chat +// @Accept json +// @Produce json +// @Param body body apiChat.paramsUserPullMsg true "user pull messages" +// @Param token header string true "token" +// @Success 200 {object} user.result{reqIdentifier=int} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /chat/pull_msg [post] func UserPullMsg(c *gin.Context) { params := paramsUserPullMsg{} if err := c.BindJSON(¶ms); err != nil { @@ -39,7 +51,7 @@ func UserPullMsg(c *gin.Context) { pbData.OperationID = params.OperationID pbData.SeqBegin = *params.Data.SeqBegin pbData.SeqEnd = *params.Data.SeqEnd - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetOfflineMessageConn() msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.PullMessage(context.Background(), &pbData) if err != nil { @@ -70,3 +82,72 @@ func UserPullMsg(c *gin.Context) { }) } + +// paramsUserPullMsgBySeqList struct +type paramsUserPullMsgBySeqList struct { + ReqIdentifier int `json:"reqIdentifier" binding:"required"` + SendID string `json:"sendID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + SeqList []int64 `json:"seqList"` +} + +// @Summary +// @Schemes +// @Description user pull msg by seq +// @Tags chat +// @Accept json +// @Produce json +// @Param body body apiChat.paramsUserPullMsgBySeqList true "pull msg by seq" +// @Param token header string true "token" +// @Success 200 {object} user.result{reqIdentifier=int} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /chat/pull_msg_by_seq [post] +func UserPullMsgBySeqList(c *gin.Context) { + params := paramsUserPullMsgBySeqList{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + token := c.Request.Header.Get("token") + if !utils.VerifyToken(token, params.SendID) { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) + return + } + pbData := pbChat.PullMessageBySeqListReq{} + pbData.UserID = params.SendID + pbData.OperationID = params.OperationID + pbData.SeqList = params.SeqList + + grpcConn := getcdv3.GetOfflineMessageConn() + msgClient := pbChat.NewChatClient(grpcConn) + reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData) + if err != nil { + log.ErrorByKv("PullMessageBySeqList error", pbData.OperationID, "err", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + log.InfoByKv("rpc call success to PullMessageBySeqList", pbData.OperationID, "ReplyArgs", reply.String(), "maxSeq", reply.GetMaxSeq(), + "MinSeq", reply.GetMinSeq(), "singLen", len(reply.GetSingleUserMsg()), "groupLen", len(reply.GetGroupUserMsg())) + + msg := make(map[string]interface{}) + if v := reply.GetSingleUserMsg(); v != nil { + msg["single"] = v + } else { + msg["single"] = []pbChat.GatherFormat{} + } + if v := reply.GetGroupUserMsg(); v != nil { + msg["group"] = v + } else { + msg["group"] = []pbChat.GatherFormat{} + } + msg["maxSeq"] = reply.GetMaxSeq() + msg["minSeq"] = reply.GetMinSeq() + c.JSON(http.StatusOK, gin.H{ + "errCode": reply.ErrCode, + "errMsg": reply.ErrMsg, + "reqIdentifier": params.ReqIdentifier, + "data": msg, + }) +} diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go index e2975e759..402d5224f 100644 --- a/internal/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -1,18 +1,18 @@ package apiChat import ( - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/chat" "Open_IM/pkg/utils" "context" "Open_IM/pkg/grpc-etcdv3/getcdv3" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsUserSendMsg struct type paramsUserSendMsg struct { ReqIdentifier int32 `json:"reqIdentifier" binding:"required"` PlatformID int32 `json:"platformID" binding:"required"` @@ -57,6 +57,24 @@ func newUserSendMsgReq(token string, params *paramsUserSendMsg) *pbChat.UserSend return &pbData } +// resultSendMsg struct +type resultSendMsg struct { + ClientMsgID string `json:"clientMsgID"` + ServerMsgID string `json:"serverMsgID"` + SendTime int64 `json:"sendTime"` +} + +// @Summary +// @Schemes +// @Description user send messages +// @Tags chat +// @Accept json +// @Produce json +// @Param body body apiChat.paramsUserSendMsg true "user send messages" +// @Param token header string true "token" +// @Success 200 {object} user.result{reqIdentifier=int,data=resultSendMsg} +// @Failure 400 {object} user.result +// @Router /chat/send_msg [post] func UserSendMsg(c *gin.Context) { params := paramsUserSendMsg{} if err := c.BindJSON(¶ms); err != nil { @@ -67,12 +85,12 @@ func UserSendMsg(c *gin.Context) { token := c.Request.Header.Get("token") - log.InfoByKv("Ws call success to sendMsgReq", params.OperationID, "Parameters", params) + log.InfoByKv("api call success to sendMsgReq", params.OperationID, "Parameters", params) pbData := newUserSendMsgReq(token, ¶ms) log.Info("", "", "api UserSendMsg call start..., [data: %s]", pbData.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetOfflineMessageConn() client := pbChat.NewChatClient(etcdConn) log.Info("", "", "api UserSendMsg call, api call rpc...") diff --git a/internal/api/friend/add_blacklist.go b/internal/api/friend/add_blacklist.go index e0969faf3..350981b9b 100644 --- a/internal/api/friend/add_blacklist.go +++ b/internal/api/friend/add_blacklist.go @@ -1,26 +1,31 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" -) -/* -type paramsAddBlackList struct { - OperationID string `json:"operationID" binding:"required"` - UID string `json:"uid" binding:"required"` -}*/ + "github.com/gin-gonic/gin" +) +// @Summary +// @Schemes +// @Description add a user into black list +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsSearchFriend true "add black list params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/add_blacklist [post] func AddBlacklist(c *gin.Context) { log.Info("", "", "api add blacklist init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/add_friend.go b/internal/api/friend/add_friend.go index 63f8be35b..1e7017982 100644 --- a/internal/api/friend/add_friend.go +++ b/internal/api/friend/add_friend.go @@ -1,33 +1,52 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsImportFriendReq struct type paramsImportFriendReq struct { OperationID string `json:"operationID" binding:"required"` UIDList []string `json:"uidList" binding:"required"` OwnerUid string `json:"ownerUid" binding:"required"` } +// resultImportFriend struct +type resultImportFriend struct { + ErrCode int `json:"errCode" example:"0"` + ErrMsg string `json:"errMsg" example:"error"` + FailedUidList []string `json:"failedUidList" example: []` +} + +// paramsAddFriend struct type paramsAddFriend struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` ReqMessage string `json:"reqMessage"` } -// +// @Summary +// @Schemes +// @Description import friend +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsImportFriendReq true "import friend params" +// @Param token header string true "token" +// @Success 200 {object} friend.resultImportFriend +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/import_friend [post] func ImportFriend(c *gin.Context) { log.Info("", "", "ImportFriend init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) params := paramsImportFriendReq{} @@ -53,10 +72,22 @@ func ImportFriend(c *gin.Context) { log.InfoByArgs("ImportFriend success return,get args=%s,return args=%s", req.String(), RpcResp.String()) } +// @Summary +// @Schemes +// @Description add a new friend by uid +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsAddFriend true "add friend params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/add_friend [post] func AddFriend(c *gin.Context) { log.Info("", "", "api add friend init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) params := paramsAddFriend{} diff --git a/internal/api/friend/add_friend_response.go b/internal/api/friend/add_friend_response.go index 37e801b3e..e6e3a5b62 100644 --- a/internal/api/friend/add_friend_response.go +++ b/internal/api/friend/add_friend_response.go @@ -1,27 +1,39 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" "fmt" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsAddFriendResponse struct type paramsAddFriendResponse struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` Flag int32 `json:"flag" binding:"required"` } +// @Summary +// @Schemes +// @Description the response of adding friend +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsAddFriendResponse true "response of adding friend" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/add_friend_response [post] func AddFriendResponse(c *gin.Context) { log.Info("", "", fmt.Sprintf("api add friend response init ....")) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/delete_friend.go b/internal/api/friend/delete_friend.go index 4bdbedeee..c7c16de4e 100644 --- a/internal/api/friend/delete_friend.go +++ b/internal/api/friend/delete_friend.go @@ -1,26 +1,38 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" "fmt" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsDeleteFriend struct type paramsDeleteFriend struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` } +// @Summary +// @Schemes +// @Description delete friend +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsSearchFriend true "delete friend params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/delete_friend [post] func DeleteFriend(c *gin.Context) { log.Info("", "", fmt.Sprintf("api delete_friend init ....")) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/get_blcaklist.go b/internal/api/friend/get_blcaklist.go index 5e875a5e8..2684e56ab 100644 --- a/internal/api/friend/get_blcaklist.go +++ b/internal/api/friend/get_blcaklist.go @@ -1,21 +1,22 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" "fmt" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsGetBlackList struct type paramsGetBlackList struct { OperationID string `json:"operationID" binding:"required"` } +// blackListUserInfo struct type blackListUserInfo struct { UID string `json:"uid"` Name string `json:"name"` @@ -27,10 +28,22 @@ type blackListUserInfo struct { Ex string `json:"ex"` } +// @Summary +// @Schemes +// @Description get black list +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsSearchFriend true "get black list" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=[]friend.blackListUserInfo} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/get_blacklist [post] func GetBlacklist(c *gin.Context) { log.Info("", "", "api get blacklist init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/get_friend_apply_list.go b/internal/api/friend/get_friend_apply_list.go index d7ca192e4..822eb12c5 100644 --- a/internal/api/friend/get_friend_apply_list.go +++ b/internal/api/friend/get_friend_apply_list.go @@ -1,19 +1,21 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsGetApplyList struct type paramsGetApplyList struct { OperationID string `json:"operationID" binding:"required"` } + +// UserInfo struct type UserInfo struct { UID string `json:"uid"` Name string `json:"name"` @@ -28,10 +30,22 @@ type UserInfo struct { Flag int32 `json:"flag"` } +// @Summary +// @Schemes +// @Description get friend apply list +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsGetApplyList true "get friend apply list" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=[]friend.UserInfo} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/get_friend_apply_list [post] func GetFriendApplyList(c *gin.Context) { log.Info("", "", "api get_friend_apply_list init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() @@ -78,10 +92,22 @@ func GetFriendApplyList(c *gin.Context) { log.InfoByArgs("api get friend apply list success return,get args=%s,return args=%s", req.String(), RpcResp.String()) } +// @Summary +// @Schemes +// @Description get self friend apply list +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsGetApplyList true "get self friend apply list" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=[]friend.UserInfo} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/get_self_apply_list [post] func GetSelfApplyList(c *gin.Context) { log.Info("", "", "api get self friend apply list init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/get_friend_list.go b/internal/api/friend/get_friend_list.go index db1361572..de8b23215 100644 --- a/internal/api/friend/get_friend_list.go +++ b/internal/api/friend/get_friend_list.go @@ -1,21 +1,22 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" "fmt" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsGetFriendLIst struct type paramsGetFriendLIst struct { OperationID string `json:"operationID" binding:"required"` } +// friendInfo struct type friendInfo struct { UID string `json:"uid"` Name string `json:"name"` @@ -29,10 +30,22 @@ type friendInfo struct { IsInBlackList int32 `json:"isInBlackList"` } +// @Summary +// @Schemes +// @Description get friend apply list +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsGetFriendLIst true "get friend apply list" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=[]friend.friendInfo} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/get_friend_list [post] func GetFriendList(c *gin.Context) { log.Info("", "", fmt.Sprintf("api get_friendlist init ....")) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/get_friends_info.go b/internal/api/friend/get_friends_info.go index 47ee88a10..d16d4ed1f 100644 --- a/internal/api/friend/get_friends_info.go +++ b/internal/api/friend/get_friends_info.go @@ -1,26 +1,50 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" "fmt" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsSearchFriend struct type paramsSearchFriend struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` OwnerUid string `json:"ownerUid"` } +// resultFriendInfo struct +type resultFriendInfo struct { + UID string `json:"uid"` + Name string `json:"name"` + Icon string `json:"icon"` + Gender int32 `json:"gender"` + Mobile string `json:"mobile"` + Birth string `json:"birth"` + Email string `json:"email"` + Ex string `json:"ex"` + Comment string `json:"comment"` +} + +// @Summary +// @Schemes +// @Description get friend info +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsSearchFriend true "search friend params" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=friend.resultFriendInfo} +// @Failure 200 {object} user.result +// @Router /friend/get_friends_info [post] func GetFriendsInfo(c *gin.Context) { log.Info("", "", fmt.Sprintf("api search friend init ....")) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/is_friend.go b/internal/api/friend/is_friend.go index e10c969f3..1cae7c451 100644 --- a/internal/api/friend/is_friend.go +++ b/internal/api/friend/is_friend.go @@ -1,25 +1,37 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsIsFriend struct type paramsIsFriend struct { OperationID string `json:"operationID" binding:"required"` ReceiveUid string `json:"receive_uid"` } +// @Summary +// @Schemes +// @Description check is friend +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsSearchFriend true "is friend params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/is_friend [post] func IsFriend(c *gin.Context) { log.Info("", "", "api is friend init....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() @@ -30,7 +42,7 @@ func IsFriend(c *gin.Context) { } req := &pbFriend.IsFriendReq{ OperationID: params.OperationID, - ReceiveUid: params.OperationID, + ReceiveUid: params.ReceiveUid, Token: c.Request.Header.Get("token"), } log.Info(req.Token, req.OperationID, "api is friend is server") diff --git a/internal/api/friend/remove_blacklist.go b/internal/api/friend/remove_blacklist.go index 57a018513..4aad89c14 100644 --- a/internal/api/friend/remove_blacklist.go +++ b/internal/api/friend/remove_blacklist.go @@ -1,25 +1,37 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsRemoveBlackList struct type paramsRemoveBlackList struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` } +// @Summary +// @Schemes +// @Description remove black list +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsSearchFriend true "remove black list params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/remove_blacklist [post] func RemoveBlacklist(c *gin.Context) { log.Info("", "", "api remove_blacklist init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/friend/set_friend_comment.go b/internal/api/friend/set_friend_comment.go index e16f7e598..1300a0693 100644 --- a/internal/api/friend/set_friend_comment.go +++ b/internal/api/friend/set_friend_comment.go @@ -1,26 +1,38 @@ package friend import ( - pbFriend "Open_IM/pkg/proto/friend" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsSetFriendComment struct type paramsSetFriendComment struct { OperationID string `json:"operationID" binding:"required"` UID string `json:"uid" binding:"required"` Comment string `json:"comment"` } +// @Summary +// @Schemes +// @Description set friend comment +// @Tags friend +// @Accept json +// @Produce json +// @Param body body friend.paramsSetFriendComment true "set friend comment" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /friend/set_friend_comment [post] func SetFriendComment(c *gin.Context) { log.Info("", "", "api set friend comment init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/create_group.go b/internal/api/group/create_group.go index fd9cc14f7..95969b7e4 100644 --- a/internal/api/group/create_group.go +++ b/internal/api/group/create_group.go @@ -1,16 +1,28 @@ package group import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/group" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsCreateGroup struct +type paramsCreateGroup struct { + MemberList struct { + Uid string `json:"uid"` + SetRole string `json:"setRole,omitempty"` + } `json:"memberList"` + GroupName string `json:"groupName"` + Introduction string `json:"introduction"` + Notification string `json:"notification"` + FaceUrl string `json:"faceUrl"` + OperationID string `json:"operationID" binding:"required"` + Ex string `json:"ex"` +} type paramsCreateGroupStruct struct { MemberList []*pb.GroupAddMemberInfo `json:"memberList"` GroupName string `json:"groupName"` @@ -21,10 +33,22 @@ type paramsCreateGroupStruct struct { Ex string `json:"ex"` } +// @Summary +// @Schemes +// @Description create group +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsCreateGroup true "create group params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/create_group [post] func CreateGroup(c *gin.Context) { log.Info("", "", "api create group init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/get_group_applicationList.go b/internal/api/group/get_group_applicationList.go index faceb921e..1abf57082 100644 --- a/internal/api/group/get_group_applicationList.go +++ b/internal/api/group/get_group_applicationList.go @@ -1,17 +1,17 @@ package group import ( - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/group" "Open_IM/pkg/utils" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsGroupApplicationList struct type paramsGroupApplicationList struct { OperationID string `json:"operationID" binding:"required"` } @@ -23,6 +23,7 @@ func newUserRegisterReq(params *paramsGroupApplicationList) *group.GetGroupAppli return &pbData } +// paramsGroupApplicationListRet struct type paramsGroupApplicationListRet struct { ID string `json:"id"` GroupID string `json:"groupID"` @@ -42,9 +43,27 @@ type paramsGroupApplicationListRet struct { HandleResult int32 `json:"handleResult"` } +// resultGroupApplication struct +type resultGroupApplication struct { + Count int `json:"count"` + User []paramsGroupApplicationListRet `json:"user"` +} + +// @Summary +// @Schemes +// @Description get group application list +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsGroupApplicationList true "get group application list params" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=group.resultGroupApplication} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/get_group_applicationList [post] func GetGroupApplicationList(c *gin.Context) { log.Info("", "", "api GetGroupApplicationList init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := group.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/get_groups_info.go b/internal/api/group/get_groups_info.go index b2825485a..9babb56f8 100644 --- a/internal/api/group/get_groups_info.go +++ b/internal/api/group/get_groups_info.go @@ -1,14 +1,13 @@ package group import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/group" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) type paramsGetGroupInfo struct { @@ -16,10 +15,22 @@ type paramsGetGroupInfo struct { OperationID string `json:"operationID" binding:"required"` } +// @Summary +// @Schemes +// @Description get groups info +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsGetGroupInfo true "get groups info params" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=[]group.GroupInfo} +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/get_groups_info [post] func GetGroupsInfo(c *gin.Context) { log.Info("", "", "api get groups info init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/group.go b/internal/api/group/group.go index e26d235b2..dbe300453 100644 --- a/internal/api/group/group.go +++ b/internal/api/group/group.go @@ -1,17 +1,19 @@ package group import ( - pb "Open_IM/pkg/proto/group" "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/group" "context" "fmt" - "github.com/gin-gonic/gin" "net/http" "strings" + + "github.com/gin-gonic/gin" ) +// InviteUserToGroupReq struct type InviteUserToGroupReq struct { GroupID string `json:"groupID" binding:"required"` UidList []string `json:"uidList" binding:"required"` @@ -19,10 +21,25 @@ type InviteUserToGroupReq struct { OperationID string `json:"operationID" binding:"required"` } +// GetJoinedGroupListReq struct type GetJoinedGroupListReq struct { OperationID string `json:"operationID" binding:"required"` } +// paramsKickGroupMember struct +type paramsKickGroupMember struct { + GroupID string `json:"groupID"` + UidListInfo []struct { + UserId string `json:"userId,omitempty"` + Role int32 `json:"role,omitempty"` + JoinTime uint64 `json:"joinTime,omitempty"` + NickName string `json:"nickName,omitempty"` + FaceUrl string `json:"faceUrl,omitempty"` + } `json:"uidListInfo" binding:"required"` + Reason string `json:"reason"` + OperationID string `json:"operationID" binding:"required"` +} + type KickGroupMemberReq struct { GroupID string `json:"groupID"` UidListInfo []*pb.GroupMemberFullInfo `json:"uidListInfo" binding:"required"` @@ -30,10 +47,22 @@ type KickGroupMemberReq struct { OperationID string `json:"operationID" binding:"required"` } +// @Summary +// @Schemes +// @Description kick member from group +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsKickGroupMember true "kick member from group params" +// @Param token header string true "token" +// @Success 200 {object} group.KickGroupMemberResp +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/kick_group [post] func KickGroupMember(c *gin.Context) { log.Info("", "", "KickGroupMember start....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) params := KickGroupMemberReq{} @@ -58,6 +87,7 @@ func KickGroupMember(c *gin.Context) { return } + // KickGroupMemberResp struct type KickGroupMemberResp struct { ErrorCode int32 `json:"errCode"` ErrorMsg string `json:"errMsg"` @@ -75,21 +105,36 @@ func KickGroupMember(c *gin.Context) { c.JSON(http.StatusOK, memberListResp) } +// GetGroupMembersInfoReq struct type GetGroupMembersInfoReq struct { GroupID string `json:"groupID"` MemberList []string `json:"memberList"` OperationID string `json:"operationID"` } + +// GetGroupMembersInfoResp struct type GetGroupMembersInfoResp struct { ErrorCode int32 `json:"errCode"` ErrorMsg string `json:"errMsg"` Data []MemberResult `json:"data"` } +// @Summary +// @Schemes +// @Description get group members info +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.GetGroupMembersInfoReq true "get group members info params" +// @Param token header string true "token" +// @Success 200 {object} group.GetGroupMembersInfoResp +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/get_group_members_info [post] func GetGroupMembersInfo(c *gin.Context) { log.Info("", "", "GetGroupMembersInfo start....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) params := GetGroupMembersInfoReq{} @@ -128,17 +173,21 @@ func GetGroupMembersInfo(c *gin.Context) { c.JSON(http.StatusOK, memberListResp) } +// GetGroupMemberListReq struct type GetGroupMemberListReq struct { GroupID string `json:"groupID"` Filter int32 `json:"filter"` - NextSeq int32 `json:"nextSeq"` + NextSeq int32 `json:"nextSeq,omitempty"` OperationID string `json:"operationID"` } + +// getGroupAllMemberReq struct type getGroupAllMemberReq struct { GroupID string `json:"groupID"` OperationID string `json:"operationID"` } +// MemberResult struct type MemberResult struct { GroupId string `json:"groupID"` UserId string `json:"userId"` @@ -148,10 +197,22 @@ type MemberResult struct { FaceUrl string `json:"faceUrl"` } +// @Summary +// @Schemes +// @Description get group member list +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.GetGroupMemberListReq true "get group member list params" +// @Param token header string true "token" +// @Success 200 {object} group.GetGroupMemberListResp +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/get_group_member_list [post] func GetGroupMemberList(c *gin.Context) { log.Info("", "", "GetGroupMemberList start....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) params := GetGroupMemberListReq{} @@ -174,6 +235,7 @@ func GetGroupMemberList(c *gin.Context) { return } + // GetGroupMemberListResp struct type GetGroupMemberListResp struct { ErrorCode int32 `json:"errCode"` ErrorMsg string `json:"errMsg"` @@ -198,10 +260,22 @@ func GetGroupMemberList(c *gin.Context) { } +// @Summary +// @Schemes +// @Description get group all members +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.getGroupAllMemberReq true "get group all members params" +// @Param token header string true "token" +// @Success 200 {object} group.GetGroupMemberListResp +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/get_group_all_member_list [post] func GetGroupAllMember(c *gin.Context) { log.Info("", "", "GetGroupAllMember start....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) params := getGroupAllMemberReq{} @@ -222,6 +296,7 @@ func GetGroupAllMember(c *gin.Context) { return } + // GetGroupMemberListResp struct type GetGroupMemberListResp struct { ErrorCode int32 `json:"errCode"` ErrorMsg string `json:"errMsg"` @@ -243,6 +318,7 @@ func GetGroupAllMember(c *gin.Context) { c.JSON(http.StatusOK, memberListResp) } +// groupResult struct type groupResult struct { GroupId string `json:"groupId"` GroupName string `json:"groupName"` @@ -254,10 +330,22 @@ type groupResult struct { MemberCount uint32 `json:"memberCount"` } +// @Summary +// @Schemes +// @Description get joined group list +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.GetJoinedGroupListReq true "get joined group list params" +// @Param token header string true "token" +// @Success 200 {object} group.GetJoinedGroupListResp +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/get_joined_group_list [post] func GetJoinedGroupList(c *gin.Context) { log.Info("", "", "GetJoinedGroupList start....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() fmt.Println("config: ", etcdConn, config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) client := pb.NewGroupClient(etcdConn) @@ -280,6 +368,7 @@ func GetJoinedGroupList(c *gin.Context) { } log.Info(req.Token, req.OperationID, "GetJoinedGroupList: ", RpcResp) + // GetJoinedGroupListResp struct type GetJoinedGroupListResp struct { ErrorCode int32 `json:"errCode"` ErrorMsg string `json:"errMsg"` @@ -302,14 +391,27 @@ func GetJoinedGroupList(c *gin.Context) { c.JSON(http.StatusOK, GroupListResp) } +// Id2Result struct type Id2Result struct { UId string `json:"uid"` Result int32 `json:"result"` } +// @Summary +// @Schemes +// @Description invite user to group +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.InviteUserToGroupReq true "invite user to group params" +// @Param token header string true "token" +// @Success 200 {object} group.InviteUserToGroupResp +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/invite_user_to_group [post] func InviteUserToGroup(c *gin.Context) { log.Info("", "", "InviteUserToGroup start....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) params := InviteUserToGroupReq{} @@ -333,6 +435,7 @@ func InviteUserToGroup(c *gin.Context) { return } + // InviteUserToGroupResp struct type InviteUserToGroupResp struct { ErrorCode int32 `json:"errCode"` ErrorMsg string `json:"errMsg"` diff --git a/internal/api/group/group_application_response.go b/internal/api/group/group_application_response.go index 70dd966eb..b387096a9 100644 --- a/internal/api/group/group_application_response.go +++ b/internal/api/group/group_application_response.go @@ -1,17 +1,17 @@ package group import ( - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/group" "Open_IM/pkg/utils" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsGroupApplicationResponse struct type paramsGroupApplicationResponse struct { OperationID string `json:"operationID" binding:"required"` GroupID string `json:"groupID" binding:"required"` @@ -49,9 +49,21 @@ func newGroupApplicationResponse(params *paramsGroupApplicationResponse) *group. return &pbData } +// @Summary +// @Schemes +// @Description response of application group +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsGroupApplicationResponse true "application group param" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/group_application_response [post] func ApplicationGroupResponse(c *gin.Context) { log.Info("", "", "api GroupApplicationResponse init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := group.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/join_group.go b/internal/api/group/join_group.go index 5e85e288e..a3e00e3aa 100644 --- a/internal/api/group/join_group.go +++ b/internal/api/group/join_group.go @@ -1,26 +1,38 @@ package group import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/group" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsJoinGroup struct type paramsJoinGroup struct { GroupID string `json:"groupID" binding:"required"` Message string `json:"message"` OperationID string `json:"operationID" binding:"required"` } +// @Summary +// @Schemes +// @Description join group +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsJoinGroup true "join group params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/set_group_info [post] func JoinGroup(c *gin.Context) { log.Info("", "", "api join group init....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/quit_group.go b/internal/api/group/quit_group.go index 1caea9d0a..3e138691c 100644 --- a/internal/api/group/quit_group.go +++ b/internal/api/group/quit_group.go @@ -1,25 +1,37 @@ package group import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/group" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsQuitGroup struct type paramsQuitGroup struct { GroupID string `json:"groupID" binding:"required"` OperationID string `json:"operationID" binding:"required"` } +// @Summary +// @Schemes +// @Description quit group +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsQuitGroup true "quit group" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/set_group_info [post] func QuitGroup(c *gin.Context) { log.Info("", "", "api quit group init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/set_group_info.go b/internal/api/group/set_group_info.go index 03a3f8c43..80b3ac61d 100644 --- a/internal/api/group/set_group_info.go +++ b/internal/api/group/set_group_info.go @@ -1,16 +1,16 @@ package group import ( - pb "Open_IM/pkg/proto/group" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/group" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsSetGroupInfo struct type paramsSetGroupInfo struct { GroupID string `json:"groupId" binding:"required"` GroupName string `json:"groupName"` @@ -20,10 +20,22 @@ type paramsSetGroupInfo struct { OperationID string `json:"operationID" binding:"required"` } +// @Summary +// @Schemes +// @Description set group info +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsSetGroupInfo true "set group info params" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/set_group_info [post] func SetGroupInfo(c *gin.Context) { log.Info("", "", "api set group info init...") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pb.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/group/transfer_group_owner.go b/internal/api/group/transfer_group_owner.go index f7baaba3f..f3fdf2152 100644 --- a/internal/api/group/transfer_group_owner.go +++ b/internal/api/group/transfer_group_owner.go @@ -1,17 +1,17 @@ package group import ( - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/group" "Open_IM/pkg/utils" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsTransferGroupOwner struct type paramsTransferGroupOwner struct { OperationID string `json:"operationID" binding:"required"` GroupID string `json:"groupID" binding:"required"` @@ -27,9 +27,21 @@ func newTransferGroupOwnerReq(params *paramsTransferGroupOwner) *group.TransferG return &pbData } +// @Summary +// @Schemes +// @Description transfer group owner +// @Tags group +// @Accept json +// @Produce json +// @Param body body group.paramsTransferGroupOwner true "transfer group owner param" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /group/transfer_group [post] func TransferGroupOwner(c *gin.Context) { log.Info("", "", "api TransferGroupOwner init ....") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := group.NewGroupClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index 8430c7470..3523f4108 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -14,15 +14,16 @@ import ( pbChat "Open_IM/pkg/proto/chat" "Open_IM/pkg/utils" "context" + "net/http" + "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" "github.com/mitchellh/mapstructure" - "net/http" - "strings" ) var validate *validator.Validate +// paramsManagementSendMsg struct type paramsManagementSendMsg struct { OperationID string `json:"operationID" binding:"required"` SendID string `json:"sendID" binding:"required"` @@ -35,7 +36,15 @@ type paramsManagementSendMsg struct { SessionType int32 `json:"sessionType" binding:"required"` } -func newUserSendMsgReq(token string, params *paramsManagementSendMsg) *pbChat.UserSendMsgReq { +// sendMsgResult struct +type sendMsgResult struct { + ErrCode int `json:"errCode" example:"0"` + ErrMsg string `json:"errMsg" example:"error"` + SendTime int `json:"sendTime" example:0` + MsgID string `json:"msgID" example:""` +} + +func newUserSendMsgReq(params *paramsManagementSendMsg) *pbChat.UserSendMsgReq { var newContent string switch params.ContentType { case constant.Text: @@ -53,7 +62,6 @@ func newUserSendMsgReq(token string, params *paramsManagementSendMsg) *pbChat.Us } pbData := pbChat.UserSendMsgReq{ ReqIdentifier: constant.WSSendMsg, - Token: token, SendID: params.SendID, SenderNickName: params.SenderNickName, SenderFaceURL: params.SenderFaceURL, @@ -72,6 +80,19 @@ func newUserSendMsgReq(token string, params *paramsManagementSendMsg) *pbChat.Us func init() { validate = validator.New() } + +// @Summary +// @Schemes +// @Description manage send message +// @Tags manage +// @Accept json +// @Produce json +// @Param body body manage.paramsManagementSendMsg true "manage send message" +// @Param token header string true "token" +// @Success 200 {object} manage.sendMsgResult +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /manager/send_msg [post] func ManagementSendMsg(c *gin.Context) { var data interface{} params := paramsManagementSendMsg{} @@ -103,18 +124,22 @@ func ManagementSendMsg(c *gin.Context) { } token := c.Request.Header.Get("token") - if !utils.IsContain(params.SendID, config.Config.Manager.AppManagerUid) { - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "not appManager", "sendTime": 0, "MsgID": ""}) + claims, err := utils.ParseToken(token) + if err != nil { + log.NewError(params.OperationID, "parse token failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "parse token failed", "sendTime": 0, "MsgID": ""}) + } + if !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "not authorized", "sendTime": 0, "MsgID": ""}) return } - log.InfoByKv("Ws call success to ManagementSendMsgReq", params.OperationID, "Parameters", params) - pbData := newUserSendMsgReq(token, ¶ms) + pbData := newUserSendMsgReq(¶ms) log.Info("", "", "api ManagementSendMsg call start..., [data: %s]", pbData.String()) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + etcdConn := getcdv3.GetOfflineMessageConn() client := pbChat.NewChatClient(etcdConn) log.Info("", "", "api ManagementSendMsg call, api call rpc...") diff --git a/internal/api/manage/management_user.go b/internal/api/manage/management_user.go index cd43fd59b..aa7d76398 100644 --- a/internal/api/manage/management_user.go +++ b/internal/api/manage/management_user.go @@ -7,24 +7,52 @@ package manage import ( - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbUser "Open_IM/pkg/proto/user" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// paramsDeleteUsers struct type paramsDeleteUsers struct { OperationID string `json:"operationID" binding:"required"` DeleteUidList []string `json:"deleteUidList" binding:"required"` } + +// paramsGetAllUsersUid struct type paramsGetAllUsersUid struct { OperationID string `json:"operationID" binding:"required"` } +// deleteUserResult struct +type deleteUserResult struct { + ErrCode int `json:"errCode" example:"0"` + ErrMsg string `json:"errMsg" example:"error"` + FailedUidList []string `json:"failedUidList" example:[]` +} + +// uidListResult struct +type uidListResult struct { + ErrCode int `json:"errCode" example:"0"` + ErrMsg string `json:"errMsg" example:"error"` + UidList []string `json:"uidList" example:[]` +} + +// @Summary +// @Schemes +// @Description delete user +// @Tags manage +// @Accept json +// @Produce json +// @Param body body manage.paramsDeleteUsers true "user to be deleted" +// @Param token header string true "token" +// @Success 200 {object} manage.deleteUserResult +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /manager/delete_user [post] func DeleteUser(c *gin.Context) { params := paramsDeleteUsers{} if err := c.BindJSON(¶ms); err != nil { @@ -32,7 +60,7 @@ func DeleteUser(c *gin.Context) { return } log.InfoByKv("DeleteUser req come here", params.OperationID, "DeleteUidList", params.DeleteUidList) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetUserConn() client := pbUser.NewUserClient(etcdConn) //defer etcdConn.Close() @@ -51,6 +79,18 @@ func DeleteUser(c *gin.Context) { resp := gin.H{"errCode": RpcResp.CommonResp.ErrorCode, "errMsg": RpcResp.CommonResp.ErrorMsg, "failedUidList": RpcResp.FailedUidList} c.JSON(http.StatusOK, resp) } + +// @Summary +// @Schemes +// @Description get all user ids +// @Tags manage +// @Accept json +// @Produce json +// @Param body body manage.paramsGetAllUsersUid true "all user ids" +// @Param token header string true "token" +// @Success 200 {object} manage.uidListResult +// @Failure 500 {object} manage.uidListResult +// @Router /manager/get_all_users_uid [post] func GetAllUsersUid(c *gin.Context) { params := paramsGetAllUsersUid{} if err := c.BindJSON(¶ms); err != nil { @@ -58,7 +98,7 @@ func GetAllUsersUid(c *gin.Context) { return } log.InfoByKv("GetAllUsersUid req come here", params.OperationID) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetUserConn() client := pbUser.NewUserClient(etcdConn) //defer etcdConn.Close() diff --git a/internal/api/third/tencent_cloud_storage_credential.go b/internal/api/third/tencent_cloud_storage_credential.go index af68d8fd8..20c458c4d 100644 --- a/internal/api/third/tencent_cloud_storage_credential.go +++ b/internal/api/third/tencent_cloud_storage_credential.go @@ -3,20 +3,43 @@ package apiThird import ( "Open_IM/pkg/common/config" log2 "Open_IM/pkg/common/log" - "github.com/gin-gonic/gin" - sts "github.com/tencentyun/qcloud-cos-sts-sdk/go" "net/http" "time" + + "github.com/gin-gonic/gin" + sts "github.com/tencentyun/qcloud-cos-sts-sdk/go" ) +// paramsTencentCloudStorageCredential struct type paramsTencentCloudStorageCredential struct { Token string `json:"token"` OperationID string `json:"operationID"` } +// resultTencentCredential struct +type resultTencentCredential struct { + ErrCode int `json:"errCode` + ErrMsg string `json:"errMsg"` + Region string `json:"region"` + Bucket string `json:"bucket"` + Data interface{} `json:"data"` +} + var lastTime int64 var lastRes *sts.CredentialResult +// @Summary +// @Schemes +// @Description get Tencent cloud storage credential +// @Tags third +// @Accept json +// @Produce json +// @Param body body apiThird.paramsTencentCloudStorageCredential true "get Tencent cloud storage credential params" +// @Param token header string true "token" +// @Success 200 {object} apiThird.resultTencentCredential +// @Failure 400 {object} user.result +// @Failure 500 {object} user.result +// @Router /third/user_register [post] func TencentCloudStorageCredential(c *gin.Context) { params := paramsTencentCloudStorageCredential{} if err := c.BindJSON(¶ms); err != nil { diff --git a/internal/api/user/get_user_info.go b/internal/api/user/get_user_info.go index 4e93787b5..209f9f0f3 100644 --- a/internal/api/user/get_user_info.go +++ b/internal/api/user/get_user_info.go @@ -1,16 +1,23 @@ package user import ( - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbUser "Open_IM/pkg/proto/user" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) +// result struct +type result struct { + ErrCode int `json:"errCode" example:"0"` + ErrMsg string `json:"errMsg" example:"error"` + Data interface{} `json:"data,omitempty"` +} + +// userInfo struct type userInfo struct { UID string `json:"uid"` Name string `json:"name"` @@ -22,14 +29,30 @@ type userInfo struct { Ex string `json:"ex"` } +// queryUserInfoParam struct +type queryUserInfoParam struct { + OperationID string `json:"operationID" binding:"required"` + UIDList []string `json:"uidList"` +} + +// @Summary +// @Description get user info by uid list +// @Tags user +// @Accept json +// @Produce json +// @Param body body user.queryUserInfoParam true "get userInfo by uidList" +// @Param token header string true "token" +// @Success 200 {object} user.result{data=[]user.userInfo} +// @Failure 400 {object} user.result +// @Router /user/get_user_info [post] func GetUserInfo(c *gin.Context) { log.InfoByKv("api get userinfo init...", "") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetUserConn() client := pbUser.NewUserClient(etcdConn) //defer etcdConn.Close() - params := paramsStruct{} + params := queryUserInfoParam{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return @@ -44,8 +67,8 @@ func GetUserInfo(c *gin.Context) { if err != nil { log.Error(req.Token, req.OperationID, "err=%s,call get user info rpc server failed", err) c.JSON(http.StatusInternalServerError, gin.H{ - "errorCode": 500, - "errorMsg": "call rpc server failed", + "errCode": 500, + "errMsg": "call rpc server failed", }) return } diff --git a/internal/api/user/get_user_info_test.go b/internal/api/user/get_user_info_test.go new file mode 100644 index 000000000..c8329d761 --- /dev/null +++ b/internal/api/user/get_user_info_test.go @@ -0,0 +1,31 @@ +package user + +import ( + "bytes" + "net/http" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" +) + +func init() { + gin.SetMode(gin.TestMode) +} + +func Test_UserRegister(t *testing.T) { + res := httptest.NewRecorder() + c, _ := gin.CreateTestContext(res) + c.Request, _ = http.NewRequest("POST", "/", bytes.NewBufferString(`{"uidList": []}`)) + + GetUserInfo(c) + assert.Equal(t, 400, res.Code) + + res = httptest.NewRecorder() + c, _ = gin.CreateTestContext(res) + c.Request, _ = http.NewRequest("POST", "/", bytes.NewBufferString(`{"operationID": "1", "uidList": []}`)) + + GetUserInfo(c) + assert.Equal(t, 200, res.Code) +} diff --git a/internal/api/user/update_user_info.go b/internal/api/user/update_user_info.go index 1bcc32117..f4a1a3cfd 100644 --- a/internal/api/user/update_user_info.go +++ b/internal/api/user/update_user_info.go @@ -1,38 +1,46 @@ package user import ( - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/common/config" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbUser "Open_IM/pkg/proto/user" "context" - "github.com/gin-gonic/gin" "net/http" - "strings" + + "github.com/gin-gonic/gin" ) -type paramsStruct struct { - OperationID string `json:"operationID" binding:"required"` - UIDList []string `json:"uidList"` - Platform int32 `json:"platform"` - Name string `json:"name"` - Icon string `json:"icon"` - Gender int32 `json:"gender"` - Mobile string `json:"mobile"` - Birth string `json:"birth"` - Email string `json:"email"` - Ex string `json:"ex"` - Uid string `json:"uid"` +// updateUserInfoParam struct +type updateUserInfoParam struct { + OperationID string `json:"operationID" binding:"required"` + Name string `json:"name"` + Icon string `json:"icon"` + Gender int32 `json:"gender"` + Mobile string `json:"mobile"` + Birth string `json:"birth"` + Email string `json:"email"` + Ex string `json:"ex"` + Uid string `json:"uid"` } +// @Summary +// @Description update user info +// @Tags user +// @Accept json +// @Produce json +// @Param body body user.updateUserInfoParam true "new user info" +// @Param token header string true "token" +// @Success 200 {object} user.result +// @Failure 500 {object} user.result +// @Router /user/update_user_info [post] func UpdateUserInfo(c *gin.Context) { log.InfoByKv("api update userinfo init...", "") - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetUserConn() client := pbUser.NewUserClient(etcdConn) //defer etcdConn.Close() - params := paramsStruct{} + params := updateUserInfoParam{} if err := c.BindJSON(¶ms); err != nil { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) return diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index ab20158cd..3f7f14cf5 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -1,112 +1,107 @@ package gate import ( - "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbChat "Open_IM/pkg/proto/chat" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" + "bytes" "context" + "encoding/gob" "encoding/json" + "runtime" + + "github.com/golang/protobuf/proto" "github.com/gorilla/websocket" - "strings" ) -func (ws *WServer) msgParse(conn *websocket.Conn, jsonMsg []byte) { +func (ws *WServer) msgParse(conn *UserConn, binaryMsg []byte) { //ws online debug data //{"ReqIdentifier":1001,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b","Time":"123","OperationID":"123","MsgIncr":0} //{"ReqIdentifier":1002,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b","Time":"123","OperationID":"123","MsgIncr":0,"SeqBegin":1,"SeqEnd":6} //{"ReqIdentifier":1003,"Token":"123","SendID":"c4ca4238a0b923820dcc509a6f75849b", //"RecvID":"a87ff679a2f3e71d9181a67b7542122c","ClientMsgID":"2343","Time":"147878787","OperationID": //"123","MsgIncr":0,"SubMsgType":101,"MsgType":100,"MsgFrom":1,"Content":"sdfsdf"} + b := bytes.NewBuffer(binaryMsg) m := Req{} - if err := json.Unmarshal(jsonMsg, &m); err != nil { + dec := gob.NewDecoder(b) + err := dec.Decode(&m) + if err != nil { log.ErrorByKv("ws json Unmarshal err", "", "err", err.Error()) - ws.sendErrMsg(conn, 200, err.Error()) + ws.sendErrMsg(conn, 200, err.Error(), constant.WSDataError, "", "") + err = conn.Close() + if err != nil { + log.NewError("", "ws close err", err.Error()) + } return } if err := validate.Struct(m); err != nil { log.ErrorByKv("ws args validate err", "", "err", err.Error()) - ws.sendErrMsg(conn, 201, err.Error()) - return - } - - if !utils.VerifyToken(m.Token, m.SendID) { - ws.sendErrMsg(conn, 202, "token validate err") + ws.sendErrMsg(conn, 201, err.Error(), m.ReqIdentifier, m.MsgIncr, m.OperationID) return } - log.InfoByKv("Basic Info Authentication Success", m.OperationID, "reqIdentifier", m.ReqIdentifier, "sendID", m.SendID) + //if !utils.VerifyToken(m.Token, m.SendID) { + // ws.sendErrMsg(conn, 202, "token validate err", m.ReqIdentifier, m.MsgIncr,m.OperationID) + // return + //} + log.InfoByKv("Basic Info Authentication Success", m.OperationID, "reqIdentifier", m.ReqIdentifier, "sendID", m.SendID, "msgIncr", m.MsgIncr) switch m.ReqIdentifier { case constant.WSGetNewestSeq: - ws.newestSeqReq(conn, &m) + go ws.getSeqReq(conn, &m) case constant.WSPullMsg: - ws.pullMsgReq(conn, &m) + go ws.pullMsgReq(conn, &m) case constant.WSSendMsg: - ws.sendMsgReq(conn, &m) + sendTime := utils.GetCurrentTimestampByNano() + go ws.sendMsgReq(conn, &m, sendTime) + case constant.WSPullMsgBySeqList: + go ws.pullMsgBySeqListReq(conn, &m) default: } + log.NewInfo("", "goroutine num is ", runtime.NumGoroutine()) } -func (ws *WServer) newestSeqResp(conn *websocket.Conn, m *Req, pb *pbChat.GetNewSeqResp) { - mReply := make(map[string]interface{}) - mData := make(map[string]interface{}) - mReply["reqIdentifier"] = m.ReqIdentifier - mReply["msgIncr"] = m.MsgIncr - mReply["errCode"] = pb.GetErrCode() - mReply["errMsg"] = pb.GetErrMsg() - mData["seq"] = pb.GetSeq() - mReply["data"] = mData - ws.sendMsg(conn, mReply) -} -func (ws *WServer) newestSeqReq(conn *websocket.Conn, m *Req) { - log.InfoByKv("Ws call success to getNewSeq", m.OperationID, "Parameters", m) - pbData := pbChat.GetNewSeqReq{} +func (ws *WServer) getSeqReq(conn *UserConn, m *Req) { + log.NewInfo(m.OperationID, "Ws call success to getNewSeq", m.MsgIncr, m.SendID, m.ReqIdentifier) + pbData := pbChat.GetMaxAndMinSeqReq{} + nReply := new(pbChat.GetMaxAndMinSeqResp) pbData.UserID = m.SendID pbData.OperationID = m.OperationID - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetOfflineMessageConn() if grpcConn == nil { log.ErrorByKv("get grpcConn err", pbData.OperationID, "args", m) } msgClient := pbChat.NewChatClient(grpcConn) - reply, err := msgClient.GetNewSeq(context.Background(), &pbData) + reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) if err != nil { - log.ErrorByKv("rpc call failed to getNewSeq", pbData.OperationID, "err", err, "pbData", pbData.String()) - return - } - log.InfoByKv("rpc call success to getNewSeq", pbData.OperationID, "replyData", reply.String()) - ws.newestSeqResp(conn, m, reply) - -} - -func (ws *WServer) pullMsgResp(conn *websocket.Conn, m *Req, pb *pbChat.PullMessageResp) { - mReply := make(map[string]interface{}) - msg := make(map[string]interface{}) - mReply["reqIdentifier"] = m.ReqIdentifier - mReply["msgIncr"] = m.MsgIncr - mReply["errCode"] = pb.GetErrCode() - mReply["errMsg"] = pb.GetErrMsg() - //įŠēåˆ‡į‰‡ - if v := pb.GetSingleUserMsg(); v != nil { - msg["single"] = v + log.ErrorByKv("rpc call failed to getSeqReq", pbData.OperationID, "err", err, "pbData", pbData.String()) + nReply.ErrCode = 200 + nReply.ErrMsg = err.Error() + ws.getSeqResp(conn, m, nReply) } else { - msg["single"] = []pbChat.GatherFormat{} + log.InfoByKv("rpc call success to getSeqReq", pbData.OperationID, "replyData", reply.String()) + ws.getSeqResp(conn, m, reply) } - if v := pb.GetGroupUserMsg(); v != nil { - msg["group"] = v - } else { - msg["group"] = []pbChat.GatherFormat{} +} +func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeqResp) { + var mReplyData open_im_sdk.GetMaxAndMinSeqResp + mReplyData.MaxSeq = pb.GetMaxSeq() + mReplyData.MinSeq = pb.GetMinSeq() + b, _ := proto.Marshal(&mReplyData) + mReply := Resp{ + ReqIdentifier: m.ReqIdentifier, + MsgIncr: m.MsgIncr, + ErrCode: pb.GetErrCode(), + ErrMsg: pb.GetErrMsg(), + OperationID: m.OperationID, + Data: b, } - msg["maxSeq"] = pb.GetMaxSeq() - msg["minSeq"] = pb.GetMinSeq() - mReply["data"] = msg ws.sendMsg(conn, mReply) - } - -func (ws *WServer) pullMsgReq(conn *websocket.Conn, m *Req) { - log.InfoByKv("Ws call success to pullMsgReq", m.OperationID, "Parameters", m) - reply := new(pbChat.PullMessageResp) +func (ws *WServer) pullMsgReq(conn *UserConn, m *Req) { + log.NewInfo(m.OperationID, "Ws call success to pullMsgReq", m.ReqIdentifier, m.MsgIncr, m.SendID) + nReply := new(pbChat.PullMessageResp) isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsg) if isPass { pbData := pbChat.PullMessageReq{} @@ -114,83 +109,174 @@ func (ws *WServer) pullMsgReq(conn *websocket.Conn, m *Req) { pbData.OperationID = m.OperationID pbData.SeqBegin = data.(SeqData).SeqBegin pbData.SeqEnd = data.(SeqData).SeqEnd - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + grpcConn := getcdv3.GetOfflineMessageConn() msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.PullMessage(context.Background(), &pbData) if err != nil { log.ErrorByKv("PullMessage error", pbData.OperationID, "err", err.Error()) - return + nReply.ErrCode = 200 + nReply.ErrMsg = err.Error() + ws.pullMsgResp(conn, m, nReply) + } else { + log.InfoByKv("rpc call success to pullMsgRep", pbData.OperationID, "ReplyArgs", reply.String(), "maxSeq", reply.GetMaxSeq(), + "MinSeq", reply.GetMinSeq(), "singLen", len(reply.GetSingleUserMsg()), "groupLen", len(reply.GetGroupUserMsg())) + ws.pullMsgResp(conn, m, reply) } - log.InfoByKv("rpc call success to pullMsgRep", pbData.OperationID, "ReplyArgs", reply.String(), "maxSeq", reply.GetMaxSeq(), - "MinSeq", reply.GetMinSeq(), "singLen", len(reply.GetSingleUserMsg()), "groupLen", len(reply.GetGroupUserMsg())) - ws.pullMsgResp(conn, m, reply) } else { - reply.ErrCode = errCode - reply.ErrMsg = errMsg - ws.pullMsgResp(conn, m, reply) + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + ws.pullMsgResp(conn, m, nReply) } } +func (ws *WServer) pullMsgResp(conn *UserConn, m *Req, pb *pbChat.PullMessageResp) { + log.NewInfo(m.OperationID, "pullMsgResp come here ", pb.String()) + var mReplyData open_im_sdk.PullMessageBySeqListResp + a, err := json.Marshal(pb.SingleUserMsg) + if err != nil { + log.NewError(m.OperationID, "GetSingleUserMsg,json marshal,err", err.Error()) + } + log.NewInfo(m.OperationID, "pullMsgResp json is ", len(pb.SingleUserMsg)) + err = json.Unmarshal(a, &mReplyData.SingleUserMsg) + if err != nil { + log.NewError(m.OperationID, "SingleUserMsg,json Unmarshal,err", err.Error()) + } + b, err := json.Marshal(pb.GroupUserMsg) + if err != nil { + log.NewError(m.OperationID, "mReplyData,json marshal,err", err.Error()) + } + err = json.Unmarshal(b, &mReplyData.GroupUserMsg) + if err != nil { + log.NewError(m.OperationID, "test SingleUserMsg,json Unmarshal,err", err.Error()) + } + c, err := proto.Marshal(&mReplyData) + log.NewInfo(m.OperationID, "test info is ", len(mReplyData.SingleUserMsg), mReplyData.SingleUserMsg) + + mReply := Resp{ + ReqIdentifier: m.ReqIdentifier, + MsgIncr: m.MsgIncr, + ErrCode: pb.GetErrCode(), + ErrMsg: pb.GetErrMsg(), + OperationID: m.OperationID, + Data: c, + } + log.NewInfo(m.OperationID, "pullMsgResp all data is ", mReply.ReqIdentifier, mReply.MsgIncr, mReply.ErrCode, mReply.ErrMsg, + len(mReply.Data)) -func (ws *WServer) sendMsgResp(conn *websocket.Conn, m *Req, pb *pbChat.UserSendMsgResp) { - mReply := make(map[string]interface{}) - mReplyData := make(map[string]interface{}) - mReply["reqIdentifier"] = m.ReqIdentifier - mReply["msgIncr"] = m.MsgIncr - mReply["errCode"] = pb.GetErrCode() - mReply["errMsg"] = pb.GetErrMsg() - mReplyData["clientMsgID"] = pb.GetClientMsgID() - mReplyData["serverMsgID"] = pb.GetServerMsgID() - mReply["data"] = mReplyData ws.sendMsg(conn, mReply) -} -func (ws *WServer) sendMsgReq(conn *websocket.Conn, m *Req) { - log.InfoByKv("Ws call success to sendMsgReq", m.OperationID, "Parameters", m) - reply := new(pbChat.UserSendMsgResp) +} +func (ws *WServer) pullMsgBySeqListReq(conn *UserConn, m *Req) { + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq start", m.SendID, m.ReqIdentifier, m.MsgIncr) + nReply := new(pbChat.PullMessageResp) + isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList) + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq middle", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(open_im_sdk.PullMessageBySeqListReq).SeqList) + if isPass { + pbData := pbChat.PullMessageBySeqListReq{} + pbData.SeqList = data.(open_im_sdk.PullMessageBySeqListReq).SeqList + pbData.UserID = m.SendID + pbData.OperationID = m.OperationID + grpcConn := getcdv3.GetOfflineMessageConn() + msgClient := pbChat.NewChatClient(grpcConn) + reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData) + if err != nil { + log.NewError(pbData.OperationID, "pullMsgBySeqListReq err", err.Error()) + nReply.ErrCode = 200 + nReply.ErrMsg = err.Error() + ws.pullMsgResp(conn, m, nReply) + } else { + log.NewInfo(pbData.OperationID, "rpc call success to pullMsgBySeqListReq", reply.String(), reply.GetMaxSeq(), reply.GetMinSeq(), len(reply.GetSingleUserMsg()), len(reply.GetGroupUserMsg())) + ws.pullMsgResp(conn, m, reply) + } + } else { + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + ws.pullMsgResp(conn, m, nReply) + } +} +func (ws *WServer) sendMsgReq(conn *UserConn, m *Req, sendTime int64) { + log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, sendTime) + nReply := new(pbChat.UserSendMsgResp) isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg) if isPass { - data := pData.(MsgData) + data := pData.(open_im_sdk.UserSendMsgReq) pbData := pbChat.UserSendMsgReq{ - ReqIdentifier: m.ReqIdentifier, - Token: m.Token, - SendID: m.SendID, - OperationID: m.OperationID, - PlatformID: data.PlatformID, - SessionType: data.SessionType, - MsgFrom: data.MsgFrom, - ContentType: data.ContentType, - RecvID: data.RecvID, - ForceList: data.ForceList, - Content: data.Content, - Options: utils.MapToJsonString(data.Options), - ClientMsgID: data.ClientMsgID, - OffLineInfo: utils.MapToJsonString(data.OfflineInfo), + ReqIdentifier: m.ReqIdentifier, + Token: m.Token, + SendID: m.SendID, + OperationID: m.OperationID, + PlatformID: data.PlatformID, + SessionType: data.SessionType, + MsgFrom: data.MsgFrom, + ContentType: data.ContentType, + RecvID: data.RecvID, + ForceList: data.ForceList, + SenderNickName: data.SenderNickName, + SenderFaceURL: data.SenderFaceURL, + Content: data.Content, + Options: utils.MapIntToJsonString(data.Options), + ClientMsgID: data.ClientMsgID, + SendTime: sendTime, } - log.InfoByKv("Ws call success to sendMsgReq", m.OperationID, "Parameters", m) - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + log.NewInfo(m.OperationID, "Ws call success to sendMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, data) + etcdConn := getcdv3.GetOfflineMessageConn() client := pbChat.NewChatClient(etcdConn) - log.Info("", "", "api UserSendMsg call, api call rpc...") - reply, _ := client.UserSendMsg(context.Background(), &pbData) - log.Info("", "", "api UserSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) - ws.sendMsgResp(conn, m, reply) + reply, err := client.UserSendMsg(context.Background(), &pbData) + if err != nil { + log.NewError(pbData.OperationID, "UserSendMsg err", err.Error()) + nReply.ErrCode = 200 + nReply.ErrMsg = err.Error() + ws.sendMsgResp(conn, m, nReply, sendTime) + } else { + log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String()) + ws.sendMsgResp(conn, m, reply, sendTime) + } + } else { - reply.ErrCode = errCode - reply.ErrMsg = errMsg - ws.sendMsgResp(conn, m, reply) + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + ws.sendMsgResp(conn, m, nReply, sendTime) } } +func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.UserSendMsgResp, sendTime int64) { + // := make(map[string]interface{}) + + var mReplyData open_im_sdk.UserSendMsgResp + mReplyData.ClientMsgID = pb.GetClientMsgID() + mReplyData.ServerMsgID = pb.GetServerMsgID() + mReplyData.SendTime = sendTime + b, _ := proto.Marshal(&mReplyData) + mReply := Resp{ + ReqIdentifier: m.ReqIdentifier, + MsgIncr: m.MsgIncr, + ErrCode: pb.GetErrCode(), + ErrMsg: pb.GetErrMsg(), + OperationID: m.OperationID, + Data: b, + } + ws.sendMsg(conn, mReply) +} -func (ws *WServer) sendMsg(conn *websocket.Conn, mReply map[string]interface{}) { - bMsg, _ := json.Marshal(mReply) - err := ws.writeMsg(conn, websocket.TextMessage, bMsg) +func (ws *WServer) sendMsg(conn *UserConn, mReply interface{}) { + var b bytes.Buffer + enc := gob.NewEncoder(&b) + err := enc.Encode(mReply) + if err != nil { + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "Encode Msg error", conn.RemoteAddr().String(), ws.getUserUid(conn), err.Error()) + return + } + err = ws.writeMsg(conn, websocket.BinaryMessage, b.Bytes()) if err != nil { - log.ErrorByKv("WS WriteMsg error", "", "userIP", conn.RemoteAddr().String(), "userUid", ws.getUserUid(conn), "error", err, "mReply", mReply) + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "WS WriteMsg error", conn.RemoteAddr().String(), ws.getUserUid(conn), err.Error()) } } -func (ws *WServer) sendErrMsg(conn *websocket.Conn, errCode int32, errMsg string) { - mReply := make(map[string]interface{}) - mReply["errCode"] = errCode - mReply["errMsg"] = errMsg +func (ws *WServer) sendErrMsg(conn *UserConn, errCode int32, errMsg string, reqIdentifier int32, msgIncr string, operationID string) { + mReply := Resp{ + ReqIdentifier: reqIdentifier, + MsgIncr: msgIncr, + ErrCode: errCode, + ErrMsg: errMsg, + OperationID: operationID, + } ws.sendMsg(conn, mReply) } diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go index fc43493e3..468d0f5dd 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -6,14 +6,18 @@ import ( "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" pbRelay "Open_IM/pkg/proto/relay" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" + "bytes" "context" - "encoding/json" + "encoding/gob" "fmt" - "github.com/gorilla/websocket" - "google.golang.org/grpc" + "github.com/golang/protobuf/proto" "net" "strings" + + "github.com/gorilla/websocket" + "google.golang.org/grpc" ) type RPCServer struct { @@ -55,105 +59,87 @@ func (r *RPCServer) MsgToUser(_ context.Context, in *pbRelay.MsgToUserReq) (*pbR log.InfoByKv("PushMsgToUser is arriving", in.OperationID, "args", in.String()) var resp []*pbRelay.SingleMsgToUser var RecvID string - msg := make(map[string]interface{}) - mReply := make(map[string]interface{}) - mReply["reqIdentifier"] = constant.WSPushMsg - mReply["errCode"] = 0 - mReply["errMsg"] = "" - msg["sendID"] = in.SendID - msg["recvID"] = in.RecvID - msg["msgFrom"] = in.MsgFrom - msg["contentType"] = in.ContentType - msg["sessionType"] = in.SessionType - msg["senderNickName"] = in.SenderNickName - msg["senderFaceUrl"] = in.SenderFaceURL - msg["clientMsgID"] = in.ClientMsgID - msg["serverMsgID"] = in.ServerMsgID - msg["content"] = in.Content - msg["seq"] = in.RecvSeq - msg["sendTime"] = in.SendTime - msg["senderPlatformID"] = in.PlatformID - mReply["data"] = msg - bMsg, _ := json.Marshal(mReply) + msg := open_im_sdk.MsgData{ + SendID: in.SendID, + RecvID: in.RecvID, + MsgFrom: in.MsgFrom, + ContentType: in.ContentType, + SessionType: in.SessionType, + SenderNickName: in.SenderNickName, + SenderFaceURL: in.SenderFaceURL, + ClientMsgID: in.ClientMsgID, + ServerMsgID: in.ServerMsgID, + Content: in.Content, + Seq: in.RecvSeq, + SendTime: in.SendTime, + SenderPlatformID: in.PlatformID, + } + msgBytes, _ := proto.Marshal(&msg) + mReply := Resp{ + ReqIdentifier: constant.WSPushMsg, + OperationID: in.OperationID, + Data: msgBytes, + } + var replyBytes bytes.Buffer + enc := gob.NewEncoder(&replyBytes) + err := enc.Encode(mReply) + if err != nil { + log.NewError(in.OperationID, "data encode err", err.Error()) + } switch in.GetSessionType() { case constant.SingleChatType: RecvID = in.GetRecvID() case constant.GroupChatType: RecvID = strings.Split(in.GetRecvID(), " ")[0] } - log.InfoByKv("test", in.OperationID, "wsUserToConn", ws.wsUserToConn) - for key, conn := range ws.wsUserToConn { - UIDAndPID := strings.Split(key, " ") - if UIDAndPID[0] == RecvID { - resultCode := sendMsgToUser(conn, bMsg, in, UIDAndPID[1], UIDAndPID[0]) + var tag bool + var UIDAndPID []string + userIDList := genUidPlatformArray(RecvID) + for _, v := range userIDList { + UIDAndPID = strings.Split(v, " ") + if conn := ws.getUserConn(v); conn != nil { + tag = true + resultCode := sendMsgToUser(conn, replyBytes.Bytes(), in, UIDAndPID[1], UIDAndPID[0]) temp := &pbRelay.SingleMsgToUser{ ResultCode: resultCode, RecvID: UIDAndPID[0], RecvPlatFormID: utils.PlatformNameToID(UIDAndPID[1]), } resp = append(resp, temp) + } else { + temp := &pbRelay.SingleMsgToUser{ + ResultCode: -1, + RecvID: UIDAndPID[0], + RecvPlatFormID: utils.PlatformNameToID(UIDAndPID[1]), + } + resp = append(resp, temp) } } - //switch in.GetContentType() { - //case constant.SyncSenderMsg: - // log.InfoByKv("come sync", in.OperationID, "args", in.String()) - // RecvID = in.GetSendID() - // if in.MsgFrom != constant.SysMsgType { - // for key, conn := range ws.wsUserToConn { - // UIDAndPID := strings.Split(key, " ") - // if UIDAndPID[0] == RecvID && utils.PlatformIDToName(in.GetPlatformID()) != UIDAndPID[1] { - // resultCode := sendMsgToUser(conn, bMsg, in, UIDAndPID[1], UIDAndPID[0]) - // temp := &pbRelay.SingleMsgToUser{ - // ResultCode: resultCode, - // RecvID: UIDAndPID[0], - // RecvPlatFormID: utils.PlatformNameToID(UIDAndPID[1]), - // } - // resp = append(resp, temp) - // } - // - // } - // } - //default: - // log.InfoByKv("not come sync", in.OperationID, "args", in.String()) - // switch in.SessionType { - // case constant.SingleChatType: - // log.InfoByKv("come single", in.OperationID, "args", in.String()) - // RecvID = in.GetRecvID() - // case constant.GroupChatType: - // RecvID = strings.Split(in.GetRecvID(), " ")[0] - // default: - // } - // log.InfoByKv("come for range", in.OperationID, "args", in.String()) - // - // for key, conn := range ws.wsUserToConn { - // UIDAndPID := strings.Split(key, " ") - // if UIDAndPID[0] == RecvID { - // resultCode := sendMsgToUser(conn, bMsg, in, UIDAndPID[1], UIDAndPID[0]) - // temp := &pbRelay.SingleMsgToUser{ - // ResultCode: resultCode, - // RecvID: UIDAndPID[0], - // RecvPlatFormID: utils.PlatformNameToID(UIDAndPID[1]), - // } - // resp = append(resp, temp) - // } - // } - //} + if !tag { + log.NewError(in.OperationID, "push err ,no matched ws conn not in map", in.String()) + } return &pbRelay.MsgToUserResp{ Resp: resp, }, nil } -func sendMsgToUser(conn *websocket.Conn, bMsg []byte, in *pbRelay.MsgToUserReq, RecvPlatForm, RecvID string) (ResultCode int64) { - err := ws.writeMsg(conn, websocket.TextMessage, bMsg) +func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.MsgToUserReq, RecvPlatForm, RecvID string) (ResultCode int64) { + err := ws.writeMsg(conn, websocket.BinaryMessage, bMsg) if err != nil { log.ErrorByKv("PushMsgToUser is failed By Ws", "", "Addr", conn.RemoteAddr().String(), "error", err, "senderPlatform", utils.PlatformIDToName(in.PlatformID), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) ResultCode = -2 return ResultCode } else { - log.InfoByKv("PushMsgToUser is success By Ws", in.OperationID, "args", in.String()) + log.InfoByKv("PushMsgToUser is success By Ws", in.OperationID, "args", in.String(), "recvPlatForm", RecvPlatForm, "recvID", RecvID) ResultCode = 0 return ResultCode } } +func genUidPlatformArray(uid string) (array []string) { + for i := 1; i <= utils.LinuxPlatformID; i++ { + array = append(array, uid+" "+utils.PlatformIDToName(int32(i))) + } + return array +} diff --git a/internal/msg_gateway/gate/validate.go b/internal/msg_gateway/gate/validate.go index 8c701576e..269229e9c 100644 --- a/internal/msg_gateway/gate/validate.go +++ b/internal/msg_gateway/gate/validate.go @@ -9,17 +9,27 @@ package gate import ( "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" - "github.com/mitchellh/mapstructure" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "github.com/golang/protobuf/proto" ) type Req struct { - ReqIdentifier int32 `json:"reqIdentifier" validate:"required"` - Token string `json:"token" validate:"required"` - SendID string `json:"sendID" validate:"required"` - OperationID string `json:"operationID" validate:"required"` - MsgIncr int32 `json:"msgIncr" validate:"required"` - Data map[string]interface{} `json:"data"` + ReqIdentifier int32 `json:"reqIdentifier" validate:"required"` + Token string `json:"token" ` + SendID string `json:"sendID" validate:"required"` + OperationID string `json:"operationID" validate:"required"` + MsgIncr string `json:"msgIncr" validate:"required"` + Data []byte `json:"data"` } +type Resp struct { + ReqIdentifier int32 `json:"reqIdentifier"` + MsgIncr string `json:"msgIncr"` + OperationID string `json:"operationID"` + ErrCode int32 `json:"errCode"` + ErrMsg string `json:"errMsg"` + Data []byte `json:"data"` +} + type SeqData struct { SeqBegin int64 `mapstructure:"seqBegin" validate:"required"` SeqEnd int64 `mapstructure:"seqEnd" validate:"required"` @@ -30,31 +40,64 @@ type MsgData struct { MsgFrom int32 `mapstructure:"msgFrom" validate:"required"` ContentType int32 `mapstructure:"contentType" validate:"required"` RecvID string `mapstructure:"recvID" validate:"required"` - ForceList []string `mapstructure:"forceList" validate:"required"` + ForceList []string `mapstructure:"forceList"` Content string `mapstructure:"content" validate:"required"` Options map[string]interface{} `mapstructure:"options" validate:"required"` ClientMsgID string `mapstructure:"clientMsgID" validate:"required"` OfflineInfo map[string]interface{} `mapstructure:"offlineInfo" validate:"required"` Ext map[string]interface{} `mapstructure:"ext"` } +type MaxSeqResp struct { + MaxSeq int64 `json:"maxSeq"` +} +type PullMessageResp struct { +} +type SeqListData struct { + SeqList []int64 `mapstructure:"seqList" validate:"required"` +} -func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, errMsg string, data interface{}) { +func (ws *WServer) argsValidate(m *Req, r int32) (isPass bool, errCode int32, errMsg string, returnData interface{}) { switch r { - case constant.WSPullMsg: - data = SeqData{} case constant.WSSendMsg: - data = MsgData{} - default: - } - if err := mapstructure.WeakDecode(m.Data, &data); err != nil { - log.ErrorByKv("map to Data struct err", "", "err", err.Error(), "reqIdentifier", r) - return false, 203, err.Error(), nil - } else if err := validate.Struct(data); err != nil { - log.ErrorByKv("data args validate err", "", "err", err.Error(), "reqIdentifier", r) - return false, 204, err.Error(), nil - - } else { + data := open_im_sdk.UserSendMsgReq{} + if err := proto.Unmarshal(m.Data, &data); err != nil { + log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r) + return false, 203, err.Error(), nil + } + if err := validate.Struct(data); err != nil { + log.ErrorByKv("data args validate err", "", "err", err.Error(), "reqIdentifier", r) + return false, 204, err.Error(), nil + + } + return true, 0, "", data + case constant.WSPullMsgBySeqList: + data := open_im_sdk.PullMessageBySeqListReq{} + if err := proto.Unmarshal(m.Data, &data); err != nil { + log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r) + return false, 203, err.Error(), nil + } + if err := validate.Struct(data); err != nil { + log.ErrorByKv("data args validate err", "", "err", err.Error(), "reqIdentifier", r) + return false, 204, err.Error(), nil + + } return true, 0, "", data + + default: } + return false, 204, "args err", nil + + //b := bytes.NewBuffer(m.Data) + //dec := gob.NewDecoder(b) + //err := dec.Decode(&data) + //if err != nil { + // log.ErrorByKv("Decode Data struct err", "", "err", err.Error(), "reqIdentifier", r) + // return false, 203, err.Error(), nil + //} + //if err := mapstructure.WeakDecode(m.Data, &data); err != nil { + // log.ErrorByKv("map to Data struct err", "", "err", err.Error(), "reqIdentifier", r) + // return false, 203, err.Error(), nil + //} else + } diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 1a0f5a1a2..8faa748a9 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -6,23 +6,28 @@ import ( "Open_IM/pkg/utils" "github.com/gorilla/websocket" "net/http" + "sync" "time" ) +type UserConn struct { + *websocket.Conn + w *sync.Mutex +} type WServer struct { wsAddr string wsMaxConnNum int wsUpGrader *websocket.Upgrader - wsConnToUser map[*websocket.Conn]string - wsUserToConn map[string]*websocket.Conn + wsConnToUser map[*UserConn]string + wsUserToConn map[string]*UserConn } func (ws *WServer) onInit(wsPort int) { ip := utils.ServerIP ws.wsAddr = ip + ":" + utils.IntToString(wsPort) ws.wsMaxConnNum = config.Config.LongConnSvr.WebsocketMaxConnNum - ws.wsConnToUser = make(map[*websocket.Conn]string) - ws.wsUserToConn = make(map[string]*websocket.Conn) + ws.wsConnToUser = make(map[*UserConn]string) + ws.wsUserToConn = make(map[string]*UserConn) ws.wsUpGrader = &websocket.Upgrader{ HandshakeTimeout: time.Duration(config.Config.LongConnSvr.WebsocketTimeOut) * time.Second, ReadBufferSize: config.Config.LongConnSvr.WebsocketMaxMsgLen, @@ -49,35 +54,39 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { //Connection mapping relationship, //userID+" "+platformID->conn SendID := query["sendID"][0] + " " + utils.PlatformIDToName(int32(utils.StringToInt64(query["platformID"][0]))) - ws.addUserConn(SendID, conn) - go ws.readMsg(conn) + //Initialize a lock for each user + newConn := &UserConn{conn, new(sync.Mutex)} + ws.addUserConn(SendID, newConn) + go ws.readMsg(newConn) } } } -func (ws *WServer) readMsg(conn *websocket.Conn) { +func (ws *WServer) readMsg(conn *UserConn) { for { - msgType, msg, err := conn.ReadMessage() + messageType, msg, err := conn.ReadMessage() + if messageType == websocket.PingMessage { + log.NewInfo("", "this is a pingMessage") + } if err != nil { log.ErrorByKv("WS ReadMsg error", "", "userIP", conn.RemoteAddr().String(), "userUid", ws.getUserUid(conn), "error", err) ws.delUserConn(conn) return } else { - log.ErrorByKv("test", "", "msgType", msgType, "userIP", conn.RemoteAddr().String(), "userUid", ws.getUserUid(conn)) + //log.ErrorByKv("test", "", "msgType", msgType, "userIP", conn.RemoteAddr().String(), "userUid", ws.getUserUid(conn)) } ws.msgParse(conn, msg) //ws.writeMsg(conn, 1, chat) } } - -func (ws *WServer) writeMsg(conn *websocket.Conn, a int, msg []byte) error { - rwLock.Lock() - defer rwLock.Unlock() +func (ws *WServer) writeMsg(conn *UserConn, a int, msg []byte) error { + conn.w.Lock() + defer conn.w.Unlock() return conn.WriteMessage(a, msg) } -func (ws *WServer) addUserConn(uid string, conn *websocket.Conn) { +func (ws *WServer) addUserConn(uid string, conn *UserConn) { rwLock.Lock() defer rwLock.Unlock() if oldConn, ok := ws.wsUserToConn[uid]; ok { @@ -95,7 +104,7 @@ func (ws *WServer) addUserConn(uid string, conn *websocket.Conn) { } -func (ws *WServer) delUserConn(conn *websocket.Conn) { +func (ws *WServer) delUserConn(conn *UserConn) { rwLock.Lock() defer rwLock.Unlock() var uidPlatform string @@ -111,12 +120,12 @@ func (ws *WServer) delUserConn(conn *websocket.Conn) { } err := conn.Close() if err != nil { - log.ErrorByKv("close err", "", "uid", uidPlatform, "conn", conn) + log.ErrorByKv("close err", "", "uid", uidPlatform) } } -func (ws *WServer) getUserConn(uid string) *websocket.Conn { +func (ws *WServer) getUserConn(uid string) *UserConn { rwLock.RLock() defer rwLock.RUnlock() if conn, ok := ws.wsUserToConn[uid]; ok { @@ -124,7 +133,7 @@ func (ws *WServer) getUserConn(uid string) *websocket.Conn { } return nil } -func (ws *WServer) getUserUid(conn *websocket.Conn) string { +func (ws *WServer) getUserUid(conn *UserConn) string { rwLock.RLock() defer rwLock.RUnlock() diff --git a/internal/msg_transfer/logic/db.go b/internal/msg_transfer/logic/db.go index d88d6d452..3d6e0e3f6 100644 --- a/internal/msg_transfer/logic/db.go +++ b/internal/msg_transfer/logic/db.go @@ -1,17 +1,22 @@ package logic import ( - pbMsg "Open_IM/pkg/proto/chat" "Open_IM/pkg/common/db" "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" ) func saveUserChat(uid string, pbMsg *pbMsg.MsgSvrToPushSvrChatMsg) error { + time := utils.GetCurrentTimestampByMill() seq, err := db.DB.IncrUserSeq(uid) if err != nil { + log.NewError(pbMsg.OperationID, "data insert to redis err", err.Error(), pbMsg.String()) return err } pbMsg.RecvSeq = seq + log.NewInfo(pbMsg.OperationID, "IncrUserSeq cost time", utils.GetCurrentTimestampByMill()-time) return db.DB.SaveUserChat(uid, pbMsg.SendTime, pbMsg) } diff --git a/internal/msg_transfer/logic/history_msg_handler.go b/internal/msg_transfer/logic/history_msg_handler.go index 9833bf05b..9ae3c5a0f 100644 --- a/internal/msg_transfer/logic/history_msg_handler.go +++ b/internal/msg_transfer/logic/history_msg_handler.go @@ -10,9 +10,10 @@ import ( pbPush "Open_IM/pkg/proto/push" "Open_IM/pkg/utils" "context" + "strings" + "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" - "strings" ) type fcb func(msg []byte, msgKey string) @@ -33,6 +34,7 @@ func (mc *HistoryConsumerHandler) Init() { func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) { log.InfoByKv("chat come mongo!!!", "", "chat", string(msg)) + time := utils.GetCurrentTimestampByNano() pbData := pbMsg.WSToMsgSvrChatMsg{} err := proto.Unmarshal(msg, &pbData) if err != nil { @@ -58,48 +60,53 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) isHistory := utils.GetSwitchFromOptions(Options, "history") //Control whether to store history messages (mysql) isPersist := utils.GetSwitchFromOptions(Options, "persistent") - if pbData.SessionType == constant.SingleChatType { - log.Info("", "", "msg_transfer chat type = SingleChatType", isHistory, isPersist) + switch pbData.SessionType { + case constant.SingleChatType: + log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = SingleChatType", isHistory, isPersist) if isHistory { if msgKey == pbSaveData.RecvID { err := saveUserChat(pbData.RecvID, &pbSaveData) if err != nil { - log.ErrorByKv("data insert to mongo err", pbSaveData.OperationID, "data", pbSaveData.String(), "err", err.Error()) + log.NewError(pbSaveData.OperationID, "single data insert to mongo err", err.Error(), pbSaveData.String()) + return } + } else if msgKey == pbSaveData.SendID { err := saveUserChat(pbData.SendID, &pbSaveData) if err != nil { - log.ErrorByKv("data insert to mongo err", pbSaveData.OperationID, "data", pbSaveData.String(), "err", err.Error()) + log.NewError(pbSaveData.OperationID, "single data insert to mongo err", err.Error(), pbSaveData.String()) + return } - //if isSenderSync { - // pbSaveData.ContentType = constant.SyncSenderMsg - // log.WarnByKv("SyncSenderMsg come here", pbData.OperationID, pbSaveData.String()) - // sendMessageToPush(&pbSaveData) - //} + } + log.NewDebug(pbSaveData.OperationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time) } if msgKey == pbSaveData.RecvID { pbSaveData.Options = pbData.Options pbSaveData.OfflineInfo = pbData.OfflineInfo - sendMessageToPush(&pbSaveData) + go sendMessageToPush(&pbSaveData) + log.NewDebug(pbSaveData.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time) } - log.InfoByKv("msg_transfer handle topic success...", "", "") - } else if pbData.SessionType == constant.GroupChatType { - log.Info("", "", "msg_transfer chat type = GroupChatType") + case constant.GroupChatType: + log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = GroupChatType", isHistory, isPersist) if isHistory { uidAndGroupID := strings.Split(pbData.RecvID, " ") - saveUserChat(uidAndGroupID[0], &pbSaveData) + err := saveUserChat(uidAndGroupID[0], &pbSaveData) + if err != nil { + log.NewError(pbSaveData.OperationID, "group data insert to mongo err", pbSaveData.String(), uidAndGroupID[0], err.Error()) + return + } } pbSaveData.Options = pbData.Options pbSaveData.OfflineInfo = pbData.OfflineInfo - sendMessageToPush(&pbSaveData) - log.InfoByKv("msg_transfer handle topic success...", "", "") - } else { - log.Error("", "", "msg_transfer recv chat err, chat.MsgFrom = %d", pbData.SessionType) + go sendMessageToPush(&pbSaveData) + default: + log.NewError(pbSaveData.OperationID, "SessionType error", pbSaveData.String()) + return } - + log.NewDebug(pbSaveData.OperationID, "msg_transfer handle topic data to database success...", pbSaveData.String()) } func (HistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } @@ -132,7 +139,7 @@ func sendMessageToPush(message *pbMsg.MsgSvrToPushSvrChatMsg) { msg.SendTime = message.SendTime msg.MsgID = message.MsgID msg.OfflineInfo = message.OfflineInfo - grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName) + grpcConn := getcdv3.GetPushConn() if grpcConn == nil { log.ErrorByKv("rpc dial failed", msg.OperationID, "push data", msg.String()) pid, offset, err := producer.SendMessage(message) diff --git a/internal/push/jpush/common/JGPlatform.go b/internal/push/jpush/common/JGPlatform.go new file mode 100644 index 000000000..e2e858cf4 --- /dev/null +++ b/internal/push/jpush/common/JGPlatform.go @@ -0,0 +1,13 @@ +package common + +import ( + "encoding/base64" + "fmt" +) + +func GetAuthorization(Appkey string, MasterSecret string) string { + str := fmt.Sprintf("%s:%s", Appkey, MasterSecret) + buf := []byte(str) + Authorization := fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString(buf)) + return Authorization +} diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go new file mode 100644 index 000000000..b2cf95d9a --- /dev/null +++ b/internal/push/jpush/push.go @@ -0,0 +1,55 @@ +package push + +import ( + "Open_IM/internal/push/jpush/common" + "Open_IM/internal/push/jpush/requestBody" + "Open_IM/pkg/common/config" + "bytes" + "encoding/json" + "io/ioutil" + "net/http" +) + +type JPushResp struct { +} + +func JGAccountListPush(accounts []string, content, detailContent, platform string) ([]byte, error) { + + var pf requestBody.Platform + _ = pf.SetPlatform(platform) + var au requestBody.Audience + au.SetAlias(accounts) + var no requestBody.Notification + no.SetAlert(content) + var me requestBody.Message + me.SetMsgContent(detailContent) + var po requestBody.PushObj + po.SetPlatform(&pf) + po.SetAudience(&au) + po.SetNotification(&no) + po.SetMessage(&me) + + con, err := json.Marshal(po) + if err != nil { + return nil, err + } + + client := &http.Client{} + + req, err := http.NewRequest("POST", config.Config.Push.Jpns.PushUrl, bytes.NewBuffer(con)) + if err != nil { + return nil, err + } + req.Header.Set("Authorization", common.GetAuthorization(config.Config.Push.Jpns.AppKey, config.Config.Push.Jpns.MasterSecret)) + + resp, err := client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + result, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + return result, nil +} diff --git a/internal/push/jpush/requestBody/audience.go b/internal/push/jpush/requestBody/audience.go new file mode 100644 index 000000000..dc20a83df --- /dev/null +++ b/internal/push/jpush/requestBody/audience.go @@ -0,0 +1,53 @@ +package requestBody + +const ( + TAG = "tag" + TAG_AND = "tag_and" + TAG_NOT = "tag_not" + ALIAS = "alias" + REGISTRATION_ID = "registration_id" + SEGMENT = "segment" + ABTEST = "abtest" +) + +type Audience struct { + Object interface{} + audience map[string][]string +} + +func (a *Audience) set(key string, v []string) { + if a.audience == nil { + a.audience = make(map[string][]string) + a.Object = a.audience + } + + //v, ok = this.audience[key] + //if ok { + // return + //} + a.audience[key] = v +} + +func (a *Audience) SetTag(tags []string) { + a.set(TAG, tags) +} + +func (a *Audience) SetTagAnd(tags []string) { + a.set(TAG_AND, tags) +} + +func (a *Audience) SetTagNot(tags []string) { + a.set(TAG_NOT, tags) +} + +func (a *Audience) SetAlias(alias []string) { + a.set(ALIAS, alias) +} + +func (a *Audience) SetRegistrationId(ids []string) { + a.set(REGISTRATION_ID, ids) +} + +func (a *Audience) SetAll() { + a.Object = "all" +} diff --git a/internal/push/jpush/requestBody/message.go b/internal/push/jpush/requestBody/message.go new file mode 100644 index 000000000..6e6fe1eb9 --- /dev/null +++ b/internal/push/jpush/requestBody/message.go @@ -0,0 +1,27 @@ +package requestBody + +type Message struct { + MsgContent string `json:"msg_content"` + Title string `json:"title,omitempty"` + ContentType string `json:"content_type,omitempty"` + Extras map[string]interface{} `json:"extras,omitempty"` +} + +func (m *Message) SetMsgContent(c string) { + m.MsgContent = c +} + +func (m *Message) SetTitle(t string) { + m.Title = t +} + +func (m *Message) SetContentType(c string) { + m.ContentType = c +} + +func (m *Message) SetExtras(key string, value interface{}) { + if m.Extras == nil { + m.Extras = make(map[string]interface{}) + } + m.Extras[key] = value +} diff --git a/internal/push/jpush/requestBody/notification.go b/internal/push/jpush/requestBody/notification.go new file mode 100644 index 000000000..192803353 --- /dev/null +++ b/internal/push/jpush/requestBody/notification.go @@ -0,0 +1,17 @@ +package requestBody + +type Notification struct { + Alert string `json:"alert,omitempty"` + Android *Android `json:"android,omitempty"` + IOS *Ios `json:"ios,omitempty"` +} + +type Android struct { +} + +type Ios struct { +} + +func (n *Notification) SetAlert(alert string) { + n.Alert = alert +} diff --git a/internal/push/jpush/requestBody/platform.go b/internal/push/jpush/requestBody/platform.go new file mode 100644 index 000000000..47a08fc57 --- /dev/null +++ b/internal/push/jpush/requestBody/platform.go @@ -0,0 +1,83 @@ +package requestBody + +import ( + "Open_IM/pkg/utils" + "errors" +) + +const ( + ANDROID = "android" + IOS = "ios" + QUICKAPP = "quickapp" + WINDOWSPHONE = "winphone" + ALL = "all" +) + +type Platform struct { + Os interface{} + osArry []string +} + +func (p *Platform) Set(os string) error { + if p.Os == nil { + p.osArry = make([]string, 0, 4) + } else { + switch p.Os.(type) { + case string: + return errors.New("platform is all") + default: + } + } + + for _, value := range p.osArry { + if os == value { + return nil + } + } + + switch os { + case IOS: + fallthrough + case ANDROID: + fallthrough + case QUICKAPP: + fallthrough + case WINDOWSPHONE: + p.osArry = append(p.osArry, os) + p.Os = p.osArry + default: + return errors.New("unknow platform") + } + + return nil +} +func (p *Platform) SetPlatform(platform string) error { + switch platform { + case utils.AndroidPlatformStr: + return p.SetAndroid() + case utils.IOSPlatformStr: + return p.SetIOS() + default: + return errors.New("platform err") + } + +} +func (p *Platform) SetIOS() error { + return p.Set(IOS) +} + +func (p *Platform) SetAndroid() error { + return p.Set(ANDROID) +} + +func (p *Platform) SetQuickApp() error { + return p.Set(QUICKAPP) +} + +func (p *Platform) SetWindowsPhone() error { + return p.Set(WINDOWSPHONE) +} + +func (p *Platform) SetAll() { + p.Os = ALL +} diff --git a/internal/push/jpush/requestBody/pushObj.go b/internal/push/jpush/requestBody/pushObj.go new file mode 100644 index 000000000..24c912b26 --- /dev/null +++ b/internal/push/jpush/requestBody/pushObj.go @@ -0,0 +1,24 @@ +package requestBody + +type PushObj struct { + Platform interface{} `json:"platform"` + Audience interface{} `json:"audience"` + Notification interface{} `json:"notification,omitempty"` + Message interface{} `json:"message,omitempty"` +} + +func (p *PushObj) SetPlatform(pf *Platform) { + p.Platform = pf.Os +} + +func (p *PushObj) SetAudience(ad *Audience) { + p.Audience = ad.Object +} + +func (p *PushObj) SetNotification(no *Notification) { + p.Notification = no +} + +func (p *PushObj) SetMessage(m *Message) { + p.Message = m +} diff --git a/internal/push/logic/init.go b/internal/push/logic/init.go index be36469b2..9fba41bdd 100644 --- a/internal/push/logic/init.go +++ b/internal/push/logic/init.go @@ -24,7 +24,7 @@ func Init(rpcPort int) { log.NewPrivateLog(config.Config.ModuleName.PushName) rpcServer.Init(rpcPort) pushCh.Init() - pushTerminal = []int32{utils.IOSPlatformID} + pushTerminal = []int32{utils.IOSPlatformID, utils.AndroidPlatformID} } func init() { producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 5262add60..e6754212c 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -7,38 +7,39 @@ package logic import ( + push "Open_IM/internal/push/jpush" rpcChat "Open_IM/internal/rpc/chat" - "Open_IM/internal/rpc/user/internal_service" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" pbChat "Open_IM/pkg/proto/chat" pbGroup "Open_IM/pkg/proto/group" pbRelay "Open_IM/pkg/proto/relay" - pbGetInfo "Open_IM/pkg/proto/user" "Open_IM/pkg/utils" - "Open_IM/pkg/grpc-etcdv3/getcdv3" "context" "encoding/json" - "fmt" - "strings" ) -type EChatContent struct { - SessionType int `json:"chatType"` +type OpenIMContent struct { + SessionType int `json:"sessionType"` From string `json:"from"` To string `json:"to"` Seq int64 `json:"seq"` } +type AtContent struct { + Text string `json:"text"` + AtUserList []string `json:"atUserList"` + IsAtSelf bool `json:"isAtSelf"` +} func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) { var wsResult []*pbRelay.SingleMsgToUser - //isShouldOfflinePush := true MOptions := utils.JsonStringToMap(Options) //Control whether to push message to sender's other terminal //isSenderSync := utils.GetSwitchFromOptions(MOptions, "senderSync") isOfflinePush := utils.GetSwitchFromOptions(MOptions, "offlinePush") log.InfoByKv("Get chat from msg_transfer And push chat", sendPbData.OperationID, "PushData", sendPbData) - grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + grpcCons := getcdv3.GetOnlineMessageConn() //Online push message log.InfoByKv("test", sendPbData.OperationID, "len grpc", len(grpcCons), "data", sendPbData) for _, v := range grpcCons { @@ -51,101 +52,61 @@ func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) { wsResult = append(wsResult, reply.Resp...) } } - log.InfoByKv("push_result", sendPbData.OperationID, "result", wsResult) - if isOfflinePush { - - for _, v := range wsResult { - if v.ResultCode == 0 { - continue - } - //supported terminal - for _, t := range pushTerminal { - if v.RecvPlatFormID == t { - //Use offline push messaging - var UIDList []string - UIDList = append(UIDList, sendPbData.RecvID) - var sendUIDList []string - sendUIDList = append(sendUIDList, sendPbData.SendID) - userInfo, err := internal_service.GetUserInfoClient(&pbGetInfo.GetUserInfoReq{UserIDList: sendUIDList, OperationID: sendPbData.OperationID}) - if err != nil { - log.ErrorByArgs(fmt.Sprintf("err=%v,call GetUserInfoClient rpc server failed", err)) - return - } - - customContent := EChatContent{ - SessionType: int(sendPbData.SessionType), - From: sendPbData.SendID, - To: sendPbData.RecvID, - Seq: sendPbData.RecvSeq, - } - bCustomContent, _ := json.Marshal(customContent) - - jsonCustomContent := string(bCustomContent) - switch sendPbData.ContentType { - case constant.Text: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, sendPbData.Content, jsonCustomContent) - case constant.Picture: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.Picture], jsonCustomContent) - case constant.Voice: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.Voice], jsonCustomContent) - case constant.Video: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.Video], jsonCustomContent) - case constant.File: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.File], jsonCustomContent) - default: - - } - } - } - } - /*for _, t := range pushTerminal { + log.InfoByKv("push_result", sendPbData.OperationID, "result", wsResult, "sendData", sendPbData) + if sendPbData.ContentType != constant.Typing && sendPbData.ContentType != constant.HasReadReceipt { + if isOfflinePush { for _, v := range wsResult { - if v.RecvPlatFormID == t && v.ResultCode == 0 { - isShouldOfflinePush = false - break - } - } - if isShouldOfflinePush { - //Use offline push messaging - var UIDList []string - UIDList = append(UIDList, sendPbData.RecvID) - var sendUIDList []string - sendUIDList = append(sendUIDList, sendPbData.SendID) - userInfo, err := internal_service.GetUserInfoClient(&pbGetInfo.GetUserInfoReq{UserIDList: sendUIDList, OperationID: sendPbData.OperationID}) - if err != nil { - log.ErrorByArgs(fmt.Sprintf("err=%v,call GetUserInfoClient rpc server failed", err)) - return + if v.ResultCode == 0 { + continue } + //supported terminal + for _, t := range pushTerminal { + if v.RecvPlatFormID == t { + //Use offline push messaging + var UIDList []string + UIDList = append(UIDList, v.RecvID) + customContent := OpenIMContent{ + SessionType: int(sendPbData.SessionType), + From: sendPbData.SendID, + To: sendPbData.RecvID, + Seq: sendPbData.RecvSeq, + } + bCustomContent, _ := json.Marshal(customContent) + jsonCustomContent := string(bCustomContent) + var content string + switch sendPbData.ContentType { + case constant.Text: + content = constant.ContentType2PushContent[constant.Text] + case constant.Picture: + content = constant.ContentType2PushContent[constant.Picture] + case constant.Voice: + content = constant.ContentType2PushContent[constant.Voice] + case constant.Video: + content = constant.ContentType2PushContent[constant.Video] + case constant.File: + content = constant.ContentType2PushContent[constant.File] + case constant.AtText: + a := AtContent{} + _ = utils.JsonStringToStruct(sendPbData.Content, &a) + if utils.IsContain(v.RecvID, a.AtUserList) { + content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] + } else { + content = constant.ContentType2PushContent[constant.GroupMsg] + } + default: + } + pushResult, err := push.JGAccountListPush(UIDList, content, jsonCustomContent, utils.PlatformIDToName(t)) + if err != nil { + log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), t) + } else { + log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, t) + } - customContent := EChatContent{ - SessionType: int(sendPbData.SessionType), - From: sendPbData.SendID, - To: sendPbData.RecvID, - Seq: sendPbData.RecvSeq, - } - bCustomContent, _ := json.Marshal(customContent) - - jsonCustomContent := string(bCustomContent) - switch sendPbData.ContentType { - case constant.Text: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, sendPbData.Content, jsonCustomContent) - case constant.Picture: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.Picture], jsonCustomContent) - case constant.Voice: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.Voice], jsonCustomContent) - case constant.Video: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.Video], jsonCustomContent) - case constant.File: - IOSAccountListPush(UIDList, userInfo.Data[0].Name, constant.ContentType2PushContent[constant.File], jsonCustomContent) - default: - + } } - - } else { - isShouldOfflinePush = true } - }*/ + } } } @@ -158,7 +119,7 @@ func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) { sendMsgToKafka(m, m.SendID, "msgKey--sendID") sendMsgToKafka(m, m.RecvID, "msgKey--recvID") case constant.GroupChatType: - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + etcdConn := getcdv3.GetGroupConn() client := pbGroup.NewGroupClient(etcdConn) req := &pbGroup.GetGroupAllMemberReq{ GroupID: m.RecvID, diff --git a/internal/rpc/auth/user_register.go b/internal/rpc/auth/user_register.go index 3f5de7032..5f7aa9023 100644 --- a/internal/rpc/auth/user_register.go +++ b/internal/rpc/auth/user_register.go @@ -10,6 +10,9 @@ import ( func (rpc *rpcAuth) UserRegister(_ context.Context, pb *pbAuth.UserRegisterReq) (*pbAuth.UserRegisterResp, error) { log.Info("", "", "rpc user_register start, [data: %s]", pb.String()) + //if len(pb.UID) == 0 { + // pb.UID = utils.GenID() + //} if err := im_mysql_model.UserRegister(pb); err != nil { log.Error("", "", "rpc user_register error, [data: %s] [err: %s]", pb.String(), err.Error()) return &pbAuth.UserRegisterResp{Success: false}, err diff --git a/internal/rpc/auth/user_token.go b/internal/rpc/auth/user_token.go index 73b544d64..6ebb2900b 100644 --- a/internal/rpc/auth/user_token.go +++ b/internal/rpc/auth/user_token.go @@ -18,7 +18,7 @@ func (rpc *rpcAuth) UserToken(_ context.Context, pb *pbAuth.UserTokenReq) (*pbAu } log.Info("", "", "rpc user_token call..., im_mysql_model.AppServerFindFromUserByUserID") - tokens, expTime, err := utils.CreateToken(pb.UID, "", pb.Platform) + tokens, expTime, err := utils.CreateToken(pb.UID, pb.Platform) if err != nil { log.Error("", "", "rpc user_token call..., utils.CreateToken fail [uid: %s] [err: %s]", pb.UID, err.Error()) return &pbAuth.UserTokenResp{ErrCode: 500, ErrMsg: err.Error()}, err diff --git a/internal/rpc/chat/pull_message.go b/internal/rpc/chat/pull_message.go index 941c3a9b1..725725037 100644 --- a/internal/rpc/chat/pull_message.go +++ b/internal/rpc/chat/pull_message.go @@ -13,35 +13,40 @@ import ( pbMsg "Open_IM/pkg/proto/chat" ) -func (rpc *rpcChat) GetNewSeq(_ context.Context, in *pbMsg.GetNewSeqReq) (*pbMsg.GetNewSeqResp, error) { - log.InfoByKv("rpc getNewSeq is arriving", in.OperationID, in.String()) +func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *pbMsg.GetMaxAndMinSeqReq) (*pbMsg.GetMaxAndMinSeqResp, error) { + log.InfoByKv("rpc getMaxAndMinSeq is arriving", in.OperationID, in.String()) //seq, err := model.GetBiggestSeqFromReceive(in.UserID) - seq, err := commonDB.DB.GetUserSeq(in.UserID) - resp := new(pbMsg.GetNewSeqResp) - if err == nil { - resp.Seq = seq - resp.ErrCode = 0 - resp.ErrMsg = "" - return resp, err + maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID) + minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) + resp := new(pbMsg.GetMaxAndMinSeqResp) + if err1 == nil { + resp.MaxSeq = maxSeq + } else if err1 == redis.ErrNil { + resp.MaxSeq = 0 } else { - if err == redis.ErrNil { - resp.Seq = 0 - } else { - log.ErrorByKv("getSeq from redis error", in.OperationID, "args", in.String(), "err", err.Error()) - resp.Seq = -1 - } - resp.ErrCode = 0 - resp.ErrMsg = "" - return resp, nil + log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err1.Error()) + resp.MaxSeq = -1 + resp.ErrCode = 200 + resp.ErrMsg = "redis get err" } - + if err2 == nil { + resp.MinSeq = minSeq + } else if err2 == redis.ErrNil { + resp.MinSeq = 0 + } else { + log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err2.Error()) + resp.MinSeq = -1 + resp.ErrCode = 201 + resp.ErrMsg = "redis get err" + } + return resp, nil } func (rpc *rpcChat) PullMessage(_ context.Context, in *pbMsg.PullMessageReq) (*pbMsg.PullMessageResp, error) { log.InfoByKv("rpc pullMessage is arriving", in.OperationID, "args", in.String()) resp := new(pbMsg.PullMessageResp) var respSingleMsgFormat []*pbMsg.GatherFormat var respGroupMsgFormat []*pbMsg.GatherFormat - SingleMsgFormat, GroupMsgFormat, MaxSeq, MinSeq, err := commonDB.DB.GetUserChat(in.UserID, in.SeqBegin, in.SeqEnd) + SingleMsgFormat, GroupMsgFormat, MaxSeq, MinSeq, err := commonDB.DB.GetMsgBySeqRange(in.UserID, in.SeqBegin, in.SeqEnd) if err != nil { log.ErrorByKv("pullMsg data error", in.OperationID, in.String()) resp.ErrCode = 1 @@ -59,6 +64,29 @@ func (rpc *rpcChat) PullMessage(_ context.Context, in *pbMsg.PullMessageReq) (*p GroupUserMsg: respGroupMsgFormat, }, nil } +func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *pbMsg.PullMessageBySeqListReq) (*pbMsg.PullMessageResp, error) { + log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String()) + resp := new(pbMsg.PullMessageResp) + var respSingleMsgFormat []*pbMsg.GatherFormat + var respGroupMsgFormat []*pbMsg.GatherFormat + SingleMsgFormat, GroupMsgFormat, MaxSeq, MinSeq, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList) + if err != nil { + log.ErrorByKv("PullMessageBySeqList data error", in.OperationID, in.String()) + resp.ErrCode = 1 + resp.ErrMsg = err.Error() + return resp, nil + } + respSingleMsgFormat = singleMsgHandleByUser(SingleMsgFormat, in.UserID) + respGroupMsgFormat = groupMsgHandleByUser(GroupMsgFormat) + return &pbMsg.PullMessageResp{ + ErrCode: 0, + ErrMsg: "", + MaxSeq: MaxSeq, + MinSeq: MinSeq, + SingleUserMsg: respSingleMsgFormat, + GroupUserMsg: respGroupMsgFormat, + }, nil +} func singleMsgHandleByUser(allMsg []*pbMsg.MsgFormat, ownerId string) []*pbMsg.GatherFormat { var userid string var respMsgFormat []*pbMsg.GatherFormat diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index 87f363a8f..3c31ab2dc 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -16,7 +16,6 @@ import ( "math/rand" "net/http" "strconv" - "strings" "time" ) @@ -42,10 +41,9 @@ type MsgCallBackResp struct { func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (*pbChat.UserSendMsgResp, error) { replay := pbChat.UserSendMsgResp{} - log.InfoByKv("sendMsg", pb.OperationID, "args", pb.String()) - if !utils.VerifyToken(pb.Token, pb.SendID) { - return returnMsg(&replay, pb, http.StatusUnauthorized, "token validate err,not authorized", "", 0) - } + log.NewDebug(pb.OperationID, "rpc sendMsg come here", pb.String()) + //if !utils.VerifyToken(pb.Token, pb.SendID) { + // return returnMsg(&replay, pb, http.StatusUnauthorized, "token validate err,not authorized", "", 0) serverMsgID := GetMsgID(pb.SendID) pbData := pbChat.WSToMsgSvrChatMsg{} pbData.MsgFrom = pb.MsgFrom @@ -64,7 +62,11 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* pbData.MsgID = serverMsgID pbData.OperationID = pb.OperationID pbData.Token = pb.Token - pbData.SendTime = utils.GetCurrentTimestampByNano() + if pb.SendTime == 0 { + pbData.SendTime = utils.GetCurrentTimestampByNano() + } else { + pbData.SendTime = pb.SendTime + } m := MsgCallBackResp{} if config.Config.MessageCallBack.CallbackSwitch { bMsg, err := http2.Post(config.Config.MessageCallBack.CallbackUrl, MsgCallBackReq{ @@ -88,85 +90,77 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* return returnMsg(&replay, pb, m.ResponseErrCode, m.ErrMsg, "", 0) } else { pbData.Content = m.ResponseResult.ModifiedMsg - err1 := rpc.sendMsgToKafka(&pbData, pbData.RecvID) - err2 := rpc.sendMsgToKafka(&pbData, pbData.SendID) - if err1 != nil || err2 != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) - } - return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) } } - } else { - switch pbData.SessionType { - case constant.SingleChatType: - err1 := rpc.sendMsgToKafka(&pbData, pbData.RecvID) - err2 := rpc.sendMsgToKafka(&pbData, pbData.SendID) - if err1 != nil || err2 != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) - } - return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) - case constant.GroupChatType: - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) - client := pbGroup.NewGroupClient(etcdConn) - req := &pbGroup.GetGroupAllMemberReq{ - GroupID: pbData.RecvID, - Token: pbData.Token, - OperationID: pbData.OperationID, - } - reply, err := client.GetGroupAllMember(context.Background(), req) + } + switch pbData.SessionType { + case constant.SingleChatType: + err1 := rpc.sendMsgToKafka(&pbData, pbData.RecvID) + err2 := rpc.sendMsgToKafka(&pbData, pbData.SendID) + if err1 != nil || err2 != nil { + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) + case constant.GroupChatType: + etcdConn := getcdv3.GetGroupConn() + client := pbGroup.NewGroupClient(etcdConn) + req := &pbGroup.GetGroupAllMemberReq{ + GroupID: pbData.RecvID, + Token: pbData.Token, + OperationID: pbData.OperationID, + } + reply, err := client.GetGroupAllMember(context.Background(), req) + if err != nil { + log.Error(pbData.Token, pbData.OperationID, "rpc send_msg getGroupInfo failed, err = %s", err.Error()) + return returnMsg(&replay, pb, 201, err.Error(), "", 0) + } + if reply.ErrorCode != 0 { + log.Error(pbData.Token, pbData.OperationID, "rpc send_msg getGroupInfo failed, err = %s", reply.ErrorMsg) + return returnMsg(&replay, pb, reply.ErrorCode, reply.ErrorMsg, "", 0) + } + var addUidList []string + switch pbData.ContentType { + case constant.KickGroupMemberTip: + var notification content_struct.NotificationContent + var kickContent group.KickGroupMemberReq + err := utils.JsonStringToStruct(pbData.Content, ¬ification) if err != nil { - log.Error(pbData.Token, pbData.OperationID, "rpc send_msg getGroupInfo failed, err = %s", err.Error()) - return returnMsg(&replay, pb, 201, err.Error(), "", 0) - } - if reply.ErrorCode != 0 { - log.Error(pbData.Token, pbData.OperationID, "rpc send_msg getGroupInfo failed, err = %s", reply.ErrorMsg) - return returnMsg(&replay, pb, reply.ErrorCode, reply.ErrorMsg, "", 0) - } - var addUidList []string - switch pbData.ContentType { - case constant.KickGroupMemberTip: - var notification content_struct.NotificationContent - var kickContent group.KickGroupMemberReq - err := utils.JsonStringToStruct(pbData.Content, ¬ification) + log.ErrorByKv("json unmarshall err", pbData.OperationID, "err", err.Error()) + return returnMsg(&replay, pb, 200, err.Error(), "", 0) + } else { + err := utils.JsonStringToStruct(notification.Detail, &kickContent) if err != nil { log.ErrorByKv("json unmarshall err", pbData.OperationID, "err", err.Error()) return returnMsg(&replay, pb, 200, err.Error(), "", 0) - } else { - err := utils.JsonStringToStruct(notification.Detail, &kickContent) - if err != nil { - log.ErrorByKv("json unmarshall err", pbData.OperationID, "err", err.Error()) - return returnMsg(&replay, pb, 200, err.Error(), "", 0) - } - for _, v := range kickContent.UidListInfo { - addUidList = append(addUidList, v.UserId) - } - } - case constant.QuitGroupTip: - addUidList = append(addUidList, pbData.SendID) - default: - } - groupID := pbData.RecvID - for i, v := range reply.MemberList { - pbData.RecvID = v.UserId + " " + groupID - err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i)) - if err != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } - } - for i, v := range addUidList { - pbData.RecvID = v + " " + groupID - err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i+1)) - if err != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + for _, v := range kickContent.UidListInfo { + addUidList = append(addUidList, v.UserId) } } - return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) + case constant.QuitGroupTip: + addUidList = append(addUidList, pbData.SendID) default: - } + groupID := pbData.RecvID + for i, v := range reply.MemberList { + pbData.RecvID = v.UserId + " " + groupID + err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i)) + if err != nil { + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + for i, v := range addUidList { + pbData.RecvID = v + " " + groupID + err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i+1)) + if err != nil { + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) + default: + return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0) } - return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0) } func (rpc *rpcChat) sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string) error { diff --git a/internal/rpc/friend/add_friend.go b/internal/rpc/friend/add_friend.go index f43c7b8f7..615b05170 100644 --- a/internal/rpc/friend/add_friend.go +++ b/internal/rpc/friend/add_friend.go @@ -55,25 +55,33 @@ func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.ImportFriendResp, error) { log.Info(req.Token, req.OperationID, "ImportFriend come here,args=%s", req.String()) var resp pbFriend.ImportFriendResp + var c pbFriend.CommonResp //Parse token, to find current user information claims, err := utils.ParseToken(req.Token) if err != nil { log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - return &pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{ErrorCode: config.ErrAddFriend.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, FailedUidList: req.UidList}, nil + c.ErrorCode = config.ErrAddFriend.ErrCode + c.ErrorMsg = config.ErrParseToken.ErrMsg + return &pbFriend.ImportFriendResp{CommonResp: &c, FailedUidList: req.UidList}, nil } if !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { - log.Error(req.Token, req.OperationID, "not magager uid", claims.UID) - return &pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{ErrorCode: config.ErrAddFriend.ErrCode, ErrorMsg: "not authorized"}, FailedUidList: req.UidList}, nil + log.Error(req.Token, req.OperationID, "not manager uid", claims.UID) + c.ErrorCode = config.ErrAddFriend.ErrCode + c.ErrorMsg = "not authorized" + return &pbFriend.ImportFriendResp{CommonResp: &c, FailedUidList: req.UidList}, nil } if _, err = im_mysql_model.FindUserByUID(req.OwnerUid); err != nil { log.Error(req.Token, req.OperationID, "this user not exists,cant not add friend", req.OwnerUid) - return &pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{ErrorCode: config.ErrAddFriend.ErrCode, ErrorMsg: "this user not exists,cant not add friend"}, FailedUidList: req.UidList}, nil + c.ErrorCode = config.ErrAddFriend.ErrCode + c.ErrorMsg = "this user not exists,cant not add friend" + return &pbFriend.ImportFriendResp{CommonResp: &c, FailedUidList: req.UidList}, nil } for _, v := range req.UidList { - if _, err = im_mysql_model.FindUserByUID(v); err != nil { - resp.CommonResp.ErrorMsg = "some uid establish failed" - resp.CommonResp.ErrorCode = 408 + if _, fErr := im_mysql_model.FindUserByUID(v); fErr != nil { + c.ErrorMsg = "some uid establish failed" + c.ErrorCode = 408 + resp.CommonResp = &c resp.FailedUidList = append(resp.FailedUidList, v) } else { if _, err = im_mysql_model.FindFriendRelationshipFromFriend(req.OwnerUid, v); err != nil { @@ -81,18 +89,18 @@ func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFri err1 := im_mysql_model.InsertToFriend(req.OwnerUid, v, 1) if err1 != nil { resp.FailedUidList = append(resp.FailedUidList, v) - log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) + log.NewError(req.OperationID, "err1,create friendship failed", req.OwnerUid, v, err1.Error()) } err2 := im_mysql_model.InsertToFriend(v, req.OwnerUid, 1) if err2 != nil { - log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) + log.NewError(req.OperationID, "err2,create friendship failed", v, req.OwnerUid, err2.Error()) } if err1 == nil && err2 == nil { var name, faceUrl string - n := content_struct.NotificationContent{1, constant.FriendAcceptTip, ""} + n := content_struct.NotificationContent{IsDisplay: 1, DefaultTips: constant.FriendAcceptTip} r, err := im_mysql_model.FindUserByUID(v) if err != nil { - log.ErrorByKv("get info failed", req.OperationID, "err", err.Error(), "req", req.String()) + log.NewError(req.OperationID, "get info failed", err.Error(), v) } if r != nil { name, faceUrl = r.Name, r.Icon diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 63c25c69c..d7101680f 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -70,6 +70,12 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrAccess.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil } + groupInfoFromMysql, err := imdb.FindGroupInfoByGroupId(req.GroupID) + if err != nil || groupInfoFromMysql == nil { + log.NewError(req.OperationID, "get group info error", req.GroupID, req.UidList) + return &pbGroup.InviteUserToGroupResp{ErrorCode: config.ErrAccess.ErrCode, ErrorMsg: config.ErrAccess.ErrMsg}, nil + } + // //from User: invite: applicant //to user: invite: invited @@ -157,13 +163,13 @@ func (c *inviteUserToGroupReq) ContentToString() string { } func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGroupAllMemberReq) (*pbGroup.GetGroupAllMemberResp, error) { - claims, err := utils.ParseToken(req.Token) - if err != nil { - log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) - if req.Token != config.Config.Secret { - return &pbGroup.GetGroupAllMemberResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil - } - } + //claims, err := utils.ParseToken(req.Token) + //if err != nil { + // log.Error(req.Token, req.OperationID, "err=%s,parse token failed", err.Error()) + // if req.Token != config.Config.Secret { + // return &pbGroup.GetGroupAllMemberResp{ErrorCode: config.ErrParseToken.ErrCode, ErrorMsg: config.ErrParseToken.ErrMsg}, nil + // } + //} var resp pbGroup.GetGroupAllMemberResp resp.ErrorCode = 0 @@ -171,7 +177,7 @@ func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGro if err != nil { resp.ErrorCode = config.ErrDb.ErrCode resp.ErrorMsg = err.Error() - log.Error(claims.UID, req.OperationID, "FindGroupMemberListByGroupId failed, ", err.Error(), "params: ", req.GroupID) + log.NewError(req.OperationID, "FindGroupMemberListByGroupId failed,", err.Error(), req.GroupID) return &resp, nil } diff --git a/internal/rpc/user/internal_service/get_user_info_to_client.go b/internal/rpc/user/internal_service/get_user_info_to_client.go index 4cd0d0d2d..bda770824 100644 --- a/internal/rpc/user/internal_service/get_user_info_to_client.go +++ b/internal/rpc/user/internal_service/get_user_info_to_client.go @@ -1,15 +1,13 @@ package internal_service import ( - pbUser "Open_IM/pkg/proto/user" - "Open_IM/pkg/common/config" "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbUser "Open_IM/pkg/proto/user" "context" - "strings" ) func GetUserInfoClient(req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) { - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + etcdConn := getcdv3.GetUserConn() client := pbUser.NewUserClient(etcdConn) RpcResp, err := client.GetUserInfo(context.Background(), req) return RpcResp, err diff --git a/internal/rpc/user/update_user_info.go b/internal/rpc/user/update_user_info.go index 14fe9f0db..dce22ab06 100644 --- a/internal/rpc/user/update_user_info.go +++ b/internal/rpc/user/update_user_info.go @@ -12,7 +12,6 @@ import ( pbUser "Open_IM/pkg/proto/user" "Open_IM/pkg/utils" "context" - "strings" ) func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserInfoReq) (*pbUser.CommonResp, error) { @@ -36,7 +35,7 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI log.Error(req.Token, req.OperationID, "update user some attribute failed,err=%s", err.Error()) return &pbUser.CommonResp{ErrorCode: config.ErrModifyUserInfo.ErrCode, ErrorMsg: config.ErrModifyUserInfo.ErrMsg}, nil } - etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + etcdConn := getcdv3.GetFriendConn() client := pbFriend.NewFriendClient(etcdConn) newReq := &pbFriend.GetFriendListReq{ OperationID: req.OperationID, diff --git a/internal/utils/cors_middleware_test.go b/internal/utils/cors_middleware_test.go new file mode 100644 index 000000000..248cc1ca0 --- /dev/null +++ b/internal/utils/cors_middleware_test.go @@ -0,0 +1,68 @@ +package utils + +import ( + "Open_IM/pkg/utils" + "net/http" + "net/http/httptest" + "testing" + + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" +) + +func init() { + gin.SetMode(gin.TestMode) +} + +func performRequest(r http.Handler, method, origin string) *httptest.ResponseRecorder { + return performRequestWithHeaders(r, method, origin, http.Header{}) +} + +func performRequestWithHeaders(r http.Handler, method, origin string, header http.Header) *httptest.ResponseRecorder { + req, _ := http.NewRequest(method, "/", nil) + // From go/net/http/request.go: + // For incoming requests, the Host header is promoted to the + // Request.Host field and removed from the Header map. + req.Host = header.Get("Host") + header.Del("Host") + if len(origin) > 0 { + header.Set("Origin", origin) + } + req.Header = header + w := httptest.NewRecorder() + r.ServeHTTP(w, req) + return w +} + +func newTestRouter() *gin.Engine { + router := gin.New() + router.Use(utils.CorsHandler()) + router.GET("/", func(c *gin.Context) { + c.String(http.StatusOK, "get") + }) + router.POST("/", func(c *gin.Context) { + c.String(http.StatusOK, "post") + }) + router.PATCH("/", func(c *gin.Context) { + c.String(http.StatusOK, "patch") + }) + + return router +} + +func Test_CorsHandler(t *testing.T) { + router := newTestRouter() + // no CORS request, origin == "" + w := performRequest(router, "GET", "") + assert.Equal(t, "get", w.Body.String()) + assert.Equal(t, w.Header().Get("Access-Control-Allow-Origin"), "*") + assert.Equal(t, w.Header().Get("Access-Control-Allow-Methods"), "*") + assert.Equal(t, w.Header().Get("Access-Control-Allow-Headers"), "*") + assert.Equal(t, w.Header().Get("Access-Control-Expose-Headers"), "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers,Cache-Control,Content-Language,Content-Type,Expires,Last-Modified,Pragma,FooBar") + assert.Equal(t, w.Header().Get("Access-Control-Max-Age"), "172800") + assert.Equal(t, w.Header().Get("Access-Control-Allow-Credentials"), "false") + assert.Equal(t, w.Header().Get("content-type"), "application/json") + + w = performRequest(router, "OPTIONS", "") + assert.Equal(t, w.Body.String(), "\"Options Request!\"") +} diff --git a/internal/utils/get_server_ip_test.go b/internal/utils/get_server_ip_test.go new file mode 100644 index 000000000..de15537cb --- /dev/null +++ b/internal/utils/get_server_ip_test.go @@ -0,0 +1,13 @@ +package utils + +import ( + "Open_IM/pkg/utils" + "net" + "testing" +) + +func TestServerIP(t *testing.T) { + if net.ParseIP(utils.ServerIP) == nil { + t.Fail() + } +} diff --git a/internal/utils/id.go b/internal/utils/id.go new file mode 100644 index 000000000..509578df7 --- /dev/null +++ b/internal/utils/id.go @@ -0,0 +1,28 @@ +package utils + +import ( + "github.com/bwmarrin/snowflake" +) + +func init() { + var err error + idGenerator, err = snowflake.NewNode(getNodeNum()) + if err != nil { + panic(err) + } +} + +func getNodeNum() int64 { + return 1 +} + +var idGenerator *snowflake.Node + +func GenID() string { + return idGenerator.Generate().String() +} + +func GenIDs(count int) []string { + //impl + return []string{} +} diff --git a/internal/utils/id_test.go b/internal/utils/id_test.go new file mode 100644 index 000000000..3c0d5938e --- /dev/null +++ b/internal/utils/id_test.go @@ -0,0 +1,15 @@ +package utils + +import "testing" + +func TestGenID(t *testing.T) { + m := map[string]struct{}{} + for i := 0; i < 2000; i++ { + got := GenID() + if _, ok := m[got]; !ok { + m[got] = struct{}{} + } else { + t.Error("id generate error", got) + } + } +} diff --git a/internal/utils/image_test.go b/internal/utils/image_test.go new file mode 100644 index 000000000..ab328fbc4 --- /dev/null +++ b/internal/utils/image_test.go @@ -0,0 +1,28 @@ +package utils + +import ( + "Open_IM/pkg/utils" + "path/filepath" + "runtime" + "testing" + + "github.com/stretchr/testify/assert" +) + +var ( + _, b, _, _ = runtime.Caller(0) + // Root folder of this project + Root = filepath.Join(filepath.Dir(b), "../..") +) + +func Test_GenSmallImage(t *testing.T) { + println(Root) + err := utils.GenSmallImage(Root+"/docs/open-im-logo.png", Root+"/out-test/open-im-logo-test.png") + assert.Nil(t, err) + + err = utils.GenSmallImage(Root+"/docs/open-im-logo.png", "out-test/open-im-logo-test.png") + assert.Nil(t, err) + + err = utils.GenSmallImage(Root+"/docs/Architecture.jpg", "out-test/Architecture-test.jpg") + assert.Nil(t, err) +} diff --git a/internal/utils/jwt_token_test.go b/internal/utils/jwt_token_test.go new file mode 100644 index 000000000..5b8cdb607 --- /dev/null +++ b/internal/utils/jwt_token_test.go @@ -0,0 +1,82 @@ +package utils + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/utils" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func Test_BuildClaims(t *testing.T) { + uid := "1" + platform := "PC" + ttl := int64(-1) + claim := utils.BuildClaims(uid, platform, ttl) + now := time.Now().Unix() + + assert.Equal(t, claim.UID, uid, "uid should equal") + assert.Equal(t, claim.Platform, platform, "platform should equal") + assert.Equal(t, claim.RegisteredClaims.ExpiresAt, int64(-1), "StandardClaims.ExpiresAt should be equal") + // time difference within 1s + assert.Equal(t, claim.RegisteredClaims.IssuedAt, now, "StandardClaims.IssuedAt should be equal") + assert.Equal(t, claim.RegisteredClaims.NotBefore, now, "StandardClaims.NotBefore should be equal") + + ttl = int64(60) + now = time.Now().Unix() + claim = utils.BuildClaims(uid, platform, ttl) + // time difference within 1s + assert.Equal(t, claim.RegisteredClaims.ExpiresAt, int64(60)+now, "StandardClaims.ExpiresAt should be equal") + assert.Equal(t, claim.RegisteredClaims.IssuedAt, now, "StandardClaims.IssuedAt should be equal") + assert.Equal(t, claim.RegisteredClaims.NotBefore, now, "StandardClaims.NotBefore should be equal") +} + +func Test_CreateToken(t *testing.T) { + uid := "1" + platform := int32(1) + now := time.Now().Unix() + + tokenString, expiresAt, err := utils.CreateToken(uid, platform) + + assert.NotEmpty(t, tokenString) + assert.Equal(t, expiresAt, 604800+now) + assert.Nil(t, err) +} + +func Test_VerifyToken(t *testing.T) { + uid := "1" + platform := int32(1) + tokenString, _, _ := utils.CreateToken(uid, platform) + result := utils.VerifyToken(tokenString, uid) + assert.True(t, result) + result = utils.VerifyToken(tokenString, "2") + assert.False(t, result) +} + +func Test_ParseRedisInterfaceToken(t *testing.T) { + uid := "1" + platform := int32(1) + tokenString, _, _ := utils.CreateToken(uid, platform) + + claims, err := utils.ParseRedisInterfaceToken([]uint8(tokenString)) + assert.Nil(t, err) + assert.Equal(t, claims.UID, uid) + + // timeout + config.Config.TokenPolicy.AccessExpire = -80 + tokenString, _, _ = utils.CreateToken(uid, platform) + claims, err = utils.ParseRedisInterfaceToken([]uint8(tokenString)) + assert.Equal(t, err, utils.TokenExpired) + assert.Nil(t, claims) +} + +func Test_ParseToken(t *testing.T) { + uid := "1" + platform := int32(1) + tokenString, _, _ := utils.CreateToken(uid, platform) + claims, err := utils.ParseToken(tokenString) + if err == nil { + assert.Equal(t, claims.UID, uid) + } +} diff --git a/internal/utils/md5_test.go b/internal/utils/md5_test.go new file mode 100644 index 000000000..4db7bd854 --- /dev/null +++ b/internal/utils/md5_test.go @@ -0,0 +1,16 @@ +package utils + +import ( + "Open_IM/pkg/utils" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Md5(t *testing.T) { + result := utils.Md5("go") + assert.Equal(t, result, "34d1f91fb2e514b8576fab1a75a89a6b") + + result2 := utils.Md5("go") + assert.Equal(t, result, result2) +} diff --git a/internal/utils/platform_number_id_to_name_test.go b/internal/utils/platform_number_id_to_name_test.go new file mode 100644 index 000000000..9fd888f44 --- /dev/null +++ b/internal/utils/platform_number_id_to_name_test.go @@ -0,0 +1,46 @@ +package utils + +import ( + "Open_IM/pkg/utils" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_PlatformIDToName(t *testing.T) { + assert.Equal(t, utils.PlatformIDToName(1), "IOS") + assert.Equal(t, utils.PlatformIDToName(2), "Android") + assert.Equal(t, utils.PlatformIDToName(3), "Windows") + assert.Equal(t, utils.PlatformIDToName(4), "OSX") + assert.Equal(t, utils.PlatformIDToName(5), "Web") + assert.Equal(t, utils.PlatformIDToName(6), "MiniWeb") + assert.Equal(t, utils.PlatformIDToName(7), "Linux") + + assert.Equal(t, utils.PlatformIDToName(0), "") +} + +func Test_PlatformNameToID(t *testing.T) { + assert.Equal(t, utils.PlatformNameToID("IOS"), int32(1)) + assert.Equal(t, utils.PlatformNameToID("Android"), int32(2)) + assert.Equal(t, utils.PlatformNameToID("Windows"), int32(3)) + assert.Equal(t, utils.PlatformNameToID("OSX"), int32(4)) + assert.Equal(t, utils.PlatformNameToID("Web"), int32(5)) + assert.Equal(t, utils.PlatformNameToID("MiniWeb"), int32(6)) + assert.Equal(t, utils.PlatformNameToID("Linux"), int32(7)) + + assert.Equal(t, utils.PlatformNameToID("UnknownDevice"), int32(0)) + assert.Equal(t, utils.PlatformNameToID(""), int32(0)) +} + +func Test_PlatformNameToClass(t *testing.T) { + assert.Equal(t, utils.PlatformNameToClass("IOS"), "Mobile") + assert.Equal(t, utils.PlatformNameToClass("Android"), "Mobile") + assert.Equal(t, utils.PlatformNameToClass("OSX"), "PC") + assert.Equal(t, utils.PlatformNameToClass("Windows"), "PC") + assert.Equal(t, utils.PlatformNameToClass("Web"), "PC") + assert.Equal(t, utils.PlatformNameToClass("MiniWeb"), "Mobile") + assert.Equal(t, utils.PlatformNameToClass("Linux"), "PC") + + assert.Equal(t, utils.PlatformNameToClass("UnknownDevice"), "") + assert.Equal(t, utils.PlatformNameToClass(""), "") +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index d296e5f98..f10abdc0d 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -1,16 +1,26 @@ package config import ( - "gopkg.in/yaml.v3" "io/ioutil" + + "gopkg.in/yaml.v3" + + "path/filepath" + "runtime" ) var Config config -type config struct { - ServerIP string `yaml:"serverip"` +var ( + _, b, _, _ = runtime.Caller(0) + // Root folder of this project + Root = filepath.Join(filepath.Dir(b), "../../..") +) - Api struct { +type config struct { + ServerIP string `yaml:"serverip"` + ServerVersion string `yaml:"serverversion"` + Api struct { GinPort []int `yaml:"openImApiPort"` } Sdk struct { @@ -110,6 +120,11 @@ type config struct { SecretKey string `yaml:"secretKey"` } } + Jpns struct { + AppKey string `yaml:"appKey"` + MasterSecret string `yaml:"masterSecret"` + PushUrl string `yaml:"pushUrl"` + } } Manager struct { AppManagerUid []string `yaml:"appManagerUid"` @@ -147,14 +162,14 @@ type config struct { } func init() { - bytes, err := ioutil.ReadFile("config/config.yaml") + // if we cd Open-IM-Server/src/utils and run go test + // it will panic cannot find config/config.yaml + bytes, err := ioutil.ReadFile(Root + "/config/config.yaml") if err != nil { panic(err) - return } if err = yaml.Unmarshal(bytes, &Config); err != nil { panic(err) - return } } diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 7a8f0d1ee..8a1aa4029 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -17,22 +17,27 @@ const ( RefuseFriendFlag = -1 //Websocket Protocol - WSGetNewestSeq = 1001 - WSPullMsg = 1002 - WSSendMsg = 1003 - WSPushMsg = 2001 + WSGetNewestSeq = 1001 + WSPullMsg = 1002 + WSSendMsg = 1003 + WSPullMsgBySeqList = 1004 + WSPushMsg = 2001 + WSDataError = 3001 ///ContentType //UserRelated - Text = 101 - Picture = 102 - Voice = 103 - Video = 104 - File = 105 - AtText = 106 - Custom = 110 + Text = 101 + Picture = 102 + Voice = 103 + Video = 104 + File = 105 + AtText = 106 + Custom = 110 + HasReadReceipt = 112 + Typing = 113 + Common = 200 + GroupMsg = 201 - SyncSenderMsg = 108 //SysRelated AcceptFriendApplicationTip = 201 AddFriendTip = 202 @@ -64,10 +69,14 @@ const ( ) var ContentType2PushContent = map[int64]string{ - Picture: "[picture]", - Voice: "[voice]", - Video: "[video]", - File: "[file]", + Picture: "[å›žį‰‡]", + Voice: "[蝭韺]", + Video: "[视éĸ‘]", + File: "[文äģļ]", + Text: "äŊ æ”ļ到äē†ä¸€æĄæ–‡æœŦæļˆæ¯", + AtText: "[有äēē@äŊ ]", + GroupMsg: "äŊ æ”ļåˆ°ä¸€æĄįž¤čŠæļˆæ¯", + Common: "äŊ æ”ļåˆ°ä¸€æĄæ–°æļˆæ¯", } const FriendAcceptTip = "You have successfully become friends, so start chatting" diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index a8a790576..494f8ffaf 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -39,6 +39,11 @@ func init() { } DB.mgoSession = mgoSession DB.mgoSession.SetMode(mgo.Monotonic, true) + c := DB.mgoSession.DB(config.Config.Mongo.DBDatabase).C(cChat) + err = c.EnsureIndexKey("uid") + if err != nil { + panic(err) + } // redis pool init DB.redisPool = &redis.Pool{ diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index f75843a4c..93f64ff5f 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -1,17 +1,21 @@ package db import ( - pbMsg "Open_IM/pkg/proto/chat" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" "errors" + "github.com/garyburd/redigo/redis" "github.com/golang/protobuf/proto" "gopkg.in/mgo.v2/bson" + "strconv" "time" ) const cChat = "chat" const cGroup = "group" +const singleGocMsgNum = 5000 type MsgInfo struct { SendTime int64 @@ -28,8 +32,8 @@ type GroupMember struct { UIDList []string } -func (d *DataBases) GetUserChat(uid string, seqBegin, seqEnd int64) (SingleMsg []*pbMsg.MsgFormat, GroupMsg []*pbMsg.MsgFormat, MaxSeq int64, MinSeq int64, err error) { - count := 0 +func (d *DataBases) GetMsgBySeqRange(uid string, seqBegin, seqEnd int64) (SingleMsg []*pbMsg.MsgFormat, GroupMsg []*pbMsg.MsgFormat, MaxSeq int64, MinSeq int64, err error) { + var count int64 session := d.mgoSession.Clone() if session == nil { return nil, nil, MaxSeq, MinSeq, errors.New("session == nil") @@ -76,48 +80,152 @@ func (d *DataBases) GetUserChat(uid string, seqBegin, seqEnd int64) (SingleMsg [ GroupMsg = append(GroupMsg, temp) } count++ + if count == (seqEnd - seqBegin + 1) { + break + } } } return SingleMsg, GroupMsg, MaxSeq, MinSeq, nil } +func (d *DataBases) GetMinSeqFromMongo(uid string) (MinSeq int64, err error) { + var i int64 + var seqUid string + session := d.mgoSession.Clone() + if session == nil { + return MinSeq, errors.New("session == nil") + } + defer session.Close() + c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + MaxSeq, err := d.GetUserMaxSeq(uid) + if err != nil && err != redis.ErrNil { + return MinSeq, err + } + NB := MaxSeq / singleGocMsgNum + for i = 0; i <= NB; i++ { + seqUid = indexGen(uid, i) + n, err := c.Find(bson.M{"uid": seqUid}).Count() + if err == nil && n != 0 { + if i == 0 { + MinSeq = 1 + } else { + MinSeq = i * singleGocMsgNum + } + break + } + } + return MinSeq, nil +} +func (d *DataBases) GetMsgBySeqList(uid string, seqList []int64) (SingleMsg []*pbMsg.MsgFormat, GroupMsg []*pbMsg.MsgFormat, MaxSeq int64, MinSeq int64, err error) { + allCount := 0 + singleCount := 0 + session := d.mgoSession.Clone() + if session == nil { + return nil, nil, MaxSeq, MinSeq, errors.New("session == nil") + } + defer session.Close() -func (d *DataBases) SaveUserChat(uid string, sendTime int64, m proto.Message) error { - + c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + m := func(uid string, seqList []int64) map[string][]int64 { + t := make(map[string][]int64) + for i := 0; i < len(seqList); i++ { + seqUid := getSeqUid(uid, seqList[i]) + if value, ok := t[seqUid]; !ok { + var temp []int64 + t[seqUid] = append(temp, seqList[i]) + } else { + t[seqUid] = append(value, seqList[i]) + } + } + return t + }(uid, seqList) + sChat := UserChat{} + pChat := pbMsg.MsgSvrToPushSvrChatMsg{} + for seqUid, value := range m { + if err = c.Find(bson.M{"uid": seqUid}).One(&sChat); err != nil { + log.NewError("", "not find seqUid", seqUid, value, uid, seqList) + continue + } + singleCount = 0 + for i := 0; i < len(sChat.Msg); i++ { + temp := new(pbMsg.MsgFormat) + if err = proto.Unmarshal(sChat.Msg[i].Msg, &pChat); err != nil { + log.NewError("", "not find seqUid", seqUid, value, uid, seqList) + return nil, nil, MaxSeq, MinSeq, err + } + if isContainInt64(pChat.RecvSeq, value) { + temp.SendID = pChat.SendID + temp.RecvID = pChat.RecvID + temp.MsgFrom = pChat.MsgFrom + temp.Seq = pChat.RecvSeq + temp.ServerMsgID = pChat.MsgID + temp.SendTime = pChat.SendTime + temp.Content = pChat.Content + temp.ContentType = pChat.ContentType + temp.SenderPlatformID = pChat.PlatformID + temp.ClientMsgID = pChat.ClientMsgID + temp.SenderFaceURL = pChat.SenderFaceURL + temp.SenderNickName = pChat.SenderNickName + if pChat.RecvSeq > MaxSeq { + MaxSeq = pChat.RecvSeq + } + if allCount == 0 { + MinSeq = pChat.RecvSeq + } + if pChat.RecvSeq < MinSeq { + MinSeq = pChat.RecvSeq + } + if pChat.SessionType == constant.SingleChatType { + SingleMsg = append(SingleMsg, temp) + } else { + GroupMsg = append(GroupMsg, temp) + } + allCount++ + singleCount++ + if singleCount == len(value) { + break + } + } + } + } + return SingleMsg, GroupMsg, MaxSeq, MinSeq, nil +} +func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgSvrToPushSvrChatMsg) error { + var seqUid string + newTime := getCurrentTimestampByMill() session := d.mgoSession.Clone() if session == nil { return errors.New("session == nil") } defer session.Close() - + log.NewInfo("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime) c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) - - n, err := c.Find(bson.M{"uid": uid}).Count() + seqUid = getSeqUid(uid, m.RecvSeq) + n, err := c.Find(bson.M{"uid": seqUid}).Count() if err != nil { return err } - + log.NewInfo("", "find mgo uid cost time", getCurrentTimestampByMill()-newTime) sMsg := MsgInfo{} sMsg.SendTime = sendTime if sMsg.Msg, err = proto.Marshal(m); err != nil { return err } - if n == 0 { sChat := UserChat{} - sChat.UID = uid + sChat.UID = seqUid sChat.Msg = append(sChat.Msg, sMsg) err = c.Insert(&sChat) if err != nil { return err } } else { - err = c.Update(bson.M{"uid": uid}, bson.M{"$push": bson.M{"msg": sMsg}}) + err = c.Update(bson.M{"uid": seqUid}, bson.M{"$push": bson.M{"msg": sMsg}}) if err != nil { return err } } - + log.NewInfo("", "insert mgo data cost time", getCurrentTimestampByMill()-newTime) return nil } @@ -231,3 +339,25 @@ func (d *DataBases) DelGroupMember(groupID, uid string) error { return nil } + +func getCurrentTimestampByMill() int64 { + return time.Now().UnixNano() / 1e6 +} +func getSeqUid(uid string, seq int64) string { + seqSuffix := seq / singleGocMsgNum + return indexGen(uid, seqSuffix) +} +func isContainInt64(target int64, List []int64) bool { + + for _, element := range List { + + if target == element { + return true + } + } + return false + +} +func indexGen(uid string, seqSuffix int64) string { + return uid + ":" + strconv.FormatInt(seqSuffix, 10) +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_model.go index 436260f68..2988741e5 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_model.go @@ -1,9 +1,9 @@ package im_mysql_model import ( - "Open_IM/pkg/proto/group" "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" + "Open_IM/pkg/proto/group" "errors" "time" ) diff --git a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go index 87993df65..d8576ac19 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go +++ b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go @@ -3,7 +3,7 @@ package im_mysql_model import "time" type User struct { - UID string `gorm:"column:uid"` + UID string `gorm:"column:uid;primaryKey;"` Name string `gorm:"column:name"` Icon string `gorm:"column:icon"` Gender int32 `gorm:"column:gender"` diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go index ad0430c3a..f378fdbb5 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -5,6 +5,7 @@ import ( "Open_IM/pkg/common/db" pbAuth "Open_IM/pkg/proto/auth" "Open_IM/pkg/utils" + "fmt" _ "github.com/jinzhu/gorm/dialects/mysql" "time" ) @@ -18,7 +19,7 @@ func init() { pb.Name = "AppManager" + utils.IntToString(k+1) err := UserRegister(&pb) if err != nil { - panic(err) + fmt.Println("AppManager insert error", err.Error()) } } } diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go index 7e7028b39..b31fde8c1 100644 --- a/pkg/common/db/redisModel.go +++ b/pkg/common/db/redisModel.go @@ -9,6 +9,7 @@ const ( userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq appleDeviceToken = "DEVICE_TOKEN" lastGetSeq = "LAST_GET_SEQ" + userMinSeq = "REDIS_USER_MIN_SEQ:" ) func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { @@ -31,42 +32,55 @@ func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (inte return con.Do(cmd, params...) } -//æ‰§čĄŒį”¨æˆˇæļˆæ¯įš„seqč‡Ēåĸžæ“äŊœ +//Perform seq auto-increment operation of user messages func (d *DataBases) IncrUserSeq(uid string) (int64, error) { key := userIncrSeq + uid return redis.Int64(d.Exec("INCR", key)) } -//čŽˇå–æœ€æ–°įš„seq -func (d *DataBases) GetUserSeq(uid string) (int64, error) { +//Get the largest Seq +func (d *DataBases) GetUserMaxSeq(uid string) (int64, error) { key := userIncrSeq + uid return redis.Int64(d.Exec("GET", key)) } -//å­˜å‚¨č‹šæžœįš„čŽžå¤‡token到redis +//Set the user's minimum seq +func (d *DataBases) SetUserMinSeq(uid string, minSeq int64) (err error) { + key := userMinSeq + uid + _, err = d.Exec("SET", key, minSeq) + return err +} + +//Get the smallest Seq +func (d *DataBases) GetUserMinSeq(uid string) (int64, error) { + key := userMinSeq + uid + return redis.Int64(d.Exec("GET", key)) +} + +//Store Apple's device token to redis func (d *DataBases) SetAppleDeviceToken(accountAddress, value string) (err error) { key := appleDeviceToken + accountAddress _, err = d.Exec("SET", key, value) return err } -//åˆ é™¤č‹šæžœčŽžå¤‡token +//Delete Apple device token func (d *DataBases) DelAppleDeviceToken(accountAddress string) (err error) { key := appleDeviceToken + accountAddress _, err = d.Exec("DEL", key) return err } -//莰åŊ•į”¨æˆˇä¸Šä¸€æŦĄä¸ģ动拉取Seqįš„å€ŧ +//Record the last time the user actively pulled the value of Seq func (d *DataBases) SetLastGetSeq(uid string) (err error) { key := lastGetSeq + uid _, err = d.Exec("SET", key) return err } -//čŽˇå–į”¨æˆˇä¸Šä¸€æŦĄä¸ģ动拉取Seqįš„å€ŧ +//Get the value of the user's last active pull Seq func (d *DataBases) GetLastGetSeq(uid string) (int64, error) { - key := userIncrSeq + uid + key := lastGetSeq + uid return redis.Int64(d.Exec("GET", key)) } diff --git a/pkg/common/log/es_hk.go b/pkg/common/log/es_hk.go new file mode 100644 index 000000000..061773e5d --- /dev/null +++ b/pkg/common/log/es_hk.go @@ -0,0 +1,108 @@ +/* +** description("Send logs to elasticsearch hook"). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/3/26 17:05). + */ +package log + +import ( + "Open_IM/pkg/common/config" + "context" + "fmt" + elasticV7 "github.com/olivere/elastic/v7" + "github.com/sirupsen/logrus" + "log" + "os" + "strings" + "time" +) + +//esHook CUSTOMIZED ES hook +type esHook struct { + moduleName string + client *elasticV7.Client +} + +//newEsHook Initialization +func newEsHook(moduleName string) *esHook { + //https://github.com/sohlich/elogrus + //client, err := elastic.NewClient(elastic.SetURL("http://localhost:9200")) + //if err != nil { + // log.Panic(err) + //} + //hook, err := elogrus.NewAsyncElasticHook(client, "localhost", logrus.DebugLevel, "mylog") + //if err != nil { + // log.Panic(err) + //} + es, err := elasticV7.NewClient( + elasticV7.SetURL(config.Config.Log.ElasticSearchAddr...), + elasticV7.SetBasicAuth(config.Config.Log.ElasticSearchUser, config.Config.Log.ElasticSearchPassword), + elasticV7.SetSniff(false), + elasticV7.SetHealthcheckInterval(60*time.Second), + elasticV7.SetErrorLog(log.New(os.Stderr, "ES:", log.LstdFlags)), + ) + + if err != nil { + log.Fatal("failed to create Elastic V7 Client: ", err) + } + + //info, code, err := es.Ping(logConfig.ElasticSearch.EsAddr[0]).Do(context.Background()) + //if err != nil { + // panic(err) + //} + //fmt.Printf("Elasticsearch returned with code %d and version %s\n", code, info.Version.Number) + // + //esversion, err := es.ElasticsearchVersion(logConfig.ElasticSearch.EsAddr[0]) + //if err != nil { + // panic(err) + //} + //fmt.Printf("Elasticsearch version %s\n", esversion) + return &esHook{client: es, moduleName: moduleName} +} + +//Fire log hook interface æ–šæŗ• +func (hook *esHook) Fire(entry *logrus.Entry) error { + doc := newEsLog(entry) + go hook.sendEs(doc) + return nil +} + +//Levels log hook interface æ–šæŗ•,æ­¤hookåŊąå“įš„æ—Ĩåŋ— +func (hook *esHook) Levels() []logrus.Level { + return logrus.AllLevels +} + +//sendEs åŧ‚æ­Ĩ发送æ—Ĩåŋ—到es +func (hook *esHook) sendEs(doc appLogDocModel) { + defer func() { + if r := recover(); r != nil { + fmt.Println("send entry to es failed: ", r) + } + }() + _, err := hook.client.Index().Index(hook.moduleName).Type(doc.indexName()).BodyJson(doc).Do(context.Background()) + if err != nil { + log.Println(err) + } + +} + +//appLogDocModel es model +type appLogDocModel map[string]interface{} + +func newEsLog(e *logrus.Entry) appLogDocModel { + ins := make(map[string]interface{}) + ins["level"] = strings.ToUpper(e.Level.String()) + ins["time"] = e.Time.Format("2006-01-02 15:04:05") + for kk, vv := range e.Data { + ins[kk] = vv + } + ins["tipInfo"] = e.Message + + return ins +} + +// indexName es index name æ—ļé—´åˆ†å‰˛ +func (m *appLogDocModel) indexName() string { + return time.Now().Format("2006-01-02") +} diff --git a/pkg/common/log/file_line_hk.go b/pkg/common/log/file_line_hk.go new file mode 100644 index 000000000..7eeb6ea82 --- /dev/null +++ b/pkg/common/log/file_line_hk.go @@ -0,0 +1,60 @@ +/* +** description("get the name and line number of the calling file hook"). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/3/16 11:26). + */ +package log + +import ( + "fmt" + "github.com/sirupsen/logrus" + "runtime" + "strings" +) + +type fileHook struct{} + +func newFileHook() *fileHook { + return &fileHook{} +} + +func (f *fileHook) Levels() []logrus.Level { + return logrus.AllLevels +} + +func (f *fileHook) Fire(entry *logrus.Entry) error { + entry.Data["FilePath"] = findCaller(5) + return nil +} + +func findCaller(skip int) string { + file := "" + line := 0 + for i := 0; i < 10; i++ { + file, line = getCaller(skip + i) + if !strings.HasPrefix(file, "log") { + break + } + } + return fmt.Sprintf("%s:%d", file, line) +} + +func getCaller(skip int) (string, int) { + _, file, line, ok := runtime.Caller(skip) + if !ok { + return "", 0 + } + + n := 0 + for i := len(file) - 1; i > 0; i-- { + if file[i] == '/' { + n++ + if n >= 2 { + file = file[i+1:] + break + } + } + } + return file, line +} diff --git a/pkg/common/log/logrus.go b/pkg/common/log/logrus.go new file mode 100644 index 000000000..b88a6f6d3 --- /dev/null +++ b/pkg/common/log/logrus.go @@ -0,0 +1,205 @@ +package log + +import ( + "Open_IM/pkg/common/config" + "bufio" + "fmt" + nested "github.com/antonfisher/nested-logrus-formatter" + rotatelogs "github.com/lestrrat-go/file-rotatelogs" + "github.com/rifflock/lfshook" + "github.com/sirupsen/logrus" + "os" + "time" +) + +var logger *Logger + +type Logger struct { + *logrus.Logger + Pid int +} + +func init() { + logger = loggerInit("") + +} +func NewPrivateLog(moduleName string) { + logger = loggerInit(moduleName) +} + +func loggerInit(moduleName string) *Logger { + var logger = logrus.New() + //All logs will be printed + logger.SetLevel(logrus.Level(config.Config.Log.RemainLogLevel)) + //Close std console output + src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend) + if err != nil { + panic(err) + } + writer := bufio.NewWriter(src) + logger.SetOutput(writer) + //Log Console Print Style Setting + logger.SetFormatter(&nested.Formatter{ + TimestampFormat: "2006-01-02 15:04:05.000", + HideKeys: false, + FieldsOrder: []string{"PID", "FilePath", "OperationID"}, + }) + //File name and line number display hook + logger.AddHook(newFileHook()) + + //Send logs to elasticsearch hook + if config.Config.Log.ElasticSearchSwitch { + logger.AddHook(newEsHook(moduleName)) + } + //Log file segmentation hook + hook := NewLfsHook(time.Duration(config.Config.Log.RotationTime)*time.Hour, config.Config.Log.RemainRotationCount, moduleName) + logger.AddHook(hook) + return &Logger{ + logger, + os.Getpid(), + } +} +func NewLfsHook(rotationTime time.Duration, maxRemainNum uint, moduleName string) logrus.Hook { + lfsHook := lfshook.NewHook(lfshook.WriterMap{ + logrus.DebugLevel: initRotateLogs(rotationTime, maxRemainNum, "debug", moduleName), + logrus.InfoLevel: initRotateLogs(rotationTime, maxRemainNum, "info", moduleName), + logrus.WarnLevel: initRotateLogs(rotationTime, maxRemainNum, "warn", moduleName), + logrus.ErrorLevel: initRotateLogs(rotationTime, maxRemainNum, "error", moduleName), + }, &nested.Formatter{ + TimestampFormat: "2006-01-02 15:04:05.000", + HideKeys: false, + FieldsOrder: []string{"PID", "FilePath", "OperationID"}, + }) + return lfsHook +} +func initRotateLogs(rotationTime time.Duration, maxRemainNum uint, level string, moduleName string) *rotatelogs.RotateLogs { + if moduleName != "" { + moduleName = moduleName + "." + } + writer, err := rotatelogs.New( + config.Config.Log.StorageLocation+moduleName+level+"."+"%Y-%m-%d", + rotatelogs.WithRotationTime(rotationTime), + rotatelogs.WithRotationCount(maxRemainNum), + ) + if err != nil { + panic(err) + } else { + return writer + } +} + +//Deprecated +func Info(token, OperationID, format string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "PID": logger.Pid, + "OperationID": OperationID, + }).Infof(format, args...) + +} + +//Deprecated +func Error(token, OperationID, format string, args ...interface{}) { + + logger.WithFields(logrus.Fields{ + "PID": logger.Pid, + "OperationID": OperationID, + }).Errorf(format, args...) + +} + +//Deprecated +func Debug(token, OperationID, format string, args ...interface{}) { + + logger.WithFields(logrus.Fields{ + "PID": logger.Pid, + "OperationID": OperationID, + }).Debugf(format, args...) + +} + +//Deprecated +func Warning(token, OperationID, format string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "PID": logger.Pid, + "OperationID": OperationID, + }).Warningf(format, args...) + +} + +//Deprecated +func InfoByArgs(format string, args ...interface{}) { + logger.WithFields(logrus.Fields{}).Infof(format, args) +} + +//Deprecated +func ErrorByArgs(format string, args ...interface{}) { + logger.WithFields(logrus.Fields{}).Errorf(format, args...) +} + +//Print log information in k, v format, +//kv is best to appear in pairs. tipInfo is the log prompt information for printing, +//and kv is the key and value for printing. +//Deprecated +func InfoByKv(tipInfo, OperationID string, args ...interface{}) { + fields := make(logrus.Fields) + argsHandle(OperationID, fields, args) + logger.WithFields(fields).Info(tipInfo) +} + +//Deprecated +func ErrorByKv(tipInfo, OperationID string, args ...interface{}) { + fields := make(logrus.Fields) + argsHandle(OperationID, fields, args) + logger.WithFields(fields).Error(tipInfo) +} + +//Deprecated +func DebugByKv(tipInfo, OperationID string, args ...interface{}) { + fields := make(logrus.Fields) + argsHandle(OperationID, fields, args) + logger.WithFields(fields).Debug(tipInfo) +} + +//Deprecated +func WarnByKv(tipInfo, OperationID string, args ...interface{}) { + fields := make(logrus.Fields) + argsHandle(OperationID, fields, args) + logger.WithFields(fields).Warn(tipInfo) +} + +//internal method +func argsHandle(OperationID string, fields logrus.Fields, args []interface{}) { + for i := 0; i < len(args); i += 2 { + if i+1 < len(args) { + fields[fmt.Sprintf("%v", args[i])] = args[i+1] + } else { + fields[fmt.Sprintf("%v", args[i])] = "" + } + } + fields["OperationID"] = OperationID + fields["PID"] = logger.Pid +} +func NewInfo(OperationID string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "OperationID": OperationID, + "PID": logger.Pid, + }).Infoln(args) +} +func NewError(OperationID string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "OperationID": OperationID, + "PID": logger.Pid, + }).Errorln(args) +} +func NewDebug(OperationID string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "OperationID": OperationID, + "PID": logger.Pid, + }).Debugln(args) +} +func NewWarn(OperationID string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "OperationID": OperationID, + "PID": logger.Pid, + }).Warnln(args) +} diff --git a/pkg/common/log/time_format.go b/pkg/common/log/time_format.go new file mode 100644 index 000000000..e1bfc4a8c --- /dev/null +++ b/pkg/common/log/time_format.go @@ -0,0 +1,57 @@ +/* +** description(""). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/2/22 11:52). + */ +package log + +import ( + "strconv" + "time" +) + +const ( + TimeOffset = 8 * 3600 //8 hour offset + HalfOffset = 12 * 3600 //Half-day hourly offset +) + +//Get the current timestamp +func GetCurrentTimestamp() int64 { + return time.Now().Unix() +} + +//Get the current 0 o'clock timestamp +func GetCurDayZeroTimestamp() int64 { + timeStr := time.Now().Format("2006-01-02") + t, _ := time.Parse("2006-01-02", timeStr) + return t.Unix() - TimeOffset +} + +//Get the timestamp at 12 o'clock on the day +func GetCurDayHalfTimestamp() int64 { + return GetCurDayZeroTimestamp() + HalfOffset + +} + +//Get the formatted time at 0 o'clock of the day, the format is "2006-01-02_00-00-00" +func GetCurDayZeroTimeFormat() string { + return time.Unix(GetCurDayZeroTimestamp(), 0).Format("2006-01-02_15-04-05") +} + +//Get the formatted time at 12 o'clock of the day, the format is "2006-01-02_12-00-00" +func GetCurDayHalfTimeFormat() string { + return time.Unix(GetCurDayZeroTimestamp()+HalfOffset, 0).Format("2006-01-02_15-04-05") +} +func GetTimeStampByFormat(datetime string) string { + timeLayout := "2006-01-02 15:04:05" //čŊŦåŒ–æ‰€éœ€æ¨Ąæŋ + loc, _ := time.LoadLocation("Local") //čŽˇå–æ—ļåŒē + tmp, _ := time.ParseInLocation(timeLayout, datetime, loc) + timestamp := tmp.Unix() //čŊŦ化ä¸ēæ—ļé—´æˆŗ įąģ型是int64 + return strconv.FormatInt(timestamp, 10) +} + +func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64 { + tm, _ := time.Parse(timeFormat, timeSrc) + return tm.Unix() +} diff --git a/pkg/common/multi_terminal_login/multi_terminal_login.go b/pkg/common/multi_terminal_login/multi_terminal_login.go index e65e473d4..ba0c0525c 100644 --- a/pkg/common/multi_terminal_login/multi_terminal_login.go +++ b/pkg/common/multi_terminal_login/multi_terminal_login.go @@ -3,11 +3,11 @@ package multi_terminal_login import ( "Open_IM/internal/push/content_struct" "Open_IM/internal/push/logic" - pbChat "Open_IM/pkg/proto/chat" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" - "Open_IM/pkg/common" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" ) func MultiTerminalLoginChecker(uid, token string, platformID int32) error { diff --git a/pkg/grpc-etcdv3/getcdv3/resolver.go b/pkg/grpc-etcdv3/getcdv3/resolver.go index aa41f86c4..94e03aaf1 100644 --- a/pkg/grpc-etcdv3/getcdv3/resolver.go +++ b/pkg/grpc-etcdv3/getcdv3/resolver.go @@ -1,17 +1,21 @@ package getcdv3 import ( + "Open_IM/pkg/common/config" "context" "fmt" + "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/mvcc/mvccpb" + //"google.golang.org/genproto/googleapis/ads/googleads/v1/services" - "google.golang.org/grpc" - "google.golang.org/grpc/balancer/roundrobin" - "google.golang.org/grpc/resolver" "strings" "sync" "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/balancer/roundrobin" + "google.golang.org/grpc/resolver" ) type Resolver struct { @@ -88,6 +92,34 @@ func GetConn(schema, etcdaddr, serviceName string) *grpc.ClientConn { return r.grpcClientConn } +func GetAuthConn() *grpc.ClientConn { + return GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) +} + +func GetOfflineMessageConn() *grpc.ClientConn { + return GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) +} + +func GetFriendConn() *grpc.ClientConn { + return GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) +} + +func GetGroupConn() *grpc.ClientConn { + return GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) +} + +func GetUserConn() *grpc.ClientConn { + return GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) +} + +func GetPushConn() *grpc.ClientConn { + return GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName) +} + +func GetOnlineMessageConn() []*grpc.ClientConn { + return GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) +} + func (r *Resolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { if r.cli == nil { return nil, fmt.Errorf("etcd clientv3 client failed, etcd:%s", target) diff --git a/pkg/proto/auth/auth.pb.go b/pkg/proto/auth/auth.pb.go index 8d1f4ea6e..71ab5fe7a 100644 --- a/pkg/proto/auth/auth.pb.go +++ b/pkg/proto/auth/auth.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: auth/auth.proto -package pbAuth // import "auth" +package pbAuth // import "./auth" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -41,7 +41,7 @@ func (m *UserRegisterReq) Reset() { *m = UserRegisterReq{} } func (m *UserRegisterReq) String() string { return proto.CompactTextString(m) } func (*UserRegisterReq) ProtoMessage() {} func (*UserRegisterReq) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_ef7bd0d2906761f0, []int{0} + return fileDescriptor_auth_d2199f7b1388fd2f, []int{0} } func (m *UserRegisterReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterReq.Unmarshal(m, b) @@ -128,7 +128,7 @@ func (m *UserRegisterResp) Reset() { *m = UserRegisterResp{} } func (m *UserRegisterResp) String() string { return proto.CompactTextString(m) } func (*UserRegisterResp) ProtoMessage() {} func (*UserRegisterResp) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_ef7bd0d2906761f0, []int{1} + return fileDescriptor_auth_d2199f7b1388fd2f, []int{1} } func (m *UserRegisterResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserRegisterResp.Unmarshal(m, b) @@ -167,7 +167,7 @@ func (m *UserTokenReq) Reset() { *m = UserTokenReq{} } func (m *UserTokenReq) String() string { return proto.CompactTextString(m) } func (*UserTokenReq) ProtoMessage() {} func (*UserTokenReq) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_ef7bd0d2906761f0, []int{2} + return fileDescriptor_auth_d2199f7b1388fd2f, []int{2} } func (m *UserTokenReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenReq.Unmarshal(m, b) @@ -215,7 +215,7 @@ func (m *UserTokenResp) Reset() { *m = UserTokenResp{} } func (m *UserTokenResp) String() string { return proto.CompactTextString(m) } func (*UserTokenResp) ProtoMessage() {} func (*UserTokenResp) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_ef7bd0d2906761f0, []int{3} + return fileDescriptor_auth_d2199f7b1388fd2f, []int{3} } func (m *UserTokenResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserTokenResp.Unmarshal(m, b) @@ -375,30 +375,30 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ Metadata: "auth/auth.proto", } -func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_ef7bd0d2906761f0) } - -var fileDescriptor_auth_ef7bd0d2906761f0 = []byte{ - // 346 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x4e, 0xc2, 0x40, - 0x10, 0x86, 0xd3, 0x42, 0x0b, 0x0c, 0x22, 0x64, 0x82, 0xba, 0xe1, 0x44, 0x7a, 0xe2, 0x60, 0x30, - 0xd1, 0x8b, 0x89, 0x5e, 0x40, 0x1b, 0xc3, 0x01, 0x63, 0x2a, 0x5c, 0xbc, 0x15, 0x58, 0xa1, 0x91, - 0xb2, 0x75, 0xb7, 0x24, 0x78, 0xf6, 0xa1, 0x7c, 0x3d, 0x33, 0xbb, 0x5b, 0x82, 0x86, 0x4b, 0x3b, - 0xff, 0xb7, 0x33, 0xd9, 0xfd, 0x67, 0x06, 0x9a, 0xf1, 0x36, 0x5f, 0x5d, 0xd1, 0xa7, 0x9f, 0x49, - 0x91, 0x0b, 0xf4, 0xb3, 0xd9, 0x60, 0x9b, 0xaf, 0x82, 0x1f, 0x07, 0x9a, 0x53, 0xc5, 0x65, 0xc4, - 0x97, 0x89, 0xca, 0xe9, 0xff, 0x89, 0x2d, 0x28, 0x4d, 0x47, 0x8f, 0xcc, 0xe9, 0x3a, 0xbd, 0x5a, - 0x44, 0x21, 0x22, 0x94, 0x9f, 0xe3, 0x94, 0x33, 0x57, 0x23, 0x1d, 0x13, 0x1b, 0xcd, 0xc5, 0x86, - 0x95, 0x0c, 0xa3, 0x18, 0xcf, 0xc1, 0x7f, 0xe2, 0x9b, 0x05, 0x97, 0xac, 0xdc, 0x75, 0x7a, 0x5e, - 0x64, 0x15, 0xf1, 0xb1, 0x98, 0x25, 0x6b, 0xce, 0x3c, 0x9d, 0x6d, 0x15, 0xb6, 0xc1, 0x1b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xb1, 0xb3, 0x57, 0x02, 0x00, 0x00, +func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_d2199f7b1388fd2f) } + +var fileDescriptor_auth_d2199f7b1388fd2f = []byte{ + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x4f, 0xf2, 0x40, + 0x10, 0x86, 0xd3, 0x42, 0x0b, 0xcc, 0xf7, 0x21, 0x64, 0x82, 0xba, 0xe1, 0x44, 0x7a, 0xe2, 0x60, + 0x6a, 0xa2, 0x17, 0x13, 0xbd, 0x80, 0x36, 0x86, 0x03, 0xc6, 0x54, 0xb8, 0x78, 0x2b, 0xb0, 0x42, + 0x23, 0x65, 0xeb, 0x6e, 0x49, 0xf0, 0xec, 0x8f, 0xf2, 0xef, 0x99, 0x9d, 0xdd, 0x12, 0x34, 0x5c, + 0xda, 0x79, 0x9f, 0x9d, 0xc9, 0xee, 0x3b, 0x33, 0xd0, 0x4a, 0xb6, 0xc5, 0xea, 0x52, 0x7f, 0xc2, + 0x5c, 0x8a, 0x42, 0xa0, 0x9f, 0xcf, 0x06, 0xdb, 0x62, 0x15, 0x7c, 0x3b, 0xd0, 0x9a, 0x2a, 0x2e, + 0x63, 0xbe, 0x4c, 0x55, 0xa1, 0xff, 0x1f, 0xd8, 0x86, 0xca, 0x74, 0xf4, 0xc0, 0x9c, 0x9e, 0xd3, + 0x6f, 0xc4, 0x3a, 0x44, 0x84, 0xea, 0x53, 0x92, 0x71, 0xe6, 0x12, 0xa2, 0x58, 0xb3, 0xd1, 0x5c, + 0x6c, 0x58, 0xc5, 0x30, 0x1d, 0xe3, 0x19, 0xf8, 0x8f, 0x7c, 0xb3, 0xe0, 0x92, 0x55, 0x7b, 0x4e, + 0xdf, 0x8b, 0xad, 0xd2, 0x7c, 0x2c, 0x66, 0xe9, 0x9a, 0x33, 0x8f, 0xb2, 0xad, 0xc2, 0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 0xff, 0xff, 0x15, 0x5d, 0xc8, 0xb6, 0x59, 0x02, 0x00, 0x00, } diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index 94c664125..21b82ff40 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package pbAuth; -option go_package = "auth;pbAuth"; +option go_package = "./auth;pbAuth"; message UserRegisterReq { string UID = 1; diff --git a/pkg/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go index f98855332..b48d2cee1 100644 --- a/pkg/proto/chat/chat.pb.go +++ b/pkg/proto/chat/chat.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: chat/chat.proto -package pbChat // import "chat" +package pbChat // import "./chat" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -50,7 +50,7 @@ func (m *WSToMsgSvrChatMsg) Reset() { *m = WSToMsgSvrChatMsg{} } func (m *WSToMsgSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*WSToMsgSvrChatMsg) ProtoMessage() {} func (*WSToMsgSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{0} + return fileDescriptor_chat_feb94a5514034c46, []int{0} } func (m *WSToMsgSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_WSToMsgSvrChatMsg.Unmarshal(m, b) @@ -215,7 +215,7 @@ func (m *MsgSvrToPushSvrChatMsg) Reset() { *m = MsgSvrToPushSvrChatMsg{} func (m *MsgSvrToPushSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*MsgSvrToPushSvrChatMsg) ProtoMessage() {} func (*MsgSvrToPushSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{1} + return fileDescriptor_chat_feb94a5514034c46, []int{1} } func (m *MsgSvrToPushSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Unmarshal(m, b) @@ -361,7 +361,7 @@ func (m *PullMessageReq) Reset() { *m = PullMessageReq{} } func (m *PullMessageReq) String() string { return proto.CompactTextString(m) } func (*PullMessageReq) ProtoMessage() {} func (*PullMessageReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{2} + return fileDescriptor_chat_feb94a5514034c46, []int{2} } func (m *PullMessageReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageReq.Unmarshal(m, b) @@ -425,7 +425,7 @@ func (m *PullMessageResp) Reset() { *m = PullMessageResp{} } func (m *PullMessageResp) String() string { return proto.CompactTextString(m) } func (*PullMessageResp) ProtoMessage() {} func (*PullMessageResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{3} + return fileDescriptor_chat_feb94a5514034c46, []int{3} } func (m *PullMessageResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageResp.Unmarshal(m, b) @@ -487,102 +487,164 @@ func (m *PullMessageResp) GetGroupUserMsg() []*GatherFormat { return nil } -type GetNewSeqReq struct { +type PullMessageBySeqListReq struct { UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + SeqList []int64 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *GetNewSeqReq) Reset() { *m = GetNewSeqReq{} } -func (m *GetNewSeqReq) String() string { return proto.CompactTextString(m) } -func (*GetNewSeqReq) ProtoMessage() {} -func (*GetNewSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{4} +func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq{} } +func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } +func (*PullMessageBySeqListReq) ProtoMessage() {} +func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_feb94a5514034c46, []int{4} } -func (m *GetNewSeqReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetNewSeqReq.Unmarshal(m, b) +func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) } -func (m *GetNewSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetNewSeqReq.Marshal(b, m, deterministic) +func (m *PullMessageBySeqListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PullMessageBySeqListReq.Marshal(b, m, deterministic) } -func (dst *GetNewSeqReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNewSeqReq.Merge(dst, src) +func (dst *PullMessageBySeqListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_PullMessageBySeqListReq.Merge(dst, src) } -func (m *GetNewSeqReq) XXX_Size() int { - return xxx_messageInfo_GetNewSeqReq.Size(m) +func (m *PullMessageBySeqListReq) XXX_Size() int { + return xxx_messageInfo_PullMessageBySeqListReq.Size(m) } -func (m *GetNewSeqReq) XXX_DiscardUnknown() { - xxx_messageInfo_GetNewSeqReq.DiscardUnknown(m) +func (m *PullMessageBySeqListReq) XXX_DiscardUnknown() { + xxx_messageInfo_PullMessageBySeqListReq.DiscardUnknown(m) } -var xxx_messageInfo_GetNewSeqReq proto.InternalMessageInfo +var xxx_messageInfo_PullMessageBySeqListReq proto.InternalMessageInfo -func (m *GetNewSeqReq) GetUserID() string { +func (m *PullMessageBySeqListReq) GetUserID() string { if m != nil { return m.UserID } return "" } -func (m *GetNewSeqReq) GetOperationID() string { +func (m *PullMessageBySeqListReq) GetOperationID() string { if m != nil { return m.OperationID } return "" } -type GetNewSeqResp struct { +func (m *PullMessageBySeqListReq) GetSeqList() []int64 { + if m != nil { + return m.SeqList + } + return nil +} + +type GetMaxAndMinSeqReq struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } +func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } +func (*GetMaxAndMinSeqReq) ProtoMessage() {} +func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_feb94a5514034c46, []int{5} +} +func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) +} +func (m *GetMaxAndMinSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMaxAndMinSeqReq.Marshal(b, m, deterministic) +} +func (dst *GetMaxAndMinSeqReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMaxAndMinSeqReq.Merge(dst, src) +} +func (m *GetMaxAndMinSeqReq) XXX_Size() int { + return xxx_messageInfo_GetMaxAndMinSeqReq.Size(m) +} +func (m *GetMaxAndMinSeqReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetMaxAndMinSeqReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMaxAndMinSeqReq proto.InternalMessageInfo + +func (m *GetMaxAndMinSeqReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetMaxAndMinSeqReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetMaxAndMinSeqResp struct { ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` - Seq int64 `protobuf:"varint,3,opt,name=Seq" json:"Seq,omitempty"` + MaxSeq int64 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` + MinSeq int64 `protobuf:"varint,4,opt,name=MinSeq" json:"MinSeq,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *GetNewSeqResp) Reset() { *m = GetNewSeqResp{} } -func (m *GetNewSeqResp) String() string { return proto.CompactTextString(m) } -func (*GetNewSeqResp) ProtoMessage() {} -func (*GetNewSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{5} +func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } +func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } +func (*GetMaxAndMinSeqResp) ProtoMessage() {} +func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_feb94a5514034c46, []int{6} } -func (m *GetNewSeqResp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetNewSeqResp.Unmarshal(m, b) +func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) } -func (m *GetNewSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetNewSeqResp.Marshal(b, m, deterministic) +func (m *GetMaxAndMinSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMaxAndMinSeqResp.Marshal(b, m, deterministic) } -func (dst *GetNewSeqResp) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNewSeqResp.Merge(dst, src) +func (dst *GetMaxAndMinSeqResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMaxAndMinSeqResp.Merge(dst, src) } -func (m *GetNewSeqResp) XXX_Size() int { - return xxx_messageInfo_GetNewSeqResp.Size(m) +func (m *GetMaxAndMinSeqResp) XXX_Size() int { + return xxx_messageInfo_GetMaxAndMinSeqResp.Size(m) } -func (m *GetNewSeqResp) XXX_DiscardUnknown() { - xxx_messageInfo_GetNewSeqResp.DiscardUnknown(m) +func (m *GetMaxAndMinSeqResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetMaxAndMinSeqResp.DiscardUnknown(m) } -var xxx_messageInfo_GetNewSeqResp proto.InternalMessageInfo +var xxx_messageInfo_GetMaxAndMinSeqResp proto.InternalMessageInfo -func (m *GetNewSeqResp) GetErrCode() int32 { +func (m *GetMaxAndMinSeqResp) GetErrCode() int32 { if m != nil { return m.ErrCode } return 0 } -func (m *GetNewSeqResp) GetErrMsg() string { +func (m *GetMaxAndMinSeqResp) GetErrMsg() string { if m != nil { return m.ErrMsg } return "" } -func (m *GetNewSeqResp) GetSeq() int64 { +func (m *GetMaxAndMinSeqResp) GetMaxSeq() int64 { if m != nil { - return m.Seq + return m.MaxSeq + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetMinSeq() int64 { + if m != nil { + return m.MinSeq } return 0 } @@ -601,7 +663,7 @@ func (m *GatherFormat) Reset() { *m = GatherFormat{} } func (m *GatherFormat) String() string { return proto.CompactTextString(m) } func (*GatherFormat) ProtoMessage() {} func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{6} + return fileDescriptor_chat_feb94a5514034c46, []int{7} } func (m *GatherFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GatherFormat.Unmarshal(m, b) @@ -669,7 +731,7 @@ func (m *MsgFormat) Reset() { *m = MsgFormat{} } func (m *MsgFormat) String() string { return proto.CompactTextString(m) } func (*MsgFormat) ProtoMessage() {} func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{7} + return fileDescriptor_chat_feb94a5514034c46, []int{8} } func (m *MsgFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgFormat.Unmarshal(m, b) @@ -791,6 +853,7 @@ type UserSendMsgReq struct { ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo" json:"OffLineInfo,omitempty"` Ex string `protobuf:"bytes,17,opt,name=Ex" json:"Ex,omitempty"` + SendTime int64 `protobuf:"varint,18,opt,name=sendTime" json:"sendTime,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -800,7 +863,7 @@ func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } func (*UserSendMsgReq) ProtoMessage() {} func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{8} + return fileDescriptor_chat_feb94a5514034c46, []int{9} } func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) @@ -939,13 +1002,20 @@ func (m *UserSendMsgReq) GetEx() string { return "" } +func (m *UserSendMsgReq) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + type UserSendMsgResp struct { ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` ReqIdentifier int32 `protobuf:"varint,3,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` - ServerMsgID string `protobuf:"bytes,6,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` - ClientMsgID string `protobuf:"bytes,7,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + ServerMsgID string `protobuf:"bytes,4,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` + ClientMsgID string `protobuf:"bytes,5,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + SendTime int64 `protobuf:"varint,6,opt,name=sendTime" json:"sendTime,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -955,7 +1025,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_34beadf7348900d2, []int{9} + return fileDescriptor_chat_feb94a5514034c46, []int{10} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -996,13 +1066,6 @@ func (m *UserSendMsgResp) GetReqIdentifier() int32 { return 0 } -func (m *UserSendMsgResp) GetSendTime() int64 { - if m != nil { - return m.SendTime - } - return 0 -} - func (m *UserSendMsgResp) GetServerMsgID() string { if m != nil { return m.ServerMsgID @@ -1017,13 +1080,21 @@ func (m *UserSendMsgResp) GetClientMsgID() string { return "" } +func (m *UserSendMsgResp) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + func init() { proto.RegisterType((*WSToMsgSvrChatMsg)(nil), "pbChat.WSToMsgSvrChatMsg") proto.RegisterType((*MsgSvrToPushSvrChatMsg)(nil), "pbChat.MsgSvrToPushSvrChatMsg") proto.RegisterType((*PullMessageReq)(nil), "pbChat.PullMessageReq") proto.RegisterType((*PullMessageResp)(nil), "pbChat.PullMessageResp") - proto.RegisterType((*GetNewSeqReq)(nil), "pbChat.GetNewSeqReq") - proto.RegisterType((*GetNewSeqResp)(nil), "pbChat.GetNewSeqResp") + proto.RegisterType((*PullMessageBySeqListReq)(nil), "pbChat.PullMessageBySeqListReq") + proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "pbChat.GetMaxAndMinSeqReq") + proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "pbChat.GetMaxAndMinSeqResp") proto.RegisterType((*GatherFormat)(nil), "pbChat.GatherFormat") proto.RegisterType((*MsgFormat)(nil), "pbChat.MsgFormat") proto.RegisterType((*UserSendMsgReq)(nil), "pbChat.UserSendMsgReq") @@ -1041,8 +1112,9 @@ const _ = grpc.SupportPackageIsVersion4 // Client API for Chat service type ChatClient interface { - GetNewSeq(ctx context.Context, in *GetNewSeqReq, opts ...grpc.CallOption) (*GetNewSeqResp, error) + GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) PullMessage(ctx context.Context, in *PullMessageReq, opts ...grpc.CallOption) (*PullMessageResp, error) + PullMessageBySeqList(ctx context.Context, in *PullMessageBySeqListReq, opts ...grpc.CallOption) (*PullMessageResp, error) UserSendMsg(ctx context.Context, in *UserSendMsgReq, opts ...grpc.CallOption) (*UserSendMsgResp, error) } @@ -1054,9 +1126,9 @@ func NewChatClient(cc *grpc.ClientConn) ChatClient { return &chatClient{cc} } -func (c *chatClient) GetNewSeq(ctx context.Context, in *GetNewSeqReq, opts ...grpc.CallOption) (*GetNewSeqResp, error) { - out := new(GetNewSeqResp) - err := grpc.Invoke(ctx, "/pbChat.Chat/GetNewSeq", in, out, c.cc, opts...) +func (c *chatClient) GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) { + out := new(GetMaxAndMinSeqResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/GetMaxAndMinSeq", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -1072,6 +1144,15 @@ func (c *chatClient) PullMessage(ctx context.Context, in *PullMessageReq, opts . return out, nil } +func (c *chatClient) PullMessageBySeqList(ctx context.Context, in *PullMessageBySeqListReq, opts ...grpc.CallOption) (*PullMessageResp, error) { + out := new(PullMessageResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/PullMessageBySeqList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *chatClient) UserSendMsg(ctx context.Context, in *UserSendMsgReq, opts ...grpc.CallOption) (*UserSendMsgResp, error) { out := new(UserSendMsgResp) err := grpc.Invoke(ctx, "/pbChat.Chat/UserSendMsg", in, out, c.cc, opts...) @@ -1084,8 +1165,9 @@ func (c *chatClient) UserSendMsg(ctx context.Context, in *UserSendMsgReq, opts . // Server API for Chat service type ChatServer interface { - GetNewSeq(context.Context, *GetNewSeqReq) (*GetNewSeqResp, error) + GetMaxAndMinSeq(context.Context, *GetMaxAndMinSeqReq) (*GetMaxAndMinSeqResp, error) PullMessage(context.Context, *PullMessageReq) (*PullMessageResp, error) + PullMessageBySeqList(context.Context, *PullMessageBySeqListReq) (*PullMessageResp, error) UserSendMsg(context.Context, *UserSendMsgReq) (*UserSendMsgResp, error) } @@ -1093,20 +1175,20 @@ func RegisterChatServer(s *grpc.Server, srv ChatServer) { s.RegisterService(&_Chat_serviceDesc, srv) } -func _Chat_GetNewSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNewSeqReq) +func _Chat_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMaxAndMinSeqReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ChatServer).GetNewSeq(ctx, in) + return srv.(ChatServer).GetMaxAndMinSeq(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pbChat.Chat/GetNewSeq", + FullMethod: "/pbChat.Chat/GetMaxAndMinSeq", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChatServer).GetNewSeq(ctx, req.(*GetNewSeqReq)) + return srv.(ChatServer).GetMaxAndMinSeq(ctx, req.(*GetMaxAndMinSeqReq)) } return interceptor(ctx, in, info, handler) } @@ -1129,6 +1211,24 @@ func _Chat_PullMessage_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Chat_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PullMessageBySeqListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServer).PullMessageBySeqList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbChat.Chat/PullMessageBySeqList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).PullMessageBySeqList(ctx, req.(*PullMessageBySeqListReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Chat_UserSendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UserSendMsgReq) if err := dec(in); err != nil { @@ -1152,13 +1252,17 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ HandlerType: (*ChatServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetNewSeq", - Handler: _Chat_GetNewSeq_Handler, + MethodName: "GetMaxAndMinSeq", + Handler: _Chat_GetMaxAndMinSeq_Handler, }, { MethodName: "PullMessage", Handler: _Chat_PullMessage_Handler, }, + { + MethodName: "PullMessageBySeqList", + Handler: _Chat_PullMessageBySeqList_Handler, + }, { MethodName: "UserSendMsg", Handler: _Chat_UserSendMsg_Handler, @@ -1168,66 +1272,70 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ Metadata: "chat/chat.proto", } -func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_34beadf7348900d2) } - -var fileDescriptor_chat_34beadf7348900d2 = []byte{ - // 919 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5f, 0x6b, 0xe3, 0x46, - 0x10, 0xc7, 0x96, 0x2d, 0x5b, 0xe3, 0xbf, 0x59, 0xae, 0xe9, 0x12, 0x4a, 0x31, 0xe6, 0x5a,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x5d, 0x15, 0x68, 0x85, 0x5a, 0xd6, 0x5e, 0x6a, 0x41, 0x95, 0x5a, 0x05, - 0x5d, 0x3b, 0x1a, 0x5d, 0xb5, 0xdd, 0xdb, 0x2d, 0xef, 0x5e, 0x85, 0x6e, 0xbd, 0xca, 0x3a, 0x7c, - 0x44, 0xd2, 0x4b, 0x0d, 0x1e, 0x54, 0x1a, 0x9c, 0x2d, 0x8c, 0xcb, 0x7c, 0x61, 0x0c, 0xb7, 0x0b, - 0x23, 0x87, 0xf8, 0xe4, 0xce, 0x1e, 0xb2, 0x55, 0x5f, 0x9f, 0x3d, 0x8c, 0xff, 0xae, 0xc1, 0x40, - 0xa3, 0xc4, 0xb3, 0x14, 0xa3, 0xc2, 0x22, 0x63, 0x17, 0x8b, 0xf6, 0xad, 0xf3, 0xd2, 0x80, 0x9a, - 0xd5, 0x01, 0x2d, 0x65, 0xdf, 0xaa, 0x64, 0xff, 0xe6, 0xaf, 0x1a, 0x34, 0xb8, 0xee, 0xa0, 0xb7, - 0x60, 0x6d, 0x35, 0x10, 0x15, 0xf2, 0xab, 0x08, 0xec, 0xc9, 0x67, 0x3b, 0x50, 0x96, 0xa0, 0x1f, - 0xa1, 0xa3, 0xac, 0x1c, 0x74, 0x9c, 0x7b, 0xe9, 0x8b, 0xf0, 0xe4, 0xf3, 0x9d, 0xb8, 0x8c, 0x57, - 0xaa, 0x59, 0xc4, 0xeb, 0x53, 0x57, 0xc4, 0x97, 0x4a, 0xff, 0xae, 0xf7, 0x4b, 0x87, 0xff, 0x30, - 0xff, 0x41, 0x7e, 0xfe, 0x68, 0x8a, 0x1f, 0xe8, 0xdf, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xfe, - 0xa0, 0x14, 0x71, 0xb3, 0x0b, 0x00, 0x00, +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_feb94a5514034c46) } + +var fileDescriptor_chat_feb94a5514034c46 = []byte{ + // 981 bytes of a gzipped FileDescriptorProto + 0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xcd, 0xbc, 0x73, 0x1a, 0x6e, 0x70, 0x63, 0x54, + 0x1b, 0x37, 0x9c, 0x34, 0x44, 0x5f, 0x41, 0x9f, 0x67, 0x11, 0x7a, 0xe5, 0x2f, 0xde, 0x5e, 0xb9, + 0x1b, 0x82, 0x0d, 0xb1, 0x6d, 0x01, 0x45, 0xcf, 0xa1, 0x27, 0x91, 0x73, 0x77, 0x41, 0x5e, 0x3b, + 0x97, 0xb8, 0x29, 0xd2, 0xf2, 0x20, 0x1a, 0x41, 0x27, 0xb9, 0xce, 0xfc, 0x5d, 0x44, 0x70, 0x4b, + 0x9c, 0xa5, 0x42, 0x3c, 0x63, 0x46, 0x18, 0xf3, 0xc3, 0x40, 0x64, 0xb4, 0x65, 0x86, 0x02, 0xf1, + 0x8c, 0x57, 0x11, 0xa1, 0x6e, 0xec, 0x87, 0x81, 0x35, 0xc1, 0x20, 0xce, 0x51, 0x21, 0x74, 0x08, + 0x0d, 0x9b, 0x79, 0xd6, 0x04, 0x77, 0xc4, 0x37, 0x19, 0x70, 0x74, 0x1e, 0xbe, 0x25, 0x01, 0xee, + 0x4a, 0x54, 0x04, 0x62, 0xb7, 0xd5, 0x6a, 0xed, 0x07, 0xc4, 0x0a, 0x56, 0x21, 0xee, 0x25, 0xbb, + 0x65, 0x10, 0xef, 0xcd, 0xab, 0x88, 0xef, 0xcc, 0x70, 0x5f, 0x76, 0x34, 0x09, 0xd1, 0xe7, 0x00, + 0xd7, 0x6b, 0x37, 0x5e, 0x85, 0x74, 0x63, 0x4d, 0xf0, 0x40, 0x5c, 0x55, 0x41, 0xd0, 0x67, 0xd0, + 0x3e, 0x0f, 0xe9, 0x82, 0x5c, 0xfa, 0x2c, 0xc6, 0xc3, 0x91, 0x3e, 0x6e, 0x3b, 0x19, 0x20, 0x7a, + 0xb1, 0xf6, 0x49, 0x10, 0xcb, 0xbb, 0x1e, 0xc8, 0x93, 0x15, 0xc8, 0xfc, 0x47, 0x87, 0x23, 0xa9, + 0x86, 0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e3, 0x67, 0x95, 0x38, 0x8b, 0xd0, 0x35, 0x1c, 0x56, 0x8d, 0x23, + 0xf4, 0x45, 0xc5, 0x02, 0x75, 0x58, 0xed, 0xdf, 0xf1, 0x25, 0x74, 0x14, 0xc6, 0xb2, 0x1b, 0xe5, + 0x5f, 0x7d, 0xb6, 0xbe, 0x40, 0xef, 0xe9, 0xe0, 0x97, 0xde, 0x89, 0xf8, 0x9f, 0xe5, 0x07, 0x99, + 0xf0, 0xc6, 0x10, 0xff, 0xbb, 0x7c, 0xfb, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x44, 0x4e, + 0x52, 0xce, 0x0c, 0x00, 0x00, } diff --git a/pkg/proto/chat/chat.proto b/pkg/proto/chat/chat.proto index 1273682c7..3c66c99dc 100644 --- a/pkg/proto/chat/chat.proto +++ b/pkg/proto/chat/chat.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package pbChat;//The package name to which the proto file belongs -option go_package = "chat;pbChat";//The generated go pb file is in the current directory, and the package name is pbChat +option go_package = "./chat;pbChat";//The generated go pb file is in the current directory, and the package name is pbChat message WSToMsgSvrChatMsg{ string SendID = 1; @@ -58,14 +58,20 @@ message PullMessageResp { repeated GatherFormat SingleUserMsg = 5; repeated GatherFormat GroupUserMsg = 6; } -message GetNewSeqReq { +message PullMessageBySeqListReq{ string UserID = 1; string OperationID = 2; + repeated int64 seqList =3; } -message GetNewSeqResp { +message GetMaxAndMinSeqReq { + string UserID = 1; + string OperationID = 2; +} +message GetMaxAndMinSeqResp { int32 ErrCode = 1; string ErrMsg = 2; - int64 Seq = 3; + int64 MaxSeq = 3; + int64 MinSeq = 4; } message GatherFormat{ // @inject_tag: json:"id" @@ -119,6 +125,7 @@ message UserSendMsgReq { string ClientMsgID = 15; string OffLineInfo = 16; string Ex = 17; + int64 sendTime = 18; } @@ -127,13 +134,14 @@ message UserSendMsgResp { int32 ErrCode = 1; string ErrMsg = 2; int32 ReqIdentifier = 3; - int64 SendTime = 5; - string ServerMsgID = 6; - string ClientMsgID = 7; + string ServerMsgID = 4; + string ClientMsgID = 5; + int64 sendTime = 6; } service Chat { - rpc GetNewSeq(GetNewSeqReq) returns(GetNewSeqResp); + rpc GetMaxAndMinSeq(GetMaxAndMinSeqReq) returns(GetMaxAndMinSeqResp); rpc PullMessage(PullMessageReq) returns(PullMessageResp); + rpc PullMessageBySeqList(PullMessageBySeqListReq) returns(PullMessageResp); rpc UserSendMsg(UserSendMsgReq) returns(UserSendMsgResp); } diff --git a/pkg/proto/friend/friend.pb.go b/pkg/proto/friend/friend.pb.go index f20bc494d..a393857af 100644 --- a/pkg/proto/friend/friend.pb.go +++ b/pkg/proto/friend/friend.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: friend/friend.proto -package friend // import "friend" +package friend // import "./friend" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -35,7 +35,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{0} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -82,7 +82,7 @@ func (m *GetFriendsInfoReq) Reset() { *m = GetFriendsInfoReq{} } func (m *GetFriendsInfoReq) String() string { return proto.CompactTextString(m) } func (*GetFriendsInfoReq) ProtoMessage() {} func (*GetFriendsInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{1} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{1} } func (m *GetFriendsInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendsInfoReq.Unmarshal(m, b) @@ -136,7 +136,7 @@ func (m *GetFriendInfoResp) Reset() { *m = GetFriendInfoResp{} } func (m *GetFriendInfoResp) String() string { return proto.CompactTextString(m) } func (*GetFriendInfoResp) ProtoMessage() {} func (*GetFriendInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{2} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{2} } func (m *GetFriendInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendInfoResp.Unmarshal(m, b) @@ -198,7 +198,7 @@ func (m *GetFriendData) Reset() { *m = GetFriendData{} } func (m *GetFriendData) String() string { return proto.CompactTextString(m) } func (*GetFriendData) ProtoMessage() {} func (*GetFriendData) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{3} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{3} } func (m *GetFriendData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendData.Unmarshal(m, b) @@ -309,7 +309,7 @@ func (m *AddFriendReq) Reset() { *m = AddFriendReq{} } func (m *AddFriendReq) String() string { return proto.CompactTextString(m) } func (*AddFriendReq) ProtoMessage() {} func (*AddFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{4} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{4} } func (m *AddFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddFriendReq.Unmarshal(m, b) @@ -371,7 +371,7 @@ func (m *ImportFriendReq) Reset() { *m = ImportFriendReq{} } func (m *ImportFriendReq) String() string { return proto.CompactTextString(m) } func (*ImportFriendReq) ProtoMessage() {} func (*ImportFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{5} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{5} } func (m *ImportFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ImportFriendReq.Unmarshal(m, b) @@ -431,7 +431,7 @@ func (m *ImportFriendResp) Reset() { *m = ImportFriendResp{} } func (m *ImportFriendResp) String() string { return proto.CompactTextString(m) } func (*ImportFriendResp) ProtoMessage() {} func (*ImportFriendResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{6} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{6} } func (m *ImportFriendResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ImportFriendResp.Unmarshal(m, b) @@ -477,7 +477,7 @@ func (m *GetFriendApplyReq) Reset() { *m = GetFriendApplyReq{} } func (m *GetFriendApplyReq) String() string { return proto.CompactTextString(m) } func (*GetFriendApplyReq) ProtoMessage() {} func (*GetFriendApplyReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{7} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{7} } func (m *GetFriendApplyReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendApplyReq.Unmarshal(m, b) @@ -524,7 +524,7 @@ func (m *GetFriendApplyResp) Reset() { *m = GetFriendApplyResp{} } func (m *GetFriendApplyResp) String() string { return proto.CompactTextString(m) } func (*GetFriendApplyResp) ProtoMessage() {} func (*GetFriendApplyResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{8} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{8} } func (m *GetFriendApplyResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendApplyResp.Unmarshal(m, b) @@ -586,7 +586,7 @@ func (m *ApplyUserInfo) Reset() { *m = ApplyUserInfo{} } func (m *ApplyUserInfo) String() string { return proto.CompactTextString(m) } func (*ApplyUserInfo) ProtoMessage() {} func (*ApplyUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{9} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{9} } func (m *ApplyUserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ApplyUserInfo.Unmarshal(m, b) @@ -695,7 +695,7 @@ func (m *GetFriendListReq) Reset() { *m = GetFriendListReq{} } func (m *GetFriendListReq) String() string { return proto.CompactTextString(m) } func (*GetFriendListReq) ProtoMessage() {} func (*GetFriendListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{10} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{10} } func (m *GetFriendListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendListReq.Unmarshal(m, b) @@ -742,7 +742,7 @@ func (m *GetFriendListResp) Reset() { *m = GetFriendListResp{} } func (m *GetFriendListResp) String() string { return proto.CompactTextString(m) } func (*GetFriendListResp) ProtoMessage() {} func (*GetFriendListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{11} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{11} } func (m *GetFriendListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetFriendListResp.Unmarshal(m, b) @@ -803,7 +803,7 @@ func (m *UserInfo) Reset() { *m = UserInfo{} } func (m *UserInfo) String() string { return proto.CompactTextString(m) } func (*UserInfo) ProtoMessage() {} func (*UserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{12} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{12} } func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) @@ -907,7 +907,7 @@ func (m *AddBlacklistReq) Reset() { *m = AddBlacklistReq{} } func (m *AddBlacklistReq) String() string { return proto.CompactTextString(m) } func (*AddBlacklistReq) ProtoMessage() {} func (*AddBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{13} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{13} } func (m *AddBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddBlacklistReq.Unmarshal(m, b) @@ -968,7 +968,7 @@ func (m *RemoveBlacklistReq) Reset() { *m = RemoveBlacklistReq{} } func (m *RemoveBlacklistReq) String() string { return proto.CompactTextString(m) } func (*RemoveBlacklistReq) ProtoMessage() {} func (*RemoveBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{14} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{14} } func (m *RemoveBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RemoveBlacklistReq.Unmarshal(m, b) @@ -1021,7 +1021,7 @@ func (m *GetBlacklistReq) Reset() { *m = GetBlacklistReq{} } func (m *GetBlacklistReq) String() string { return proto.CompactTextString(m) } func (*GetBlacklistReq) ProtoMessage() {} func (*GetBlacklistReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{15} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{15} } func (m *GetBlacklistReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlacklistReq.Unmarshal(m, b) @@ -1068,7 +1068,7 @@ func (m *GetBlacklistResp) Reset() { *m = GetBlacklistResp{} } func (m *GetBlacklistResp) String() string { return proto.CompactTextString(m) } func (*GetBlacklistResp) ProtoMessage() {} func (*GetBlacklistResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{16} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{16} } func (m *GetBlacklistResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetBlacklistResp.Unmarshal(m, b) @@ -1122,7 +1122,7 @@ func (m *IsFriendReq) Reset() { *m = IsFriendReq{} } func (m *IsFriendReq) String() string { return proto.CompactTextString(m) } func (*IsFriendReq) ProtoMessage() {} func (*IsFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{17} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{17} } func (m *IsFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsFriendReq.Unmarshal(m, b) @@ -1176,7 +1176,7 @@ func (m *IsFriendResp) Reset() { *m = IsFriendResp{} } func (m *IsFriendResp) String() string { return proto.CompactTextString(m) } func (*IsFriendResp) ProtoMessage() {} func (*IsFriendResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{18} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{18} } func (m *IsFriendResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsFriendResp.Unmarshal(m, b) @@ -1230,7 +1230,7 @@ func (m *IsInBlackListReq) Reset() { *m = IsInBlackListReq{} } func (m *IsInBlackListReq) String() string { return proto.CompactTextString(m) } func (*IsInBlackListReq) ProtoMessage() {} func (*IsInBlackListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{19} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{19} } func (m *IsInBlackListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsInBlackListReq.Unmarshal(m, b) @@ -1284,7 +1284,7 @@ func (m *IsInBlackListResp) Reset() { *m = IsInBlackListResp{} } func (m *IsInBlackListResp) String() string { return proto.CompactTextString(m) } func (*IsInBlackListResp) ProtoMessage() {} func (*IsInBlackListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{20} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{20} } func (m *IsInBlackListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IsInBlackListResp.Unmarshal(m, b) @@ -1338,7 +1338,7 @@ func (m *DeleteFriendReq) Reset() { *m = DeleteFriendReq{} } func (m *DeleteFriendReq) String() string { return proto.CompactTextString(m) } func (*DeleteFriendReq) ProtoMessage() {} func (*DeleteFriendReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{21} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{21} } func (m *DeleteFriendReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteFriendReq.Unmarshal(m, b) @@ -1393,7 +1393,7 @@ func (m *AddFriendResponseReq) Reset() { *m = AddFriendResponseReq{} } func (m *AddFriendResponseReq) String() string { return proto.CompactTextString(m) } func (*AddFriendResponseReq) ProtoMessage() {} func (*AddFriendResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{22} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{22} } func (m *AddFriendResponseReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddFriendResponseReq.Unmarshal(m, b) @@ -1455,7 +1455,7 @@ func (m *SetFriendCommentReq) Reset() { *m = SetFriendCommentReq{} } func (m *SetFriendCommentReq) String() string { return proto.CompactTextString(m) } func (*SetFriendCommentReq) ProtoMessage() {} func (*SetFriendCommentReq) Descriptor() ([]byte, []int) { - return fileDescriptor_friend_05873114bd399886, []int{23} + return fileDescriptor_friend_03bf5fbe59a174aa, []int{23} } func (m *SetFriendCommentReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetFriendCommentReq.Unmarshal(m, b) @@ -2031,72 +2031,72 @@ var _Friend_serviceDesc = grpc.ServiceDesc{ Metadata: "friend/friend.proto", } -func init() { proto.RegisterFile("friend/friend.proto", fileDescriptor_friend_05873114bd399886) } +func init() { proto.RegisterFile("friend/friend.proto", fileDescriptor_friend_03bf5fbe59a174aa) } -var fileDescriptor_friend_05873114bd399886 = []byte{ - // 1011 bytes of a gzipped FileDescriptorProto +var fileDescriptor_friend_03bf5fbe59a174aa = []byte{ + // 1013 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x86, 0x48, 0xc9, 0x96, 0x46, 0x52, 0x24, 0xaf, 0xdd, 0x96, 0x65, 0x83, 0x42, 0x20, 0x72, - 0x48, 0x2f, 0x29, 0xe0, 0x22, 0xa7, 0x9c, 0x14, 0xbb, 0x0e, 0xd4, 0x34, 0x08, 0xc0, 0xd8, 0x97, - 0x16, 0x2d, 0x40, 0x8b, 0x23, 0x85, 0x08, 0xff, 0xc2, 0x65, 0x12, 0xfb, 0xd4, 0x63, 0xcf, 0x7d, - 0x94, 0xbe, 0x59, 0x1f,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8f, 0xf3, 0xb6, 0xb3, 0x82, 0xd9, 0x13, 0xcc, 0x6b, 0xc6, 0x3f, - 0xa8, 0x16, 0x73, 0xbd, 0x16, 0x49, 0x70, 0x32, 0x98, 0xd7, 0x4d, 0x7d, 0x82, 0x52, 0x44, 0x18, - 0xaf, 0xb8, 0x1a, 0x04, 0x95, 0x63, 0x3d, 0xcd, 0x31, 0x49, 0xc8, 0x35, 0x06, 0x6f, 0x51, 0x44, - 0xd8, 0x28, 0x09, 0x59, 0x6a, 0x9a, 0x80, 0xcd, 0x16, 0x60, 0xc7, 0x87, 0x89, 0x7a, 0x66, 0x27, - 0x58, 0x36, 0x0c, 0xf9, 0xcb, 0x20, 0x3d, 0xbf, 0x4e, 0x25, 0x41, 0x06, 0x6e, 0x25, 0x3b, 0x31, - 0xcc, 0x57, 0x7a, 0xd5, 0x15, 0xa3, 0x8d, 0x63, 0x2c, 0xa6, 0x41, 0x81, 0xa9, 0x14, 0x6f, 0x01, - 0x55, 0x00, 0x07, 0x8d, 0xf7, 0x76, 0x85, 0x96, 0x21, 0x4f, 0x93, 0x98, 0x4b, 0x68, 0x43, 0xb7, - 0x92, 0x9d, 0x5f, 0x61, 0x76, 0x8a, 0x21, 0xe6, 0xf8, 0x11, 0x36, 0x06, 0x27, 0x87, 0x23, 0x6d, - 0x17, 0x91, 0x2f, 0x76, 0xbf, 0x50, 0x36, 0x73, 0x43, 0x6b, 0xe6, 0xff, 0x19, 0x27, 0xf5, 0x6a, - 0xbf, 0x3e, 0x4b, 0x0f, 0x5f, 0x94, 0xad, 0xf7, 0x44, 0x36, 0x93, 0x1b, 0x61, 0x25, 0x6d, 0x58, - 0x9a, 0x4a, 0xef, 0x4e, 0x66, 0xbd, 0x3b, 0x55, 0x05, 0xdd, 0xd7, 0x0a, 0xfa, 0xf8, 0xef, 0x7d, - 0x28, 0x96, 0x77, 0x76, 0x06, 0x77, 0xb6, 0xb5, 0xa5, 0x9b, 0x7d, 0xdd, 0x5a, 0x65, 0xc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xfe, 0x42, 0x78, 0x3c, 0xfb, 0x65, 0x2a, 0x8f, 0x1e, 0xc9, 0x3f, 0x97, - 0x7b, 0xf4, 0x2b, 0xfc, 0x87, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x85, 0x59, 0x8f, 0x67, 0x9c, - 0x0f, 0x00, 0x00, + 0x10, 0x86, 0x48, 0xc9, 0x96, 0x46, 0x72, 0x24, 0xad, 0xdd, 0x96, 0x65, 0x83, 0x42, 0x20, 0x72, + 0x48, 0x2f, 0x2e, 0xe0, 0x22, 0xa7, 0x9c, 0x14, 0xbb, 0x0e, 0xd4, 0x34, 0x08, 0xc0, 0xd8, 0x97, + 0x16, 0x2d, 0x40, 0x8b, 0x23, 0x66, 0x11, 0xfe, 0x85, 0xcb, 0x24, 0xf6, 0xa9, 0xc7, 0x9e, 0xfb, + 0x28, 0x7d, 0xb3, 0x3e, 0x42, 0xb1, 0xbb, 0x24, 0x77, 0xf9, 0xa3, 0x34, 0xa8, 0x1c, 0xe7, 0x24, + 0xce, 0x70, 0x35, 0x3b, 0xdf, 0xcc, 0x7c, 0x33, 0x43, 0x38, 0xdc, 0x64, 0x14, 0x63, 0xff, 0x7b, + 0xf9, 0x73, 0x9c, 0x66, 0x49, 0x9e, 0x90, 0x3d, 0x29, 0x39, 0xe7, 0x00, 0xa7, 0x49, 0x14, 0x25, + 0xb1, 0x8b, 0x2c, 0x25, 0xf7, 0x61, 0x84, 0x59, 0x96, 0x64, 0xa7, 0x89, 0x8f, 0x56, 0x6f, 0xd1, + 0x7b, 0x38, 0x70, 0x95, 0x82, 0xd8, 0x30, 0x14, 0xc2, 0x73, 0x16, 0x58, 0xc6, 0xa2, 0xf7, 0x70, + 0xe4, 0x56, 0xb2, 0xf3, 0x1b, 0xcc, 0x9f, 0x62, 0x7e, 0x2e, 0x8c, 0xb2, 0x55, 0xbc, 0x49, 0x5c, + 0x7c, 0x43, 0x66, 0x60, 0xbe, 0xa5, 0xbe, 0x30, 0x34, 0x72,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xf5, 0x3b, 0xfb, 0xa8, 0xad, 0x94, 0xe0, 0x6b, 0xd3, 0x4b, 0x81, 0x6f, 0xb6, + 0x17, 0x05, 0xbe, 0xdd, 0x08, 0x96, 0x30, 0x09, 0xb4, 0x76, 0xae, 0xc0, 0x37, 0xe6, 0x85, 0x6d, + 0x75, 0xbf, 0x90, 0xf1, 0xf3, 0x35, 0xd6, 0x2b, 0x13, 0x8d, 0x5e, 0xd0, 0x09, 0xfe, 0x47, 0x98, + 0x7b, 0x4d, 0x56, 0x93, 0xfb, 0x1d, 0x95, 0x59, 0x11, 0xbe, 0xd3, 0xcc, 0x29, 0xcc, 0x58, 0x83, + 0xa6, 0xe4, 0x9b, 0xf2, 0x5c, 0x07, 0x81, 0xb7, 0xe4, 0x72, 0xa2, 0xaf, 0xfc, 0x0a, 0x48, 0xe3, + 0x4b, 0x44, 0xc5, 0xa2, 0xf9, 0x85, 0xf0, 0x64, 0xfe, 0xcb, 0xf4, 0xb8, 0xf8, 0xfe, 0x7e, 0x2c, + 0x7f, 0xae, 0xf6, 0xc4, 0x77, 0xf8, 0x0f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x6e, 0xf2, 0x29, + 0xc4, 0x9e, 0x0f, 0x00, 0x00, } diff --git a/pkg/proto/friend/friend.proto b/pkg/proto/friend/friend.proto index 7cbfc8c41..52b50d277 100644 --- a/pkg/proto/friend/friend.proto +++ b/pkg/proto/friend/friend.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "friend;friend"; +option go_package = "./friend;friend"; package friend; message CommonResp{ diff --git a/pkg/proto/group/group.pb.go b/pkg/proto/group/group.pb.go index 8e4bc5720..a17cc979c 100644 --- a/pkg/proto/group/group.pb.go +++ b/pkg/proto/group/group.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: group/group.proto -package group // import "group" +package group // import "./group" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -35,7 +35,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{0} + return fileDescriptor_group_ed07d0078ff66bfe, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -87,7 +87,7 @@ func (m *CreateGroupReq) Reset() { *m = CreateGroupReq{} } func (m *CreateGroupReq) String() string { return proto.CompactTextString(m) } func (*CreateGroupReq) ProtoMessage() {} func (*CreateGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{1} + return fileDescriptor_group_ed07d0078ff66bfe, []int{1} } func (m *CreateGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupReq.Unmarshal(m, b) @@ -163,6 +163,7 @@ func (m *CreateGroupReq) GetEx() string { return "" } +// GroupAddMemberInfo struct type GroupAddMemberInfo struct { Uid string `protobuf:"bytes,1,opt,name=uid" json:"uid,omitempty"` SetRole int32 `protobuf:"varint,2,opt,name=setRole" json:"setRole,omitempty"` @@ -175,7 +176,7 @@ func (m *GroupAddMemberInfo) Reset() { *m = GroupAddMemberInfo{} } func (m *GroupAddMemberInfo) String() string { return proto.CompactTextString(m) } func (*GroupAddMemberInfo) ProtoMessage() {} func (*GroupAddMemberInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{2} + return fileDescriptor_group_ed07d0078ff66bfe, []int{2} } func (m *GroupAddMemberInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupAddMemberInfo.Unmarshal(m, b) @@ -222,7 +223,7 @@ func (m *CreateGroupResp) Reset() { *m = CreateGroupResp{} } func (m *CreateGroupResp) String() string { return proto.CompactTextString(m) } func (*CreateGroupResp) ProtoMessage() {} func (*CreateGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{3} + return fileDescriptor_group_ed07d0078ff66bfe, []int{3} } func (m *CreateGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateGroupResp.Unmarshal(m, b) @@ -276,7 +277,7 @@ func (m *GetGroupsInfoReq) Reset() { *m = GetGroupsInfoReq{} } func (m *GetGroupsInfoReq) String() string { return proto.CompactTextString(m) } func (*GetGroupsInfoReq) ProtoMessage() {} func (*GetGroupsInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{4} + return fileDescriptor_group_ed07d0078ff66bfe, []int{4} } func (m *GetGroupsInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoReq.Unmarshal(m, b) @@ -330,7 +331,7 @@ func (m *GetGroupsInfoResp) Reset() { *m = GetGroupsInfoResp{} } func (m *GetGroupsInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupsInfoResp) ProtoMessage() {} func (*GetGroupsInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{5} + return fileDescriptor_group_ed07d0078ff66bfe, []int{5} } func (m *GetGroupsInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupsInfoResp.Unmarshal(m, b) @@ -388,7 +389,7 @@ func (m *SetGroupInfoReq) Reset() { *m = SetGroupInfoReq{} } func (m *SetGroupInfoReq) String() string { return proto.CompactTextString(m) } func (*SetGroupInfoReq) ProtoMessage() {} func (*SetGroupInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{6} + return fileDescriptor_group_ed07d0078ff66bfe, []int{6} } func (m *SetGroupInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetGroupInfoReq.Unmarshal(m, b) @@ -469,7 +470,7 @@ func (m *GetGroupApplicationListReq) Reset() { *m = GetGroupApplicationL func (m *GetGroupApplicationListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListReq) ProtoMessage() {} func (*GetGroupApplicationListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{7} + return fileDescriptor_group_ed07d0078ff66bfe, []int{7} } func (m *GetGroupApplicationListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListReq.Unmarshal(m, b) @@ -529,7 +530,7 @@ func (m *GetGroupApplicationList_Data_User) Reset() { *m = GetGroupAppli func (m *GetGroupApplicationList_Data_User) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationList_Data_User) ProtoMessage() {} func (*GetGroupApplicationList_Data_User) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{8} + return fileDescriptor_group_ed07d0078ff66bfe, []int{8} } func (m *GetGroupApplicationList_Data_User) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationList_Data_User.Unmarshal(m, b) @@ -673,7 +674,7 @@ func (m *GetGroupApplicationListData) Reset() { *m = GetGroupApplication func (m *GetGroupApplicationListData) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListData) ProtoMessage() {} func (*GetGroupApplicationListData) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{9} + return fileDescriptor_group_ed07d0078ff66bfe, []int{9} } func (m *GetGroupApplicationListData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListData.Unmarshal(m, b) @@ -720,7 +721,7 @@ func (m *GetGroupApplicationListResp) Reset() { *m = GetGroupApplication func (m *GetGroupApplicationListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupApplicationListResp) ProtoMessage() {} func (*GetGroupApplicationListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{10} + return fileDescriptor_group_ed07d0078ff66bfe, []int{10} } func (m *GetGroupApplicationListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupApplicationListResp.Unmarshal(m, b) @@ -775,7 +776,7 @@ func (m *TransferGroupOwnerReq) Reset() { *m = TransferGroupOwnerReq{} } func (m *TransferGroupOwnerReq) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerReq) ProtoMessage() {} func (*TransferGroupOwnerReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{11} + return fileDescriptor_group_ed07d0078ff66bfe, []int{11} } func (m *TransferGroupOwnerReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerReq.Unmarshal(m, b) @@ -835,7 +836,7 @@ func (m *TransferGroupOwnerResp) Reset() { *m = TransferGroupOwnerResp{} func (m *TransferGroupOwnerResp) String() string { return proto.CompactTextString(m) } func (*TransferGroupOwnerResp) ProtoMessage() {} func (*TransferGroupOwnerResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{12} + return fileDescriptor_group_ed07d0078ff66bfe, []int{12} } func (m *TransferGroupOwnerResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferGroupOwnerResp.Unmarshal(m, b) @@ -883,7 +884,7 @@ func (m *JoinGroupReq) Reset() { *m = JoinGroupReq{} } func (m *JoinGroupReq) String() string { return proto.CompactTextString(m) } func (*JoinGroupReq) ProtoMessage() {} func (*JoinGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{13} + return fileDescriptor_group_ed07d0078ff66bfe, []int{13} } func (m *JoinGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_JoinGroupReq.Unmarshal(m, b) @@ -956,7 +957,7 @@ func (m *GroupApplicationResponseReq) Reset() { *m = GroupApplicationRes func (m *GroupApplicationResponseReq) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseReq) ProtoMessage() {} func (*GroupApplicationResponseReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{14} + return fileDescriptor_group_ed07d0078ff66bfe, []int{14} } func (m *GroupApplicationResponseReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseReq.Unmarshal(m, b) @@ -1093,7 +1094,7 @@ func (m *GroupApplicationResponseResp) Reset() { *m = GroupApplicationRe func (m *GroupApplicationResponseResp) String() string { return proto.CompactTextString(m) } func (*GroupApplicationResponseResp) ProtoMessage() {} func (*GroupApplicationResponseResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{15} + return fileDescriptor_group_ed07d0078ff66bfe, []int{15} } func (m *GroupApplicationResponseResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationResponseResp.Unmarshal(m, b) @@ -1141,7 +1142,7 @@ func (m *SetOwnerGroupNickNameReq) Reset() { *m = SetOwnerGroupNickNameR func (m *SetOwnerGroupNickNameReq) String() string { return proto.CompactTextString(m) } func (*SetOwnerGroupNickNameReq) ProtoMessage() {} func (*SetOwnerGroupNickNameReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{16} + return fileDescriptor_group_ed07d0078ff66bfe, []int{16} } func (m *SetOwnerGroupNickNameReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetOwnerGroupNickNameReq.Unmarshal(m, b) @@ -1202,7 +1203,7 @@ func (m *QuitGroupReq) Reset() { *m = QuitGroupReq{} } func (m *QuitGroupReq) String() string { return proto.CompactTextString(m) } func (*QuitGroupReq) ProtoMessage() {} func (*QuitGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{17} + return fileDescriptor_group_ed07d0078ff66bfe, []int{17} } func (m *QuitGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_QuitGroupReq.Unmarshal(m, b) @@ -1262,7 +1263,7 @@ func (m *GroupApplicationUserInfo) Reset() { *m = GroupApplicationUserIn func (m *GroupApplicationUserInfo) String() string { return proto.CompactTextString(m) } func (*GroupApplicationUserInfo) ProtoMessage() {} func (*GroupApplicationUserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{18} + return fileDescriptor_group_ed07d0078ff66bfe, []int{18} } func (m *GroupApplicationUserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupApplicationUserInfo.Unmarshal(m, b) @@ -1360,7 +1361,7 @@ func (m *GroupMemberFullInfo) Reset() { *m = GroupMemberFullInfo{} } func (m *GroupMemberFullInfo) String() string { return proto.CompactTextString(m) } func (*GroupMemberFullInfo) ProtoMessage() {} func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{19} + return fileDescriptor_group_ed07d0078ff66bfe, []int{19} } func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) @@ -1430,7 +1431,7 @@ func (m *GetGroupMemberListReq) Reset() { *m = GetGroupMemberListReq{} } func (m *GetGroupMemberListReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListReq) ProtoMessage() {} func (*GetGroupMemberListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{20} + return fileDescriptor_group_ed07d0078ff66bfe, []int{20} } func (m *GetGroupMemberListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListReq.Unmarshal(m, b) @@ -1499,7 +1500,7 @@ func (m *GetGroupMemberListResp) Reset() { *m = GetGroupMemberListResp{} func (m *GetGroupMemberListResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMemberListResp) ProtoMessage() {} func (*GetGroupMemberListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{21} + return fileDescriptor_group_ed07d0078ff66bfe, []int{21} } func (m *GetGroupMemberListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMemberListResp.Unmarshal(m, b) @@ -1561,7 +1562,7 @@ func (m *GetGroupMembersInfoReq) Reset() { *m = GetGroupMembersInfoReq{} func (m *GetGroupMembersInfoReq) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoReq) ProtoMessage() {} func (*GetGroupMembersInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{22} + return fileDescriptor_group_ed07d0078ff66bfe, []int{22} } func (m *GetGroupMembersInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoReq.Unmarshal(m, b) @@ -1622,7 +1623,7 @@ func (m *GetGroupMembersInfoResp) Reset() { *m = GetGroupMembersInfoResp func (m *GetGroupMembersInfoResp) String() string { return proto.CompactTextString(m) } func (*GetGroupMembersInfoResp) ProtoMessage() {} func (*GetGroupMembersInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{23} + return fileDescriptor_group_ed07d0078ff66bfe, []int{23} } func (m *GetGroupMembersInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupMembersInfoResp.Unmarshal(m, b) @@ -1678,7 +1679,7 @@ func (m *KickGroupMemberReq) Reset() { *m = KickGroupMemberReq{} } func (m *KickGroupMemberReq) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberReq) ProtoMessage() {} func (*KickGroupMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{24} + return fileDescriptor_group_ed07d0078ff66bfe, []int{24} } func (m *KickGroupMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberReq.Unmarshal(m, b) @@ -1745,7 +1746,7 @@ func (m *Id2Result) Reset() { *m = Id2Result{} } func (m *Id2Result) String() string { return proto.CompactTextString(m) } func (*Id2Result) ProtoMessage() {} func (*Id2Result) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{25} + return fileDescriptor_group_ed07d0078ff66bfe, []int{25} } func (m *Id2Result) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Id2Result.Unmarshal(m, b) @@ -1792,7 +1793,7 @@ func (m *KickGroupMemberResp) Reset() { *m = KickGroupMemberResp{} } func (m *KickGroupMemberResp) String() string { return proto.CompactTextString(m) } func (*KickGroupMemberResp) ProtoMessage() {} func (*KickGroupMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{26} + return fileDescriptor_group_ed07d0078ff66bfe, []int{26} } func (m *KickGroupMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickGroupMemberResp.Unmarshal(m, b) @@ -1845,7 +1846,7 @@ func (m *GetJoinedGroupListReq) Reset() { *m = GetJoinedGroupListReq{} } func (m *GetJoinedGroupListReq) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListReq) ProtoMessage() {} func (*GetJoinedGroupListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{27} + return fileDescriptor_group_ed07d0078ff66bfe, []int{27} } func (m *GetJoinedGroupListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListReq.Unmarshal(m, b) @@ -1879,6 +1880,7 @@ func (m *GetJoinedGroupListReq) GetOperationID() string { return "" } +// GroupInfo struct type GroupInfo struct { GroupId string `protobuf:"bytes,1,opt,name=groupId" json:"groupId,omitempty"` GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` @@ -1897,7 +1899,7 @@ func (m *GroupInfo) Reset() { *m = GroupInfo{} } func (m *GroupInfo) String() string { return proto.CompactTextString(m) } func (*GroupInfo) ProtoMessage() {} func (*GroupInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{28} + return fileDescriptor_group_ed07d0078ff66bfe, []int{28} } func (m *GroupInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GroupInfo.Unmarshal(m, b) @@ -1986,7 +1988,7 @@ func (m *GetJoinedGroupListResp) Reset() { *m = GetJoinedGroupListResp{} func (m *GetJoinedGroupListResp) String() string { return proto.CompactTextString(m) } func (*GetJoinedGroupListResp) ProtoMessage() {} func (*GetJoinedGroupListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{29} + return fileDescriptor_group_ed07d0078ff66bfe, []int{29} } func (m *GetJoinedGroupListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJoinedGroupListResp.Unmarshal(m, b) @@ -2042,7 +2044,7 @@ func (m *InviteUserToGroupReq) Reset() { *m = InviteUserToGroupReq{} } func (m *InviteUserToGroupReq) String() string { return proto.CompactTextString(m) } func (*InviteUserToGroupReq) ProtoMessage() {} func (*InviteUserToGroupReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{30} + return fileDescriptor_group_ed07d0078ff66bfe, []int{30} } func (m *InviteUserToGroupReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupReq.Unmarshal(m, b) @@ -2110,7 +2112,7 @@ func (m *InviteUserToGroupResp) Reset() { *m = InviteUserToGroupResp{} } func (m *InviteUserToGroupResp) String() string { return proto.CompactTextString(m) } func (*InviteUserToGroupResp) ProtoMessage() {} func (*InviteUserToGroupResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{31} + return fileDescriptor_group_ed07d0078ff66bfe, []int{31} } func (m *InviteUserToGroupResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InviteUserToGroupResp.Unmarshal(m, b) @@ -2164,7 +2166,7 @@ func (m *GetGroupAllMemberReq) Reset() { *m = GetGroupAllMemberReq{} } func (m *GetGroupAllMemberReq) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberReq) ProtoMessage() {} func (*GetGroupAllMemberReq) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{32} + return fileDescriptor_group_ed07d0078ff66bfe, []int{32} } func (m *GetGroupAllMemberReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberReq.Unmarshal(m, b) @@ -2218,7 +2220,7 @@ func (m *GetGroupAllMemberResp) Reset() { *m = GetGroupAllMemberResp{} } func (m *GetGroupAllMemberResp) String() string { return proto.CompactTextString(m) } func (*GetGroupAllMemberResp) ProtoMessage() {} func (*GetGroupAllMemberResp) Descriptor() ([]byte, []int) { - return fileDescriptor_group_9fd4d73937974f0d, []int{33} + return fileDescriptor_group_ed07d0078ff66bfe, []int{33} } func (m *GetGroupAllMemberResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetGroupAllMemberResp.Unmarshal(m, b) @@ -2799,116 +2801,116 @@ var _Group_serviceDesc = grpc.ServiceDesc{ Metadata: "group/group.proto", } -func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_9fd4d73937974f0d) } - -var fileDescriptor_group_9fd4d73937974f0d = []byte{ - // 1717 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6e, 0xdc, 0x46, - 0x12, 0x06, 0x67, 0x38, 0x92, 0xa6, 0xf4, 0xdf, 0xb2, 0x64, 0xee, 0x58, 0x2b, 0xc8, 0xbd, 0xc6, - 0x42, 0xd8, 0x83, 0x17, 0x90, 0x91, 0x00, 0x4e, 0x7c, 0x88, 0x2d, 0x59, 0xb2, 0x9c, 0x58, 0xb2, - 0x29, 0xf9, 0x92, 0x8b, 0x4d, 0x0f, 0x5b, 0x63, 0x5a, 0x33, 0xe4, 0x88, 0xe4, 0xc4, 0x4e, 0x2e, - 0x81, 0x83, 0x00, 0xf9, 0x43, 0x90, 0x83, 0x4f, 0x49, 0x5e, 0x20, 0xa7, 0x3c, 0x41, 0xde, 0x26, - 0x2f, 0x12, 0x74, 0xf5, 0x0f, 0x9b, 0x7f, 0x23, 0x43, 0x0a, 0xe2, 0xcb, 0x80, 0x55, 0x5d, 0xdd, - 0x5d, 0x55, 0x5d, 0xf5, 0x75, 0x55, 0x0f, 0x2c, 0xf6, 0xe2, 0x68, 0x34, 0xfc, 0x3f, 0xfe, 0x5e, - 0x1f, 0xc6, 0x51, 0x1a, 0x91, 0x16, 0x12, 0x74, 0x07, 0x60, 0x2b, 0x1a, 0x0c, 0xa2, 0xd0, 0x65, - 0xc9, 0x90, 0xac, 0x42, 0xfb, 0x6e, 0x1c, 0x47, 0xf1, 0x56, 0xe4, 0x33, 0xc7, 0x5a, 0xb7, 0x36, - 0x5a, 0x6e, 0xc6, 0x20, 0x1d, 0x98, 0x42, 0xe2, 0x41, 0xd2, 0x73, 0x1a, 0xeb, 0xd6, 0x46, 0xdb, - 0xd5, 0x34, 0x7d, 0xd3, 0x80, 0xb9, 0xad, 0x98, 0x79, 0x29, 0xdb, 0xe5, 0xeb, 0xba, 0xec, 0x94, - 0xdc, 0x04, 0x18, 0xb0, 0xc1, 0x33, 0x16, 0x7f, 0x12, 0x24, 0xa9, 0x63, 0xad, 0x37, 0x37, 0xa6, - 0x37, 0xff, 0x75, 0x5d, 0xe8, 0x80, 0x42, 0xb7, 0x7d, 0xff, 0x01, 0x0a, 0xec, 0x85, 0xc7, 0x91, - 0x6b, 0x08, 0x73, 0x3d, 0x50, 0x6e, 0xdf, 0x1b, 0x30, 0xb9, 0x55, 0xc6, 0x20, 0x14, 0x66, 0x82, - 0x30, 0x8d, 0x23, 0x7f, 0xd4, 0x4d, 0x83, 0x28, 0x74, 0x9a, 0x28, 0x90, 0xe3, 0x71, 0x99, 0x30, - 0x4a, 0x83, 0xe3, 0xa0, 0xeb, 0xa1, 0x8c, 0x2d, 0x64, 0x4c, 0x1e, 0x71, 0x60, 0xf2, 0xd8, 0xeb, - 0xb2, 0xc7, 0x71, 0xdf, 0x69, 0xe1, 0xb0, 0x22, 0xc9, 0x25, 0x68, 0xa5, 0xd1, 0x09, 0x0b, 0x9d, - 0x09, 0xe4, 0x0b, 0x82, 0xac, 0xc3, 0x74, 0x34, 0x64, 0x31, 0x4e, 0xde, 0xdb, 0x76, 0x26, 0x71, - 0xcc, 0x64, 0x91, 0x39, 0x68, 0xb0, 0x57, 0xce, 0x14, 0x0e, 0x34, 0xd8, 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x29, 0x08, 0x3f, 0x0b, 0x52, 0xc6, 0xef, 0xd2, 0xa3, 0x48, 0x5f, 0xe0, 0xe7, 0x3c, 0xd9, - 0xfa, 0x57, 0x19, 0x23, 0x99, 0xec, 0x5c, 0x32, 0x39, 0x30, 0x29, 0x73, 0xce, 0x69, 0x21, 0x74, - 0x29, 0x92, 0xbe, 0xb6, 0x60, 0xb9, 0x42, 0xb9, 0x7f, 0x34, 0xf4, 0x9f, 0xc3, 0x25, 0xdd, 0x3c, - 0xf5, 0xfb, 0x6f, 0x03, 0x39, 0xe7, 0x7d, 0x47, 0xfa, 0xd1, 0xb8, 0x43, 0x8d, 0xad, 0xde, 0x15, - 0xd6, 0x6e, 0xfe, 0x3e, 0x05, 0xe2, 0x59, 0x95, 0x83, 0x68, 0x37, 0x7b, 0xb6, 0x23, 0xcb, 0x72, - 0x81, 0xfc, 0x0b, 0x69, 0x67, 0xa5, 0x8a, 0x9d, 0x0c, 0xc9, 0x0d, 0x68, 0xbf, 0x50, 0xfd, 0x17, - 0x59, 0x92, 0x42, 0x66, 0x47, 0xd6, 0x59, 0x54, 0x33, 0xb3, 0xb7, 0xdb, 0x1b, 0xd0, 0x3e, 0x55, - 0xf5, 0xa4, 0x9e, 0x64, 0x56, 0x98, 0x55, 0x93, 0xee, 0xc0, 0x6c, 0xcf, 0x7c, 0x89, 0x23, 0x97, - 0x0b, 0xed, 0xaf, 0xba, 0x4b, 0x3b, 0x4e, 0xf5, 0x40, 0x32, 0x24, 0x37, 0x61, 0x26, 0x31, 0xde, - 0xd5, 0x88, 0xb2, 0xaa, 0xf0, 0xd8, 0x56, 0xb5, 0xfd, 0x53, 0xb8, 0xdc, 0xab, 0xee, 0xb3, 0xc9, - 0xd5, 0xf1, 0x7d, 0x38, 0x5f, 0x90, 0x9e, 0x25, 0x92, 0x0c, 0xc9, 0x23, 0x20, 0x69, 0xa9, 0x2d, - 0x26, 0xab, 0x72, 0x66, 0x65, 0xfb, 0xde, 0xf9, 0xf7, 0x98, 0xd1, 0x64, 0x48, 0xba, 0xe0, 0xf4, - 0x6a, 0xba, 0x12, 0x42, 0x73, 0xef, 0xdb, 0x95, 0x1d, 0x6c, 0xe7, 0x3f, 0x67, 0xca, 0x08, 0xbd, - 0x7b, 0xa5, 0xfa, 0x4b, 0xeb, 0x5d, 0x59, 0x38, 0x6a, 0xbd, 0x6b, 0x0a, 0xb7, 0x23, 0x58, 0xea, - 0x95, 0x4b, 0x13, 0x52, 0x3d, 0x4b, 0x9f, 0xfb, 0xda, 0xb8, 0xe1, 0x64, 0x48, 0xee, 0xc1, 0xfc, - 0x49, 0xfe, 0xa6, 0x25, 0xea, 0x91, 0xbf, 0x5c, 0x76, 0x74, 0x3a, 0x75, 0x43, 0xda, 0xe4, 0x02, - 0xb8, 0x6b, 0x93, 0x2b, 0x6f, 0x53, 0x6d, 0x72, 0xcd, 0xad, 0xb0, 0x0f, 0x8b, 0x25, 0x34, 0x24, - 0x57, 0xe4, 0x9c, 0x2a, 0x10, 0xef, 0xac, 0xd6, 0x0f, 0x8a, 0xf5, 0x7a, 0x45, 0xbc, 0xd1, 0xeb, - 0x55, 0x81, 0x5e, 0x67, 0xb5, 0x7e, 0x30, 0x19, 0xde, 0x99, 0xfd, 0x54, 0xbc, 0xa7, 0x7f, 0x88, - 0xbf, 0xcf, 0x26, 0xf0, 0xaf, 0x99, 0x1b, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x31, 0x19, 0x23, - 0x3c, 0xaf, 0x19, 0x00, 0x00, +func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_ed07d0078ff66bfe) } + +var fileDescriptor_group_ed07d0078ff66bfe = []byte{ + // 1718 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6e, 0xdc, 0xb6, + 0x13, 0x87, 0x76, 0xb5, 0xb6, 0x77, 0xfc, 0x4d, 0xc7, 0x8e, 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, 0x43, 0x41, 0x05, 0x63, 0x8a, 0xe6, 0x63, 0x07, 0xec, 0x85, 0x18, 0x13, + 0x69, 0x91, 0xd2, 0xc5, 0x34, 0x35, 0xcb, 0x69, 0x7a, 0x0f, 0x56, 0xaa, 0x94, 0x39, 0x8f, 0x47, + 0xe8, 0x57, 0x30, 0x73, 0x2f, 0xf4, 0x83, 0xf4, 0x26, 0xaf, 0x87, 0x49, 0x0b, 0x26, 0xfb, 0x2c, + 0x8e, 0xdd, 0xae, 0x02, 0x49, 0x45, 0x66, 0x00, 0xd6, 0x2c, 0x00, 0xd8, 0x18, 0x3b, 0x7e, 0x30, + 0xe1, 0x4a, 0xd1, 0xf1, 0xdc, 0x8c, 0x30, 0x88, 0x99, 0xbc, 0x95, 0xf4, 0x15, 0x8c, 0xd2, 0x0a, + 0x5c, 0x27, 0x34, 0x3e, 0x83, 0x1e, 0x49, 0xea, 0xe7, 0xd2, 0x1c, 0x05, 0x4a, 0x66, 0x09, 0x94, + 0x0a, 0x50, 0x80, 0xb7, 0x42, 0xab, 0x0c, 0x05, 0x07, 0x35, 0x29, 0x3e, 0x51, 0x9d, 0xe2, 0x3a, + 0xd4, 0x4d, 0x16, 0xa0, 0x2e, 0x07, 0x28, 0xb8, 0xdf, 0x54, 0x11, 0x50, 0x70, 0xb7, 0x12, 0x4c, + 0xb4, 0xab, 0x60, 0x42, 0x03, 0x39, 0xc8, 0x83, 0x5c, 0x1e, 0x3e, 0xa7, 0xc7, 0xc0, 0xe7, 0x4c, + 0x09, 0x3e, 0x15, 0xbc, 0xcc, 0x8e, 0x80, 0x97, 0xb9, 0x37, 0x80, 0x97, 0xf9, 0x0a, 0x78, 0x79, + 0x00, 0xab, 0xf5, 0xa1, 0x70, 0xae, 0xc8, 0xfe, 0xde, 0x00, 0xeb, 0x88, 0x25, 0x18, 0x10, 0xb8, + 0xb4, 0xf2, 0xe3, 0xe8, 0x30, 0xb7, 0x61, 0x2a, 0x50, 0xc7, 0x20, 0xd3, 0x56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0x10, 0xb7, 0x57, 0xeb, 0x07, 0xc5, 0x7a, 0xdd, 0x22, 0xde, 0xa4, 0xeb, 0x55, + 0x81, 0x9e, 0xbd, 0x5a, 0x3f, 0x18, 0x0f, 0x6e, 0xcf, 0x7f, 0x3e, 0xbb, 0x29, 0xfe, 0x95, 0xf9, + 0x18, 0x7f, 0x9f, 0x4e, 0xe0, 0x9f, 0x33, 0xd7, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xd8, + 0xe8, 0x44, 0xb1, 0x19, 0x00, 0x00, } diff --git a/pkg/proto/group/group.proto b/pkg/proto/group/group.proto index 3180e7a2f..ff1821ec2 100644 --- a/pkg/proto/group/group.proto +++ b/pkg/proto/group/group.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "group;group"; +option go_package = "./group;group"; package group; message CommonResp{ diff --git a/pkg/proto/proto_dir.cfg b/pkg/proto/proto_dir.cfg index 383f545a2..1ad259e8a 100644 --- a/pkg/proto/proto_dir.cfg +++ b/pkg/proto/proto_dir.cfg @@ -7,4 +7,5 @@ all_proto=( chat/chat.proto push/push.proto relay/relay.proto + sdk_ws/ws.proto ) diff --git a/pkg/proto/push/push.pb.go b/pkg/proto/push/push.pb.go index bc663c33f..2fdbd2f53 100644 --- a/pkg/proto/push/push.pb.go +++ b/pkg/proto/push/push.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: push/push.proto -package pbPush // import "push" +package pbPush // import "./push" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -49,7 +49,7 @@ func (m *PushMsgReq) Reset() { *m = PushMsgReq{} } func (m *PushMsgReq) String() string { return proto.CompactTextString(m) } func (*PushMsgReq) ProtoMessage() {} func (*PushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_push_a8d13c8ad86fddce, []int{0} + return fileDescriptor_push_4f08d2ff54ba8af2, []int{0} } func (m *PushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgReq.Unmarshal(m, b) @@ -192,7 +192,7 @@ func (m *PushMsgResp) Reset() { *m = PushMsgResp{} } func (m *PushMsgResp) String() string { return proto.CompactTextString(m) } func (*PushMsgResp) ProtoMessage() {} func (*PushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_push_a8d13c8ad86fddce, []int{1} + return fileDescriptor_push_4f08d2ff54ba8af2, []int{1} } func (m *PushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgResp.Unmarshal(m, b) @@ -296,32 +296,32 @@ var _PushMsgService_serviceDesc = grpc.ServiceDesc{ Metadata: "push/push.proto", } -func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_a8d13c8ad86fddce) } +func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_4f08d2ff54ba8af2) } -var fileDescriptor_push_a8d13c8ad86fddce = []byte{ - // 377 bytes of a gzipped FileDescriptorProto +var fileDescriptor_push_4f08d2ff54ba8af2 = []byte{ + // 378 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5d, 0xeb, 0xda, 0x30, - 0x14, 0xc6, 0xe9, 0xb4, 0xbe, 0x9c, 0xce, 0x97, 0x85, 0x31, 0x82, 0x17, 0xa3, 0xc8, 0x18, 0xde, - 0xcc, 0xc1, 0x76, 0xb9, 0x9b, 0x31, 0x8b, 0x50, 0x98, 0x2f, 0xa4, 0xee, 0x66, 0x77, 0xb5, 0x9e, + 0x14, 0xc6, 0xe9, 0xb4, 0xbe, 0x1c, 0xe7, 0xcb, 0xc2, 0x18, 0xc1, 0x8b, 0x51, 0x64, 0x0c, 0x6f, + 0xd6, 0xc1, 0x76, 0xb9, 0x9b, 0x31, 0x8b, 0x50, 0x98, 0x2f, 0xa4, 0xee, 0x66, 0x77, 0xb5, 0x9e, 0x6a, 0x59, 0x9b, 0xc4, 0xa6, 0x0a, 0xfb, 0xd2, 0xfb, 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, 0x7a, 0xec, 0xcf, 0xf4, 0xcd, 0x13, 0x51, 0xf2, 0xc7, 0xf8, 0xf7, + 0xd0, 0x37, 0x7b, 0xf7, 0x4d, 0xee, 0x35, 0xdf, 0x77, 0xcc, 0xfe, 0x7d, 0xfd, 0x1f, 0x00, 0x00, + 0xff, 0xff, 0x6b, 0x53, 0xf4, 0xd4, 0x92, 0x02, 0x00, 0x00, } diff --git a/pkg/proto/push/push.proto b/pkg/proto/push/push.proto index 7226aa543..60fddfe3b 100644 --- a/pkg/proto/push/push.proto +++ b/pkg/proto/push/push.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "push;pbPush"; +option go_package = "./push;pbPush"; package push; message PushMsgReq { diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go index 542f3523a..32fcc227c 100644 --- a/pkg/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: relay/relay.proto -package pbRelay // import "relay" +package pbRelay // import "./relay" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -47,7 +47,7 @@ func (m *MsgToUserReq) Reset() { *m = MsgToUserReq{} } func (m *MsgToUserReq) String() string { return proto.CompactTextString(m) } func (*MsgToUserReq) ProtoMessage() {} func (*MsgToUserReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_1ba173c940428df4, []int{0} + return fileDescriptor_relay_ff2396ffa84abfa7, []int{0} } func (m *MsgToUserReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgToUserReq.Unmarshal(m, b) @@ -176,7 +176,7 @@ func (m *MsgToUserResp) Reset() { *m = MsgToUserResp{} } func (m *MsgToUserResp) String() string { return proto.CompactTextString(m) } func (*MsgToUserResp) ProtoMessage() {} func (*MsgToUserResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_1ba173c940428df4, []int{1} + return fileDescriptor_relay_ff2396ffa84abfa7, []int{1} } func (m *MsgToUserResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgToUserResp.Unmarshal(m, b) @@ -227,7 +227,7 @@ func (m *SingleMsgToUser) Reset() { *m = SingleMsgToUser{} } func (m *SingleMsgToUser) String() string { return proto.CompactTextString(m) } func (*SingleMsgToUser) ProtoMessage() {} func (*SingleMsgToUser) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_1ba173c940428df4, []int{2} + return fileDescriptor_relay_ff2396ffa84abfa7, []int{2} } func (m *SingleMsgToUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingleMsgToUser.Unmarshal(m, b) @@ -346,34 +346,34 @@ var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ Metadata: "relay/relay.proto", } -func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_1ba173c940428df4) } - -var fileDescriptor_relay_1ba173c940428df4 = []byte{ - // 412 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30, - 0x14, 0xc6, 0x15, 0x42, 0xbb, 0xf5, 0x75, 0x6d, 0xc1, 0xa0, 0xc9, 0xec, 0x80, 0xa2, 0x0a, 0x4d, - 0x11, 0x87, 0x21, 0x0d, 0x89, 0xcb, 0x6e, 0x2c, 0xaa, 0x14, 0x89, 0x6c, 0xc8, 0xe9, 0x2e, 0xdc, - 0xb2, 0xec, 0x11, 0x59, 0x24, 0x76, 0x6a, 0x87, 0x49, 0xfb, 0xef, 0xf8, 0xd3, 0x90, 0x9f, 0x5b, - 0x6a, 0x8a, 0xb8, 0x44, 0xf9, 0x7e, 0xef, 0xcb, 0xcb, 0xe7, 0xe7, 0x07, 0x2f, 0x0d, 0xb6, 0xd5, - 0xd3, 0x07, 0x7a, 0x5e, 0xf4, 0x46, 0x0f, 0x9a, 0x8d, 0x48, 0x2c, 0x7f, 0xc5, 0x70, 0x52, 0xd8, - 0x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xf3, 0xbc, 0xf0, 0x79, 0x02, 0xb4, 0xbc, 0x82, 0x59, - 0x70, 0x83, 0xb6, 0x67, 0xef, 0xe1, 0xb9, 0x41, 0xdb, 0xf3, 0x28, 0x89, 0xd3, 0xe9, 0xe5, 0xe9, - 0x85, 0xbf, 0xf6, 0x52, 0xaa, 0xa6, 0xc5, 0xbd, 0x93, 0x3c, 0xcb, 0x0d, 0x2c, 0x0e, 0x0a, 0xee, - 0x7c, 0x02, 0xed, 0xcf, 0x76, 0xb8, 0xd6, 0x0f, 0x48, 0x5b, 0x10, 0x8b, 0x80, 0xfc, 0x77, 0x13, - 0xce, 0x61, 0xee, 0xde, 0xdc, 0x24, 0x56, 0x7e, 0x36, 0x31, 0xcd, 0xe6, 0x80, 0x5e, 0x96, 0xf0, - 0xe6, 0x56, 0xb5, 0x52, 0x61, 0x81, 0xd6, 0x56, 0x0d, 0x0a, 0x17, 0xcf, 0x0d, 0x58, 0xd6, 0xc8, - 0x3e, 0xc1, 0x64, 0x9f, 0xe4, 0xd5, 0x36, 0x7a, 0xb8, 0xa0, 0x67, 0xaf, 0xff, 0x85, 0xb6, 0xff, - 0xbc, 0xf8, 0x36, 0x23, 0x7c, 0xd5, 0xdf, 0x53, 0xbf, 0xfb, 0x31, 0xad, 0xf9, 0xc7, 0xdf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xca, 0xdd, 0x7b, 0x0c, 0xfb, 0x02, 0x00, 0x00, +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_ff2396ffa84abfa7) } + +var fileDescriptor_relay_ff2396ffa84abfa7 = []byte{ + // 414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6b, 0xdb, 0x30, + 0x14, 0xc6, 0xf1, 0xbc, 0xa4, 0xcd, 0x4b, 0x93, 0xac, 0xda, 0x28, 0x5a, 0x0f, 0xc3, 0x84, 0x51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xc7, 0xfb, 0x21, 0x2d, 0xfa, 0xa7, + 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x9b, 0x83, 0x12, 0xfd, 0x02, 0x00, 0x00, } diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index 138163a80..56b876c67 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "relay;pbRelay"; +option go_package = "./relay;pbRelay"; package relay; message MsgToUserReq { diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go new file mode 100644 index 000000000..effde5aa0 --- /dev/null +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -0,0 +1,753 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sdk_ws/ws.proto + +package open_im_sdk // import "./sdk_ws" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type PullMessageBySeqListResp struct { + MaxSeq int64 `protobuf:"varint,1,opt,name=MaxSeq" json:"MaxSeq,omitempty"` + MinSeq int64 `protobuf:"varint,2,opt,name=MinSeq" json:"MinSeq,omitempty"` + SingleUserMsg []*GatherFormat `protobuf:"bytes,3,rep,name=SingleUserMsg" json:"SingleUserMsg,omitempty"` + GroupUserMsg []*GatherFormat `protobuf:"bytes,4,rep,name=GroupUserMsg" json:"GroupUserMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PullMessageBySeqListResp) Reset() { *m = PullMessageBySeqListResp{} } +func (m *PullMessageBySeqListResp) String() string { return proto.CompactTextString(m) } +func (*PullMessageBySeqListResp) ProtoMessage() {} +func (*PullMessageBySeqListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{0} +} +func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) +} +func (m *PullMessageBySeqListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PullMessageBySeqListResp.Marshal(b, m, deterministic) +} +func (dst *PullMessageBySeqListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_PullMessageBySeqListResp.Merge(dst, src) +} +func (m *PullMessageBySeqListResp) XXX_Size() int { + return xxx_messageInfo_PullMessageBySeqListResp.Size(m) +} +func (m *PullMessageBySeqListResp) XXX_DiscardUnknown() { + xxx_messageInfo_PullMessageBySeqListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_PullMessageBySeqListResp proto.InternalMessageInfo + +func (m *PullMessageBySeqListResp) GetMaxSeq() int64 { + if m != nil { + return m.MaxSeq + } + return 0 +} + +func (m *PullMessageBySeqListResp) GetMinSeq() int64 { + if m != nil { + return m.MinSeq + } + return 0 +} + +func (m *PullMessageBySeqListResp) GetSingleUserMsg() []*GatherFormat { + if m != nil { + return m.SingleUserMsg + } + return nil +} + +func (m *PullMessageBySeqListResp) GetGroupUserMsg() []*GatherFormat { + if m != nil { + return m.GroupUserMsg + } + return nil +} + +type PullMessageBySeqListReq struct { + SeqList []int64 `protobuf:"varint,1,rep,packed,name=seqList" json:"seqList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq{} } +func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } +func (*PullMessageBySeqListReq) ProtoMessage() {} +func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{1} +} +func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) +} +func (m *PullMessageBySeqListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PullMessageBySeqListReq.Marshal(b, m, deterministic) +} +func (dst *PullMessageBySeqListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_PullMessageBySeqListReq.Merge(dst, src) +} +func (m *PullMessageBySeqListReq) XXX_Size() int { + return xxx_messageInfo_PullMessageBySeqListReq.Size(m) +} +func (m *PullMessageBySeqListReq) XXX_DiscardUnknown() { + xxx_messageInfo_PullMessageBySeqListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_PullMessageBySeqListReq proto.InternalMessageInfo + +func (m *PullMessageBySeqListReq) GetSeqList() []int64 { + if m != nil { + return m.SeqList + } + return nil +} + +type GetMaxAndMinSeqReq struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } +func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } +func (*GetMaxAndMinSeqReq) ProtoMessage() {} +func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{2} +} +func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) +} +func (m *GetMaxAndMinSeqReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMaxAndMinSeqReq.Marshal(b, m, deterministic) +} +func (dst *GetMaxAndMinSeqReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMaxAndMinSeqReq.Merge(dst, src) +} +func (m *GetMaxAndMinSeqReq) XXX_Size() int { + return xxx_messageInfo_GetMaxAndMinSeqReq.Size(m) +} +func (m *GetMaxAndMinSeqReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetMaxAndMinSeqReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMaxAndMinSeqReq proto.InternalMessageInfo + +type GetMaxAndMinSeqResp struct { + MaxSeq int64 `protobuf:"varint,1,opt,name=maxSeq" json:"maxSeq,omitempty"` + MinSeq int64 `protobuf:"varint,2,opt,name=minSeq" json:"minSeq,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } +func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } +func (*GetMaxAndMinSeqResp) ProtoMessage() {} +func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{3} +} +func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) +} +func (m *GetMaxAndMinSeqResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetMaxAndMinSeqResp.Marshal(b, m, deterministic) +} +func (dst *GetMaxAndMinSeqResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMaxAndMinSeqResp.Merge(dst, src) +} +func (m *GetMaxAndMinSeqResp) XXX_Size() int { + return xxx_messageInfo_GetMaxAndMinSeqResp.Size(m) +} +func (m *GetMaxAndMinSeqResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetMaxAndMinSeqResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMaxAndMinSeqResp proto.InternalMessageInfo + +func (m *GetMaxAndMinSeqResp) GetMaxSeq() int64 { + if m != nil { + return m.MaxSeq + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetMinSeq() int64 { + if m != nil { + return m.MinSeq + } + return 0 +} + +type GatherFormat struct { + // @inject_tag: json:"id" + ID string `protobuf:"bytes,1,opt,name=ID" json:"id"` + // @inject_tag: json:"list" + List []*MsgFormat `protobuf:"bytes,2,rep,name=List" json:"list"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GatherFormat) Reset() { *m = GatherFormat{} } +func (m *GatherFormat) String() string { return proto.CompactTextString(m) } +func (*GatherFormat) ProtoMessage() {} +func (*GatherFormat) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{4} +} +func (m *GatherFormat) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GatherFormat.Unmarshal(m, b) +} +func (m *GatherFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GatherFormat.Marshal(b, m, deterministic) +} +func (dst *GatherFormat) XXX_Merge(src proto.Message) { + xxx_messageInfo_GatherFormat.Merge(dst, src) +} +func (m *GatherFormat) XXX_Size() int { + return xxx_messageInfo_GatherFormat.Size(m) +} +func (m *GatherFormat) XXX_DiscardUnknown() { + xxx_messageInfo_GatherFormat.DiscardUnknown(m) +} + +var xxx_messageInfo_GatherFormat proto.InternalMessageInfo + +func (m *GatherFormat) GetID() string { + if m != nil { + return m.ID + } + return "" +} + +func (m *GatherFormat) GetList() []*MsgFormat { + if m != nil { + return m.List + } + return nil +} + +type MsgFormat struct { + // @inject_tag: json:"sendID" + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"sendID"` + // @inject_tag: json:"recvID" + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"recvID"` + // @inject_tag: json:"msgFrom" + MsgFrom int32 `protobuf:"varint,3,opt,name=MsgFrom" json:"msgFrom"` + // @inject_tag: json:"contentType" + ContentType int32 `protobuf:"varint,4,opt,name=ContentType" json:"contentType"` + // @inject_tag: json:"serverMsgID" + ServerMsgID string `protobuf:"bytes,5,opt,name=ServerMsgID" json:"serverMsgID"` + // @inject_tag: json:"content" + Content string `protobuf:"bytes,6,opt,name=Content" json:"content"` + // @inject_tag: json:"seq" + Seq int64 `protobuf:"varint,7,opt,name=Seq" json:"seq"` + // @inject_tag: json:"sendTime" + SendTime int64 `protobuf:"varint,8,opt,name=SendTime" json:"sendTime"` + // @inject_tag: json:"senderPlatformID" + SenderPlatformID int32 `protobuf:"varint,9,opt,name=SenderPlatformID" json:"senderPlatformID"` + // @inject_tag: json:"senderNickName" + SenderNickName string `protobuf:"bytes,10,opt,name=SenderNickName" json:"senderNickName"` + // @inject_tag: json:"senderFaceUrl" + SenderFaceURL string `protobuf:"bytes,11,opt,name=SenderFaceURL" json:"senderFaceUrl"` + // @inject_tag: json:"clientMsgID" + ClientMsgID string `protobuf:"bytes,12,opt,name=ClientMsgID" json:"clientMsgID"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgFormat) Reset() { *m = MsgFormat{} } +func (m *MsgFormat) String() string { return proto.CompactTextString(m) } +func (*MsgFormat) ProtoMessage() {} +func (*MsgFormat) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{5} +} +func (m *MsgFormat) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgFormat.Unmarshal(m, b) +} +func (m *MsgFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgFormat.Marshal(b, m, deterministic) +} +func (dst *MsgFormat) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFormat.Merge(dst, src) +} +func (m *MsgFormat) XXX_Size() int { + return xxx_messageInfo_MsgFormat.Size(m) +} +func (m *MsgFormat) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFormat.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFormat proto.InternalMessageInfo + +func (m *MsgFormat) GetSendID() string { + if m != nil { + return m.SendID + } + return "" +} + +func (m *MsgFormat) GetRecvID() string { + if m != nil { + return m.RecvID + } + return "" +} + +func (m *MsgFormat) GetMsgFrom() int32 { + if m != nil { + return m.MsgFrom + } + return 0 +} + +func (m *MsgFormat) GetContentType() int32 { + if m != nil { + return m.ContentType + } + return 0 +} + +func (m *MsgFormat) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID + } + return "" +} + +func (m *MsgFormat) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *MsgFormat) GetSeq() int64 { + if m != nil { + return m.Seq + } + return 0 +} + +func (m *MsgFormat) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +func (m *MsgFormat) GetSenderPlatformID() int32 { + if m != nil { + return m.SenderPlatformID + } + return 0 +} + +func (m *MsgFormat) GetSenderNickName() string { + if m != nil { + return m.SenderNickName + } + return "" +} + +func (m *MsgFormat) GetSenderFaceURL() string { + if m != nil { + return m.SenderFaceURL + } + return "" +} + +func (m *MsgFormat) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +type UserSendMsgReq struct { + Options map[string]int32 `protobuf:"bytes,1,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + SenderNickName string `protobuf:"bytes,2,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,3,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + PlatformID int32 `protobuf:"varint,4,opt,name=PlatformID" json:"PlatformID,omitempty"` + SessionType int32 `protobuf:"varint,5,opt,name=SessionType" json:"SessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` + RecvID string `protobuf:"bytes,8,opt,name=RecvID" json:"RecvID,omitempty"` + ForceList []string `protobuf:"bytes,9,rep,name=ForceList" json:"ForceList,omitempty"` + Content string `protobuf:"bytes,10,opt,name=Content" json:"Content,omitempty"` + ClientMsgID string `protobuf:"bytes,11,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } +func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } +func (*UserSendMsgReq) ProtoMessage() {} +func (*UserSendMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{6} +} +func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) +} +func (m *UserSendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserSendMsgReq.Marshal(b, m, deterministic) +} +func (dst *UserSendMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserSendMsgReq.Merge(dst, src) +} +func (m *UserSendMsgReq) XXX_Size() int { + return xxx_messageInfo_UserSendMsgReq.Size(m) +} +func (m *UserSendMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_UserSendMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UserSendMsgReq proto.InternalMessageInfo + +func (m *UserSendMsgReq) GetOptions() map[string]int32 { + if m != nil { + return m.Options + } + return nil +} + +func (m *UserSendMsgReq) GetSenderNickName() string { + if m != nil { + return m.SenderNickName + } + return "" +} + +func (m *UserSendMsgReq) GetSenderFaceURL() string { + if m != nil { + return m.SenderFaceURL + } + return "" +} + +func (m *UserSendMsgReq) GetPlatformID() int32 { + if m != nil { + return m.PlatformID + } + return 0 +} + +func (m *UserSendMsgReq) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +func (m *UserSendMsgReq) GetMsgFrom() int32 { + if m != nil { + return m.MsgFrom + } + return 0 +} + +func (m *UserSendMsgReq) GetContentType() int32 { + if m != nil { + return m.ContentType + } + return 0 +} + +func (m *UserSendMsgReq) GetRecvID() string { + if m != nil { + return m.RecvID + } + return "" +} + +func (m *UserSendMsgReq) GetForceList() []string { + if m != nil { + return m.ForceList + } + return nil +} + +func (m *UserSendMsgReq) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *UserSendMsgReq) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +type UserSendMsgResp struct { + ServerMsgID string `protobuf:"bytes,1,opt,name=ServerMsgID" json:"ServerMsgID,omitempty"` + ClientMsgID string `protobuf:"bytes,2,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + SendTime int64 `protobuf:"varint,3,opt,name=sendTime" json:"sendTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } +func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } +func (*UserSendMsgResp) ProtoMessage() {} +func (*UserSendMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{7} +} +func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) +} +func (m *UserSendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserSendMsgResp.Marshal(b, m, deterministic) +} +func (dst *UserSendMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserSendMsgResp.Merge(dst, src) +} +func (m *UserSendMsgResp) XXX_Size() int { + return xxx_messageInfo_UserSendMsgResp.Size(m) +} +func (m *UserSendMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_UserSendMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UserSendMsgResp proto.InternalMessageInfo + +func (m *UserSendMsgResp) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID + } + return "" +} + +func (m *UserSendMsgResp) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *UserSendMsgResp) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +type MsgData struct { + SendID string `protobuf:"bytes,1,opt,name=sendID" json:"sendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=recvID" json:"recvID,omitempty"` + SessionType int32 `protobuf:"varint,3,opt,name=sessionType" json:"sessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,4,opt,name=msgFrom" json:"msgFrom,omitempty"` + ContentType int32 `protobuf:"varint,5,opt,name=contentType" json:"contentType,omitempty"` + ServerMsgID string `protobuf:"bytes,6,opt,name=serverMsgID" json:"serverMsgID,omitempty"` + Content string `protobuf:"bytes,7,opt,name=content" json:"content,omitempty"` + SendTime int64 `protobuf:"varint,8,opt,name=sendTime" json:"sendTime,omitempty"` + Seq int64 `protobuf:"varint,9,opt,name=seq" json:"seq,omitempty"` + SenderPlatformID int32 `protobuf:"varint,10,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` + SenderNickName string `protobuf:"bytes,11,opt,name=senderNickName" json:"senderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,12,opt,name=senderFaceURL" json:"senderFaceURL,omitempty"` + ClientMsgID string `protobuf:"bytes,13,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgData) Reset() { *m = MsgData{} } +func (m *MsgData) String() string { return proto.CompactTextString(m) } +func (*MsgData) ProtoMessage() {} +func (*MsgData) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_f143de4f947df40f, []int{8} +} +func (m *MsgData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgData.Unmarshal(m, b) +} +func (m *MsgData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgData.Marshal(b, m, deterministic) +} +func (dst *MsgData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgData.Merge(dst, src) +} +func (m *MsgData) XXX_Size() int { + return xxx_messageInfo_MsgData.Size(m) +} +func (m *MsgData) XXX_DiscardUnknown() { + xxx_messageInfo_MsgData.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgData proto.InternalMessageInfo + +func (m *MsgData) GetSendID() string { + if m != nil { + return m.SendID + } + return "" +} + +func (m *MsgData) GetRecvID() string { + if m != nil { + return m.RecvID + } + return "" +} + +func (m *MsgData) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +func (m *MsgData) GetMsgFrom() int32 { + if m != nil { + return m.MsgFrom + } + return 0 +} + +func (m *MsgData) GetContentType() int32 { + if m != nil { + return m.ContentType + } + return 0 +} + +func (m *MsgData) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID + } + return "" +} + +func (m *MsgData) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *MsgData) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +func (m *MsgData) GetSeq() int64 { + if m != nil { + return m.Seq + } + return 0 +} + +func (m *MsgData) GetSenderPlatformID() int32 { + if m != nil { + return m.SenderPlatformID + } + return 0 +} + +func (m *MsgData) GetSenderNickName() string { + if m != nil { + return m.SenderNickName + } + return "" +} + +func (m *MsgData) GetSenderFaceURL() string { + if m != nil { + return m.SenderFaceURL + } + return "" +} + +func (m *MsgData) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func init() { + proto.RegisterType((*PullMessageBySeqListResp)(nil), "open_im_sdk.PullMessageBySeqListResp") + proto.RegisterType((*PullMessageBySeqListReq)(nil), "open_im_sdk.PullMessageBySeqListReq") + proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "open_im_sdk.GetMaxAndMinSeqReq") + proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "open_im_sdk.GetMaxAndMinSeqResp") + proto.RegisterType((*GatherFormat)(nil), "open_im_sdk.GatherFormat") + proto.RegisterType((*MsgFormat)(nil), "open_im_sdk.MsgFormat") + proto.RegisterType((*UserSendMsgReq)(nil), "open_im_sdk.UserSendMsgReq") + proto.RegisterMapType((map[string]int32)(nil), "open_im_sdk.UserSendMsgReq.OptionsEntry") + proto.RegisterType((*UserSendMsgResp)(nil), "open_im_sdk.UserSendMsgResp") + proto.RegisterType((*MsgData)(nil), "open_im_sdk.MsgData") +} + +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_f143de4f947df40f) } + +var fileDescriptor_ws_f143de4f947df40f = []byte{ + // 739 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4b, 0x6b, 0xdb, 0x4a, + 0x14, 0x46, 0x52, 0xfc, 0xd0, 0xb1, 0xf3, 0x60, 0x6e, 0xc8, 0xd5, 0x0d, 0x97, 0x8b, 0x11, 0x97, + 0x62, 0xb2, 0x70, 0x20, 0xd9, 0x94, 0x94, 0x52, 0x9a, 0x3a, 0x09, 0x2e, 0x71, 0x1a, 0xc6, 0xc9, + 0xa6, 0x9b, 0xa0, 0xda, 0x53, 0x57, 0xd8, 0x7a, 0x58, 0x47, 0x79, 0xf8, 0xc7, 0xf4, 0x0f, 0x75, + 0xd1, 0x7f, 0x54, 0x28, 0x67, 0x46, 0x72, 0x66, 0x6c, 0xd3, 0x76, 0x37, 0xe7, 0xd3, 0x9c, 0x99, + 0x39, 0xdf, 0x03, 0xc1, 0x36, 0x8e, 0x26, 0x77, 0x8f, 0x78, 0xf8, 0x88, 0x9d, 0x34, 0x4b, 0xf2, + 0x84, 0x35, 0x92, 0x54, 0xc4, 0x77, 0x61, 0x74, 0x87, 0xa3, 0x89, 0xff, 0xcd, 0x02, 0xef, 0xfa, + 0x7e, 0x3a, 0xed, 0x0b, 0xc4, 0x60, 0x2c, 0x4e, 0xe7, 0x03, 0x31, 0xbb, 0x0c, 0x31, 0xe7, 0x02, + 0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0x1d, 0x4e, 0x4b, 0xca, 0x38, 0x2e, 0x67, 0x1c, 0x54, 0xc6, 0x71, 0x4d, 0xc6, 0xd1, 0x0c, 0x87, + 0xf2, 0xc0, 0x12, 0x4a, 0xe1, 0x40, 0x23, 0x1c, 0x2a, 0xbf, 0x26, 0x28, 0x59, 0xd0, 0xb4, 0xdb, + 0x54, 0x33, 0x6a, 0xd0, 0xe9, 0xde, 0xc7, 0xdd, 0xce, 0xa1, 0xfa, 0x61, 0xbe, 0xd2, 0x92, 0xfc, + 0xa9, 0x2a, 0x7f, 0x9d, 0xc7, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x38, 0x51, 0xff, 0xb4, 0x4d, + 0x07, 0x00, 0x00, +} diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto new file mode 100644 index 000000000..589e97a21 --- /dev/null +++ b/pkg/proto/sdk_ws/ws.proto @@ -0,0 +1,89 @@ +syntax = "proto3"; +package open_im_sdk;//The package name to which the proto file belongs +option go_package = "./sdk_ws;open_im_sdk";//The generated go pb file is in the current directory, and the package name is open_im_sdk + + +message PullMessageBySeqListResp { + int64 MaxSeq = 1; + int64 MinSeq = 2; + repeated GatherFormat SingleUserMsg = 3; + repeated GatherFormat GroupUserMsg = 4; +} +message PullMessageBySeqListReq{ + repeated int64 seqList =1; +} +message GetMaxAndMinSeqReq { +} +message GetMaxAndMinSeqResp { + int64 maxSeq = 1; + int64 minSeq = 2; +} +message GatherFormat{ + // @inject_tag: json:"id" + string ID = 1; + // @inject_tag: json:"list" + repeated MsgFormat List = 2;//detail msg +} +message MsgFormat{ + // @inject_tag: json:"sendID" + string SendID = 1; + // @inject_tag: json:"recvID" + string RecvID = 2; + // @inject_tag: json:"msgFrom" + int32 MsgFrom = 3; + // @inject_tag: json:"contentType" + int32 ContentType = 4; + // @inject_tag: json:"serverMsgID" + string ServerMsgID = 5; + // @inject_tag: json:"content" + string Content = 6; + // @inject_tag: json:"seq" + int64 Seq = 7; + // @inject_tag: json:"sendTime" + int64 SendTime = 8; + // @inject_tag: json:"senderPlatformID" + int32 SenderPlatformID = 9; + // @inject_tag: json:"senderNickName" + string SenderNickName = 10; + // @inject_tag: json:"senderFaceUrl" + string SenderFaceURL = 11; + // @inject_tag: json:"clientMsgID" + string ClientMsgID = 12; +} + +message UserSendMsgReq { + map Options= 1; + string SenderNickName = 2; + string SenderFaceURL = 3; + int32 PlatformID = 4; + int32 SessionType = 5; + int32 MsgFrom = 6; + int32 ContentType = 7; + string RecvID = 8; + repeated string ForceList = 9; + string Content = 10; + string ClientMsgID = 11; +} + +message UserSendMsgResp { + string ServerMsgID = 1; + string ClientMsgID = 2; + int64 sendTime = 3; + +} +message MsgData { + string sendID = 1; + string recvID = 2; + int32 sessionType = 3; + int32 msgFrom = 4; + int32 contentType = 5; + string serverMsgID = 6; + string content =7; + int64 sendTime =8; + int64 seq =9; + int32 senderPlatformID =10; + string senderNickName =11; + string senderFaceURL =12; + string clientMsgID =13; +} + diff --git a/pkg/proto/user/user.pb.go b/pkg/proto/user/user.pb.go index b98ecbe95..32771e8e3 100644 --- a/pkg/proto/user/user.pb.go +++ b/pkg/proto/user/user.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: user/user.proto -package user // import "user" +package user // import "./user" import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -35,7 +35,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{0} + return fileDescriptor_user_9e1dacb346b997d7, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -81,7 +81,7 @@ func (m *DeleteUsersResp) Reset() { *m = DeleteUsersResp{} } func (m *DeleteUsersResp) String() string { return proto.CompactTextString(m) } func (*DeleteUsersResp) ProtoMessage() {} func (*DeleteUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{1} + return fileDescriptor_user_9e1dacb346b997d7, []int{1} } func (m *DeleteUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersResp.Unmarshal(m, b) @@ -128,7 +128,7 @@ func (m *DeleteUsersReq) Reset() { *m = DeleteUsersReq{} } func (m *DeleteUsersReq) String() string { return proto.CompactTextString(m) } func (*DeleteUsersReq) ProtoMessage() {} func (*DeleteUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{2} + return fileDescriptor_user_9e1dacb346b997d7, []int{2} } func (m *DeleteUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersReq.Unmarshal(m, b) @@ -181,7 +181,7 @@ func (m *GetAllUsersUidReq) Reset() { *m = GetAllUsersUidReq{} } func (m *GetAllUsersUidReq) String() string { return proto.CompactTextString(m) } func (*GetAllUsersUidReq) ProtoMessage() {} func (*GetAllUsersUidReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{3} + return fileDescriptor_user_9e1dacb346b997d7, []int{3} } func (m *GetAllUsersUidReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUsersUidReq.Unmarshal(m, b) @@ -227,7 +227,7 @@ func (m *GetAllUsersUidResp) Reset() { *m = GetAllUsersUidResp{} } func (m *GetAllUsersUidResp) String() string { return proto.CompactTextString(m) } func (*GetAllUsersUidResp) ProtoMessage() {} func (*GetAllUsersUidResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{4} + return fileDescriptor_user_9e1dacb346b997d7, []int{4} } func (m *GetAllUsersUidResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUsersUidResp.Unmarshal(m, b) @@ -274,7 +274,7 @@ func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } func (*GetUserInfoReq) ProtoMessage() {} func (*GetUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{5} + return fileDescriptor_user_9e1dacb346b997d7, []int{5} } func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) @@ -328,7 +328,7 @@ func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } func (*GetUserInfoResp) ProtoMessage() {} func (*GetUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{6} + return fileDescriptor_user_9e1dacb346b997d7, []int{6} } func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) @@ -387,7 +387,7 @@ func (m *UserInfo) Reset() { *m = UserInfo{} } func (m *UserInfo) String() string { return proto.CompactTextString(m) } func (*UserInfo) ProtoMessage() {} func (*UserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{7} + return fileDescriptor_user_9e1dacb346b997d7, []int{7} } func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) @@ -475,7 +475,7 @@ func (m *LogoutReq) Reset() { *m = LogoutReq{} } func (m *LogoutReq) String() string { return proto.CompactTextString(m) } func (*LogoutReq) ProtoMessage() {} func (*LogoutReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{8} + return fileDescriptor_user_9e1dacb346b997d7, []int{8} } func (m *LogoutReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LogoutReq.Unmarshal(m, b) @@ -529,7 +529,7 @@ func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } func (*UpdateUserInfoReq) ProtoMessage() {} func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_9367ac00c24112e8, []int{9} + return fileDescriptor_user_9e1dacb346b997d7, []int{9} } func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) @@ -803,43 +803,44 @@ var _User_serviceDesc = grpc.ServiceDesc{ Metadata: "user/user.proto", } -func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_9367ac00c24112e8) } +func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_9e1dacb346b997d7) } -var fileDescriptor_user_9367ac00c24112e8 = []byte{ - // 560 bytes of a gzipped FileDescriptorProto +var fileDescriptor_user_9e1dacb346b997d7 = []byte{ + // 562 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x95, 0xed, 0x7c, 0x79, 0x22, 0x92, 0x74, 0x55, 0x60, 0x15, 0x21, 0x14, 0x59, 0x1c, 0x72, - 0x2a, 0x28, 0xdc, 0xe8, 0x09, 0x12, 0x51, 0x45, 0x14, 0x55, 0xb2, 0xe4, 0x0b, 0x27, 0x9c, 0xee, - 0x34, 0x5d, 0xe1, 0x78, 0x8d, 0xbd, 0x91, 0x7a, 0xe4, 0x27, 0xf1, 0xd7, 0xf8, 0x07, 0x68, 0xc7, - 0x71, 0xe2, 0xaf, 0x72, 0xa0, 0x17, 0x6b, 0xe7, 0xed, 0xfa, 0xbd, 0x7d, 0x33, 0xb3, 0x03, 0xe3, - 0x7d, 0x86, 0xe9, 0x5b, 0xf3, 0xb9, 0x48, 0x52, 0xa5, 0x15, 0xeb, 0x98, 0xb5, 0xf7, 0x19, 0x60, - 0xa9, 0x76, 0x3b, 0x15, 0xfb, 0x98, 0x25, 0xec, 0x15, 0xb8, 0x98, 0xa6, 0x2a, 0x5d, 0x2a, 0x81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 0xc6, + 0x2e, 0xf3, 0xce, 0xa8, 0xb6, 0xf8, 0xe4, 0x59, 0x0b, 0x9a, 0x25, 0xec, 0x0a, 0x86, 0xd5, 0xbc, + 0xb1, 0x17, 0x87, 0xc6, 0xaa, 0x67, 0x73, 0xd2, 0x78, 0x6e, 0x46, 0xb8, 0x34, 0x67, 0x0a, 0xe1, + 0xea, 0xe8, 0x29, 0x84, 0xeb, 0xb3, 0x6f, 0x49, 0x8f, 0xb0, 0xf4, 0xcc, 0x0b, 0xe1, 0xc6, 0x24, + 0x99, 0xf0, 0xf6, 0x8d, 0x2c, 0xf9, 0x78, 0xfe, 0x75, 0x30, 0xa7, 0x89, 0x7d, 0x65, 0x3e, 0x9b, + 0x1e, 0xcd, 0xed, 0x77, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, 0xbd, 0x59, 0x5b, 0xca, 0x05, + 0x00, 0x00, } diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index d95960125..e1d38fec6 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "user;user"; +option go_package = "./user;user"; package user; message CommonResp{ diff --git a/pkg/utils/cors_middleware.go b/pkg/utils/cors_middleware.go index 1d75c4ead..6809d786d 100644 --- a/pkg/utils/cors_middleware.go +++ b/pkg/utils/cors_middleware.go @@ -1,8 +1,9 @@ package utils import ( - "github.com/gin-gonic/gin" "net/http" + + "github.com/gin-gonic/gin" ) func CorsHandler() gin.HandlerFunc { diff --git a/pkg/utils/get_server_ip.go b/pkg/utils/get_server_ip.go index f5978b79c..b7f6076c2 100644 --- a/pkg/utils/get_server_ip.go +++ b/pkg/utils/get_server_ip.go @@ -13,23 +13,14 @@ func init() { ServerIP = config.Config.ServerIP return } - //fixme Get the ip of the local network card - netInterfaces, err := net.Interfaces() + + // see https://gist.github.com/jniltinho/9787946#gistcomment-3019898 + conn, err := net.Dial("udp", "8.8.8.8:80") if err != nil { panic(err) } - for i := 0; i < len(netInterfaces); i++ { - //Exclude useless network cards by judging the net.flag Up flag - if (netInterfaces[i].Flags & net.FlagUp) != 0 { - address, _ := netInterfaces[i].Addrs() - for _, addr := range address { - if ipNet, ok := addr.(*net.IPNet); ok && !ipNet.IP.IsLoopback() { - if ipNet.IP.To4() != nil { - ServerIP = ipNet.IP.String() - return - } - } - } - } - } + + defer conn.Close() + localAddr := conn.LocalAddr().(*net.UDPAddr) + ServerIP = localAddr.IP.String() } diff --git a/pkg/utils/jwt_token.go b/pkg/utils/jwt_token.go index 604ee2400..fd6a69ea0 100644 --- a/pkg/utils/jwt_token.go +++ b/pkg/utils/jwt_token.go @@ -4,7 +4,7 @@ import ( "Open_IM/pkg/common/config" "Open_IM/pkg/common/db" "errors" - "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" "time" ) @@ -19,38 +19,27 @@ var ( type Claims struct { UID string Platform string //login platform - jwt.StandardClaims + jwt.RegisteredClaims } -func BuildClaims(uid, accountAddr, platform string, ttl int64) Claims { - now := time.Now().Unix() - //if ttl=-1 Permanent token - if ttl == -1 { - return Claims{ - UID: uid, - Platform: platform, - StandardClaims: jwt.StandardClaims{ - ExpiresAt: -1, - IssuedAt: now, - NotBefore: now, - }} - } +func BuildClaims(uid, platform string, ttl int64) Claims { + now := time.Now() return Claims{ UID: uid, Platform: platform, - StandardClaims: jwt.StandardClaims{ - ExpiresAt: now + ttl, //Expiration time - IssuedAt: now, //Issuing time - NotBefore: now, //Begin Effective time + RegisteredClaims: jwt.RegisteredClaims{ + ExpiresAt: jwt.NewNumericDate(now.Add(time.Duration(ttl*24) * time.Hour)), //Expiration time + IssuedAt: jwt.NewNumericDate(now), //Issuing time + NotBefore: jwt.NewNumericDate(now), //Begin Effective time }} } -func CreateToken(userID, accountAddr string, platform int32) (string, int64, error) { - claims := BuildClaims(userID, accountAddr, PlatformIDToName(platform), config.Config.TokenPolicy.AccessExpire) +func CreateToken(userID string, platform int32) (string, int64, error) { + claims := BuildClaims(userID, PlatformIDToName(platform), config.Config.TokenPolicy.AccessExpire) token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) tokenString, err := token.SignedString([]byte(config.Config.TokenPolicy.AccessSecret)) - return tokenString, claims.ExpiresAt, err + return tokenString, claims.ExpiresAt.Time.Unix(), err } func secret() jwt.Keyfunc { @@ -59,7 +48,7 @@ func secret() jwt.Keyfunc { } } -func ParseToken(tokensString string) (claims *Claims, err error) { +func getClaimFromToken(tokensString string) (*Claims, error) { token, err := jwt.ParseWithClaims(tokensString, &Claims{}, secret()) if err != nil { if ve, ok := err.(*jwt.ValidationError); ok { @@ -75,76 +64,66 @@ func ParseToken(tokensString string) (claims *Claims, err error) { } } if claims, ok := token.Claims.(*Claims); ok && token.Valid { - // 1.check userid and platform class 0 not exists and 1 exists - existsInterface, err := db.DB.ExistsUserIDAndPlatform(claims.UID, Platform2class[claims.Platform]) + return claims, nil + } + return nil, err +} + +func ParseToken(tokensString string) (claims *Claims, err error) { + claims, err = getClaimFromToken(tokensString) + + if err != nil { + return nil, err + } + + // 1.check userid and platform class 0 not exists and 1 exists + existsInterface, err := db.DB.ExistsUserIDAndPlatform(claims.UID, Platform2class[claims.Platform]) + if err != nil { + return nil, err + } + exists := existsInterface.(int64) + //get config multi login policy + if config.Config.MultiLoginPolicy.OnlyOneTerminalAccess { + //OnlyOneTerminalAccess policy need to check all terminal + //When only one end is allowed to log in, there is a situation that needs to be paid attention to. After PC login, + //mobile login should check two platform times. One of them is less than the redis storage time, which is the invalid token. + platform := "PC" + if Platform2class[claims.Platform] == "PC" { + platform = "Mobile" + } + + existsInterface, err = db.DB.ExistsUserIDAndPlatform(claims.UID, platform) if err != nil { return nil, err } - exists := existsInterface.(int64) - //get config multi login policy - if config.Config.MultiLoginPolicy.OnlyOneTerminalAccess { - //OnlyOneTerminalAccess policy need to check all terminal - //When only one end is allowed to log in, there is a situation that needs to be paid attention to. After PC login, - //mobile login should check two platform times. One of them is less than the redis storage time, which is the invalid token. - if Platform2class[claims.Platform] == "PC" { - existsInterface, err = db.DB.ExistsUserIDAndPlatform(claims.UID, "Mobile") - if err != nil { - return nil, err - } - exists = existsInterface.(int64) - if exists == 1 { - res, err := MakeTheTokenInvalid(*claims, "Mobile") - if err != nil { - return nil, err - } - if res { - return nil, TokenInvalid - } - } - } else { - existsInterface, err = db.DB.ExistsUserIDAndPlatform(claims.UID, "PC") - if err != nil { - return nil, err - } - exists = existsInterface.(int64) - if exists == 1 { - res, err := MakeTheTokenInvalid(*claims, "PC") - if err != nil { - return nil, err - } - if res { - return nil, TokenInvalid - } - } - } - if exists == 1 { - res, err := MakeTheTokenInvalid(*claims, Platform2class[claims.Platform]) - if err != nil { - return nil, err - } - if res { - return nil, TokenInvalid - } + exists = existsInterface.(int64) + if exists == 1 { + res, err := MakeTheTokenInvalid(claims, platform) + if err != nil { + return nil, err } - - } else if config.Config.MultiLoginPolicy.MobileAndPCTerminalAccessButOtherTerminalKickEachOther { - if exists == 1 { - res, err := MakeTheTokenInvalid(*claims, Platform2class[claims.Platform]) - if err != nil { - return nil, err - } - if res { - return nil, TokenInvalid - } + if res { + return nil, TokenInvalid } } - return claims, nil } - return nil, TokenUnknown + // config.Config.MultiLoginPolicy.MobileAndPCTerminalAccessButOtherTerminalKickEachOther == true + // or PC/Mobile validate success + // final check + if exists == 1 { + res, err := MakeTheTokenInvalid(claims, Platform2class[claims.Platform]) + if err != nil { + return nil, err + } + if res { + return nil, TokenInvalid + } + } + return claims, nil } -func MakeTheTokenInvalid(currentClaims Claims, platformClass string) (bool, error) { +func MakeTheTokenInvalid(currentClaims *Claims, platformClass string) (bool, error) { storedRedisTokenInterface, err := db.DB.GetPlatformToken(currentClaims.UID, platformClass) if err != nil { return false, err @@ -154,40 +133,21 @@ func MakeTheTokenInvalid(currentClaims Claims, platformClass string) (bool, erro return false, err } //if issue time less than redis token then make this token invalid - if currentClaims.IssuedAt < storedRedisPlatformClaims.IssuedAt { + if currentClaims.IssuedAt.Time.Unix() < storedRedisPlatformClaims.IssuedAt.Time.Unix() { return true, TokenInvalid } return false, nil } + func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) { - token, err := jwt.ParseWithClaims(string(redisToken.([]uint8)), &Claims{}, secret()) - if err != nil { - if ve, ok := err.(*jwt.ValidationError); ok { - if ve.Errors&jwt.ValidationErrorMalformed != 0 { - return nil, TokenMalformed - } else if ve.Errors&jwt.ValidationErrorExpired != 0 { - return nil, TokenExpired - } else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 { - return nil, TokenNotValidYet - } else { - return nil, TokenInvalid - } - } - } - if claims, ok := token.Claims.(*Claims); ok && token.Valid { - return claims, nil - } - return nil, err + return getClaimFromToken(string(redisToken.([]uint8))) } //Validation token, false means failure, true means successful verification func VerifyToken(token, uid string) bool { claims, err := ParseToken(token) - if err != nil { - return false - } else if claims.UID != uid { + if err != nil || claims.UID != uid { return false - } else { - return true } + return true } diff --git a/pkg/utils/map.go b/pkg/utils/map.go index c52cebf67..2807805db 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -106,6 +106,11 @@ func MapToJsonString(param map[string]interface{}) string { dataString := string(dataType) return dataString } +func MapIntToJsonString(param map[string]int32) string { + dataType, _ := json.Marshal(param) + dataString := string(dataType) + return dataString +} func JsonStringToMap(str string) (tempMap map[string]interface{}) { _ = json.Unmarshal([]byte(str), &tempMap) return tempMap diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go index f676da884..39c797859 100644 --- a/pkg/utils/strings.go +++ b/pkg/utils/strings.go @@ -37,6 +37,7 @@ func IsContain(target string, List []string) bool { return false } + func InterfaceArrayToStringArray(data []interface{}) (i []string) { for _, param := range data { i = append(i, param.(string)) @@ -62,3 +63,6 @@ func GetMsgID(sendID string) string { func int64ToString(i int64) string { return strconv.FormatInt(i, 10) } +func Int64ToString(i int64) string { + return strconv.FormatInt(i, 10) +} diff --git a/script/check_all.sh b/script/check_all.sh index dd8042fde..9e6d45db4 100644 --- a/script/check_all.sh +++ b/script/check_all.sh @@ -15,17 +15,39 @@ service_port_name=( openImWsPort openImSdkWsPort ) - for i in ${service_port_name[*]};do - list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') - list_to_string $list - for j in ${ports_array};do - port=`netstat -netulp |grep ./open_im| awk '{print $4}'|grep -w ${j}|awk -F '[:]' '{print $NF}'` - if [[ ${port} -ne ${j} ]]; then - echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX} - exit 1 - else - echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX} - fi - done +for i in ${service_port_name[*]}; do + list=$(cat $config_path | grep -w ${i} | awk -F '[:]' '{print $NF}') + list_to_string $list + for j in ${ports_array}; do + port=$(netstat -netulp | grep ./open_im | awk '{print $4}' | grep -w ${j} | awk -F '[:]' '{print $NF}') + if [[ ${port} -ne ${j} ]]; then + echo -e ${YELLOW_PREFIX}${i}${COLOR_SUFFIX}${RED_PREFIX}" service does not start normally,not initiated port is "${COLOR_SUFFIX}${YELLOW_PREFIX}${j}${COLOR_SUFFIX} + echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX} + exit -1 + else + echo -e ${j}${GREEN_PREFIX}" port has been listening,belongs service is "${i}${COLOR_SUFFIX} + fi done - echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX} +done + +#Check launched service process +check=$(ps aux | grep -w ./${msg_transfer_name} | grep -v grep | wc -l) +if [ $check -eq ${msg_transfer_service_num} ]; then + echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImMsgTransfer"${COLOR_SUFFIX} +else + echo -e ${RED_PREFIX}"openImMsgTransfer service does not start normally, num err"${COLOR_SUFFIX} + echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX} + exit -1 +fi + + +check=$(ps aux | grep -w ./${timer_task_name} | grep -v grep | wc -l) +if [ $check -ge 1 ]; then + echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImMsgTimer"${COLOR_SUFFIX} +else + echo -e ${RED_PREFIX}"openImMsgTimer service does not start normally"${COLOR_SUFFIX} + echo -e ${RED_PREFIX}"please check ../logs/openIM.log "${COLOR_SUFFIX} + exit -1 +fi + +echo -e ${YELLOW_PREFIX}"all services launch success"${COLOR_SUFFIX} diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index 740b88e85..839a46688 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -9,6 +9,7 @@ need_to_start_server_shell=( push_start.sh msg_transfer_start.sh sdk_svr_start.sh + timer_start.sh ) #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started diff --git a/script/msg_gateway_start.sh b/script/msg_gateway_start.sh index 197c28743..1df53cfdd 100644 --- a/script/msg_gateway_start.sh +++ b/script/msg_gateway_start.sh @@ -44,5 +44,5 @@ if [ $check -ge 1 ]; then echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} else - echo -e ${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX} + echo -e ${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX} fi diff --git a/script/msg_transfer_start.sh b/script/msg_transfer_start.sh index 30caeb466..4d7fb96cd 100644 --- a/script/msg_transfer_start.sh +++ b/script/msg_transfer_start.sh @@ -8,31 +8,29 @@ source ./path_info.cfg #Check if the service exists #If it is exists,kill this process check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l` -if [ $check -eq 1 ] +if [ $check -ge 1 ] then oldPid=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep|awk '{print $2}'` kill -9 $oldPid fi #Waiting port recycling sleep 1 + cd ${msg_transfer_binary_root} - nohup ./${msg_transfer_name} >>../logs/openIM.log 2>&1 & +for ((i = 0; i < ${msg_transfer_service_num}; i++)); do + nohup ./${msg_transfer_name} >>../logs/openIM.log 2>&1 & +done + #Check launched service process check=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep| wc -l` -if [ $check -eq 1 ] +if [ $check -ge 1 ] then newPid=`ps aux | grep -w ./${msg_transfer_name} | grep -v grep|awk '{print $2}'` -ports=`netstat -netulp | grep -w ${newPid}|awk '{print $4}'|awk -F '[:]' '{print $NF}'` allPorts="" - -for i in $ports ; -do - allPorts=${allPorts}"$i " -done echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} else - echo -e ${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX} + echo -e ${YELLOW_PREFIX}${msg_transfer_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX} fi diff --git a/script/path_info.cfg b/script/path_info.cfg index 30e5b4491..b97588e61 100644 --- a/script/path_info.cfg +++ b/script/path_info.cfg @@ -16,8 +16,13 @@ push_source_root="../cmd/open_im_push/" msg_transfer_name="open_im_msg_transfer" msg_transfer_binary_root="../bin/" msg_transfer_source_root="../cmd/open_im_msg_transfer/" +msg_transfer_service_num=2 +timer_task_name="open_im_timer_task" +timer_task_binary_root="../bin/" +timer_task_source_root="../cmd/open_im_timer_task/" + sdk_server_name="open_im_sdk_server" sdk_server_binary_root="../bin/" sdk_server_source_root="../cmd/Open-IM-SDK-Core/" @@ -40,6 +45,7 @@ service_source_root=( ${msg_source_root} ${push_source_root} ${sdk_server_source_root} + ${timer_task_source_root} ) #service filename service_names=( @@ -55,6 +61,7 @@ service_names=( ${msg_name} ${push_name} ${sdk_server_name} + ${timer_task_name} ) diff --git a/script/push_start.sh b/script/push_start.sh index 668c0068f..8b2a47896 100644 --- a/script/push_start.sh +++ b/script/push_start.sh @@ -13,7 +13,7 @@ rpc_ports=($ports_array) #Check if the service exists #If it is exists,kill this process check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l) -if [ $check -eq 1 ]; then +if [ $check -ge 1 ]; then oldPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}') kill -9 $oldPid fi @@ -28,7 +28,7 @@ done sleep 3 #Check launched service process check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l) -if [ $check -eq 1 ]; then +if [ $check -ge 1 ]; then newPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}') ports=$(netstat -netulp | grep -w ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}') allPorts="" @@ -41,5 +41,5 @@ if [ $check -eq 1 ]; then echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} else - echo -e ${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX} + echo -e ${YELLOW_PREFIX}${push_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX} fi diff --git a/script/sdk_svr_start.sh b/script/sdk_svr_start.sh index 28d764b73..97c694233 100644 --- a/script/sdk_svr_start.sh +++ b/script/sdk_svr_start.sh @@ -43,5 +43,5 @@ if [ $check -ge 1 ]; then echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allNewPid}${COLOR_SUFFIX} echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} else - echo -e ${YELLOW_PREFIX}${sdk_server_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR !!! PLEASE CHECK ERROR LOG"${COLOR_SUFFIX} + echo -e ${YELLOW_PREFIX}${sdk_server_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR PLEASE CHECK openIM.log"${COLOR_SUFFIX} fi diff --git a/script/start_all.sh b/script/start_all.sh index 43a02b34d..956bc0d51 100644 --- a/script/start_all.sh +++ b/script/start_all.sh @@ -9,6 +9,7 @@ need_to_start_server_shell=( push_start.sh msg_transfer_start.sh sdk_svr_start.sh + timer_start.sh ) for i in ${need_to_start_server_shell[*]}; do diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh index 74f00a3f4..9491a4fe8 100644 --- a/script/start_rpc_service.sh +++ b/script/start_rpc_service.sh @@ -26,7 +26,6 @@ service_port_name=( openImGroupPort openImAuthPort openImOfflineMessagePort - ) for ((i = 0; i < ${#service_filename[*]}; i++)); do diff --git a/script/timer_start.sh b/script/timer_start.sh new file mode 100644 index 000000000..7e2791f11 --- /dev/null +++ b/script/timer_start.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +#Include shell font styles and some basic information +source ./style_info.cfg +source ./path_info.cfg + + + +#Check if the service exists +#If it is exists,kill this process +check=`ps aux | grep -w ./${timer_task_name} | grep -v grep| wc -l` +if [ $check -ge 1 ] +then +oldPid=`ps aux | grep -w ./${timer_task_name} | grep -v grep|awk '{print $2}'` + kill -9 $oldPid +fi +#Waiting port recycling +sleep 1 + +cd ${timer_task_binary_root} +nohup ./${timer_task_name} >>../logs/openIM.log 2>&1 & + + +#Check launched service process +check=`ps aux | grep -w ./${timer_task_name} | grep -v grep| wc -l` +if [ $check -ge 1 ] +then +newPid=`ps aux | grep -w ./${timer_task_name} | grep -v grep|awk '{print $2}'` +allPorts="" + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${timer_task_name}${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"PID: "${COLOR_SUFFIX}${YELLOW_PREFIX}${newPid}${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"LISTENING_PORT: "${COLOR_SUFFIX}${YELLOW_PREFIX}${allPorts}${COLOR_SUFFIX} +else + echo -e ${YELLOW_PREFIX}${timer_task_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX} +fi